Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2009, 4:01:35 PM (15 years ago)
Author:
rgrieder
Message:

StartLevel —> DefaultLevel and moved the CommandLine argument (—level) to the LevelManager.

Location:
code/branches/core4/src/orxonox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/LevelManager.cc

    r3245 r3249  
    4040namespace orxonox
    4141{
     42    SetCommandLineArgument(level, "").shortcut("l");
     43
    4244    LevelManager* LevelManager::singletonRef_s = 0;
    4345
     
    5355        if (!CommandLine::getArgument("level")->hasDefaultValue())
    5456        {
    55             ModifyConfigValue(startLevelName_, tset, CommandLine::getValue("mediaPath").getString());
     57            ModifyConfigValue(defaultLevelName_, tset, CommandLine::getValue("mediaPath").getString());
    5658        }
    5759    }
     
    6567    void LevelManager::setConfigValues()
    6668    {
    67         SetConfigValue(startLevelName_, "presentation_dm.oxw")
     69        SetConfigValue(defaultLevelName_, "presentation_dm.oxw")
    6870            .description("Sets the preselection of the level in the main menu.");
    6971    }
     
    113115    }
    114116
    115     void LevelManager::setStartLevel(const std::string& levelName)
     117    void LevelManager::setDefaultLevel(const std::string& levelName)
    116118    {
    117         ModifyConfigValue(startLevelName_, set, levelName);
     119        ModifyConfigValue(defaultLevelName_, set, levelName);
    118120    }
    119121
    120     const std::string& LevelManager::getStartLevel()
     122    const std::string& LevelManager::getDefaultLevel()
    121123    {
    122         return startLevelName_;
     124        return defaultLevelName_;
    123125    }
    124126}
  • code/branches/core4/src/orxonox/LevelManager.h

    r3245 r3249  
    5353            Level* getActiveLevel();
    5454
    55             void setStartLevel(const std::string& levelName); //tolua_export
    56             const std::string& getStartLevel(); //tolua_export
     55            void setDefaultLevel(const std::string& levelName); //tolua_export
     56            const std::string& getDefaultLevel(); //tolua_export
    5757
    5858            static LevelManager* getInstancePtr() { return singletonRef_s; }
     
    6767
    6868            // config values
    69             std::string startLevelName_;
     69            std::string defaultLevelName_;
    7070
    7171            static LevelManager* singletonRef_s;
  • code/branches/core4/src/orxonox/gamestates/GSLevel.cc

    r3245 r3249  
    3434#include "core/input/KeyBinder.h"
    3535#include "core/Clock.h"
    36 #include "core/CommandLine.h"
    3736#include "core/ConsoleCommand.h"
    3837#include "core/ConfigValueIncludes.h"
     
    5756{
    5857    DeclareGameState(GSLevel, "level", false, true);
    59 
    60     SetCommandLineArgument(level, "").shortcut("l");
    6158    SetConsoleCommand(GSLevel, showIngameGUI, true);
    6259
     
    242239        // call the loader
    243240        COUT(0) << "Loading level..." << std::endl;
    244         std::string levelName;
    245         CommandLine::getValue("level", &levelName);
    246         if (levelName == "")
    247             startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + LevelManager::getInstance().getStartLevel());
    248         else
    249             startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + levelName);
     241        startFile_s = new XMLFile(Core::getMediaPathString() + "levels" + '/' + LevelManager::getInstance().getDefaultLevel());
    250242        Loader::open(startFile_s);
    251243    }
Note: See TracChangeset for help on using the changeset viewer.