Changeset 8079 for code/trunk/src/orxonox/gamestates/GSRoot.cc
- Timestamp:
- Mar 15, 2011, 9:47:11 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gamestates/GSRoot.cc
r7284 r8079 38 38 #include "tools/interfaces/Tickable.h" 39 39 40 #include "GSLevel.h" 41 40 42 namespace orxonox 41 43 { … … 43 45 44 46 static const std::string __CC_setTimeFactor_name = "setTimeFactor"; 47 static const std::string __CC_setPause_name = "setPause"; 45 48 static const std::string __CC_pause_name = "pause"; 49 50 /*static*/ bool GSRoot::startMainMenu_s = false; 46 51 47 52 SetConsoleCommand("printObjects", &GSRoot::printObjects).hide(); 48 53 SetConsoleCommand(__CC_setTimeFactor_name, &GSRoot::setTimeFactor).accessLevel(AccessLevel::Master).defaultValues(1.0); 54 SetConsoleCommand(__CC_setPause_name, &GSRoot::setPause ).accessLevel(AccessLevel::Master).hide(); 49 55 SetConsoleCommand(__CC_pause_name, &GSRoot::pause ).accessLevel(AccessLevel::Master); 50 56 … … 83 89 84 90 ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(this); 91 ModifyConsoleCommand(__CC_setPause_name).setObject(this); 85 92 ModifyConsoleCommand(__CC_pause_name).setObject(this); 86 93 } … … 89 96 { 90 97 ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(0); 98 ModifyConsoleCommand(__CC_setPause_name).setObject(0); 91 99 ModifyConsoleCommand(__CC_pause_name).setObject(0); 92 100 } … … 94 102 void GSRoot::update(const Clock& time) 95 103 { 104 if(startMainMenu_s) 105 { 106 delayedStartMainMenu(); 107 startMainMenu_s = false; 108 } 109 96 110 for (ObjectList<Timer>::iterator it = ObjectList<Timer>::begin(); it; ) 97 111 { … … 157 171 } 158 172 173 void GSRoot::setPause(bool pause) 174 { 175 if (GameMode::isMaster()) 176 { 177 if (pause != this->bPaused_) 178 this->pause(); 179 } 180 } 181 159 182 void GSRoot::changedTimeFactor(float factor_new, float factor_old) 160 183 { … … 162 185 callStaticNetworkFunction(&TimeFactorListener::setTimeFactor, CLIENTID_UNKNOWN, factor_new); 163 186 } 187 188 /*static*/ void GSRoot::delayedStartMainMenu(void) 189 { 190 if(!startMainMenu_s) 191 startMainMenu_s = true; 192 else 193 GSLevel::startMainMenu(); 194 } 195 164 196 }
Note: See TracChangeset
for help on using the changeset viewer.