Changeset 8029 for code/branches/usability/src/orxonox/gamestates
- Timestamp:
- Mar 6, 2011, 1:38:49 PM (14 years ago)
- Location:
- code/branches/usability/src/orxonox/gamestates
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/src/orxonox/gamestates/GSLevel.cc
r7978 r8029 46 46 #include "LevelManager.h" 47 47 #include "PlayerManager.h" 48 #include "GSRoot.h" 48 49 49 50 namespace orxonox … … 156 157 COUT(0) << "Loading level..." << std::endl; 157 158 startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel()); 158 Loader::open(startFile_);159 bool loaded = Loader::open(startFile_); 159 160 160 161 Core::getInstance().updateLastLevelTimestamp(); 162 if(!loaded) 163 GSRoot::delayedStartMainMenu(); 161 164 } 162 165 -
code/branches/usability/src/orxonox/gamestates/GSRoot.cc
r7935 r8029 38 38 #include "tools/interfaces/Tickable.h" 39 39 40 #include "GSLevel.h" 41 40 42 namespace orxonox 41 43 { … … 45 47 static const std::string __CC_setPause_name = "setPause"; 46 48 static const std::string __CC_pause_name = "pause"; 49 50 /*static*/ bool GSRoot::startMainMenu_s = false; 47 51 48 52 SetConsoleCommand("printObjects", &GSRoot::printObjects).hide(); … … 98 102 void GSRoot::update(const Clock& time) 99 103 { 104 if(startMainMenu_s) 105 { 106 delayedStartMainMenu(); 107 startMainMenu_s = false; 108 } 109 100 110 for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; ) 101 111 { … … 175 185 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new); 176 186 } 187 188 /*static*/ void GSRoot::delayedStartMainMenu(void) 189 { 190 if(!startMainMenu_s) 191 startMainMenu_s = true; 192 else 193 GSLevel::startMainMenu(); 194 } 195 177 196 } -
code/branches/usability/src/orxonox/gamestates/GSRoot.h
r7935 r8029 54 54 void pause(); 55 55 56 static void delayedStartMainMenu(void); 57 56 58 protected: 57 59 virtual void changedTimeFactor(float factor_new, float factor_old); … … 60 62 bool bPaused_; 61 63 float timeFactorPauseBackup_; 64 static bool startMainMenu_s; 62 65 }; 63 66 }
Note: See TracChangeset
for help on using the changeset viewer.