Changeset 7284 for code/trunk/src/orxonox/gamestates/GSRoot.cc
- Timestamp:
- Aug 31, 2010, 3:37:40 AM (14 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
r7172 r7284 31 31 #include "util/Clock.h" 32 32 #include "core/BaseObject.h" 33 #include "core/ConsoleCommand.h"34 33 #include "core/Game.h" 35 34 #include "core/GameMode.h" 35 #include "core/command/ConsoleCommand.h" 36 36 #include "network/NetworkFunction.h" 37 37 #include "tools/Timer.h" … … 41 41 { 42 42 DeclareGameState(GSRoot, "root", false, false); 43 SetConsoleCommandShortcut(GSRoot, printObjects); 43 44 static const std::string __CC_setTimeFactor_name = "setTimeFactor"; 45 static const std::string __CC_pause_name = "pause"; 46 47 SetConsoleCommand("printObjects", &GSRoot::printObjects).hide(); 48 SetConsoleCommand(__CC_setTimeFactor_name, &GSRoot::setTimeFactor).accessLevel(AccessLevel::Master).defaultValues(1.0); 49 SetConsoleCommand(__CC_pause_name, &GSRoot::pause ).accessLevel(AccessLevel::Master); 44 50 45 51 registerStaticNetworkFunction(&TimeFactorListener::setTimeFactor); … … 76 82 TimeFactorListener::setTimeFactor(1.0f); 77 83 78 // time factor console command 79 ConsoleCommand* command = createConsoleCommand(createFunctor(&GSRoot::setTimeFactor, this), "setTimeFactor"); 80 CommandExecutor::addConsoleCommandShortcut(command).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0); 81 82 // time factor console command 83 command = createConsoleCommand(createFunctor(&GSRoot::pause, this), "pause"); 84 CommandExecutor::addConsoleCommandShortcut(command).accessLevel(AccessLevel::Offline); 84 ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(this); 85 ModifyConsoleCommand(__CC_pause_name).setObject(this); 85 86 } 86 87 87 88 void GSRoot::deactivate() 88 89 { 90 ModifyConsoleCommand(__CC_setTimeFactor_name).setObject(0); 91 ModifyConsoleCommand(__CC_pause_name).setObject(0); 89 92 } 90 93
Note: See TracChangeset
for help on using the changeset viewer.