Changeset 2896 for code/trunk/src/orxonox/gamestates/GSIOConsole.cc
- Timestamp:
- Apr 6, 2009, 1:59:00 AM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/gui merged: 2796,2798-2801,2805,2807-2808,2811,2814-2817,2834,2840-2850,2853-2854,2859,2862-2863,2869,2875,2887,2892
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/gamestates/GSIOConsole.cc
r2087 r2896 36 36 37 37 #include "core/ConsoleCommand.h" 38 #include "core/Game.h" 38 39 39 40 namespace orxonox 40 41 { 41 GSIOConsole::GSIOConsole() 42 : GameState<GSRoot>("ioConsole") 42 AddGameState(GSIOConsole, "ioConsole"); 43 44 GSIOConsole::GSIOConsole(const std::string& name) 45 : GameState(name) 43 46 { 44 47 } … … 48 51 } 49 52 50 void GSIOConsole:: enter()53 void GSIOConsole::activate() 51 54 { 55 { 56 FunctorMember<GSIOConsole>* functor = createFunctor(&GSIOConsole::loadMenu); 57 functor->setObject(this); 58 this->ccLoadMenu_ = createConsoleCommand(functor, "loadMenu"); 59 CommandExecutor::addConsoleCommandShortcut(this->ccLoadMenu_); 60 } 52 61 } 53 62 54 void GSIOConsole:: leave()63 void GSIOConsole::deactivate() 55 64 { 65 if (this->ccLoadMenu_) 66 { 67 delete this->ccLoadMenu_; 68 this->ccLoadMenu_ = 0; 69 } 56 70 } 57 71 58 void GSIOConsole:: ticked(const Clock& time)72 void GSIOConsole::update(const Clock& time) 59 73 { 74 std::cout << ">"; 60 75 std::string command; 61 76 std::getline(std::cin, command); 62 77 CommandExecutor::execute(command, true); 63 64 tickChild(time); 78 } 79 80 void GSIOConsole::loadMenu() 81 { 82 Game::getInstance().popState(); 83 Game::getInstance().requestStates("graphics, mainMenu"); 65 84 } 66 85 }
Note: See TracChangeset
for help on using the changeset viewer.