Changeset 3249 for code/branches/core4/src
- Timestamp:
- Jun 29, 2009, 4:01:35 PM (15 years ago)
- Location:
- code/branches/core4/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/orxonox/LevelManager.cc
r3245 r3249 40 40 namespace orxonox 41 41 { 42 SetCommandLineArgument(level, "").shortcut("l"); 43 42 44 LevelManager* LevelManager::singletonRef_s = 0; 43 45 … … 53 55 if (!CommandLine::getArgument("level")->hasDefaultValue()) 54 56 { 55 ModifyConfigValue( startLevelName_, tset, CommandLine::getValue("mediaPath").getString());57 ModifyConfigValue(defaultLevelName_, tset, CommandLine::getValue("mediaPath").getString()); 56 58 } 57 59 } … … 65 67 void LevelManager::setConfigValues() 66 68 { 67 SetConfigValue( startLevelName_, "presentation_dm.oxw")69 SetConfigValue(defaultLevelName_, "presentation_dm.oxw") 68 70 .description("Sets the preselection of the level in the main menu."); 69 71 } … … 113 115 } 114 116 115 void LevelManager::set StartLevel(const std::string& levelName)117 void LevelManager::setDefaultLevel(const std::string& levelName) 116 118 { 117 ModifyConfigValue( startLevelName_, set, levelName);119 ModifyConfigValue(defaultLevelName_, set, levelName); 118 120 } 119 121 120 const std::string& LevelManager::get StartLevel()122 const std::string& LevelManager::getDefaultLevel() 121 123 { 122 return startLevelName_;124 return defaultLevelName_; 123 125 } 124 126 } -
code/branches/core4/src/orxonox/LevelManager.h
r3245 r3249 53 53 Level* getActiveLevel(); 54 54 55 void set StartLevel(const std::string& levelName); //tolua_export56 const std::string& get StartLevel(); //tolua_export55 void setDefaultLevel(const std::string& levelName); //tolua_export 56 const std::string& getDefaultLevel(); //tolua_export 57 57 58 58 static LevelManager* getInstancePtr() { return singletonRef_s; } … … 67 67 68 68 // config values 69 std::string startLevelName_;69 std::string defaultLevelName_; 70 70 71 71 static LevelManager* singletonRef_s; -
code/branches/core4/src/orxonox/gamestates/GSLevel.cc
r3245 r3249 34 34 #include "core/input/KeyBinder.h" 35 35 #include "core/Clock.h" 36 #include "core/CommandLine.h"37 36 #include "core/ConsoleCommand.h" 38 37 #include "core/ConfigValueIncludes.h" … … 57 56 { 58 57 DeclareGameState(GSLevel, "level", false, true); 59 60 SetCommandLineArgument(level, "").shortcut("l");61 58 SetConsoleCommand(GSLevel, showIngameGUI, true); 62 59 … … 242 239 // call the loader 243 240 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()); 250 242 Loader::open(startFile_s); 251 243 }
Note: See TracChangeset
for help on using the changeset viewer.