Changeset 2844 for code/branches/gui/src/orxonox/gamestates/GSGUI.cc
- Timestamp:
- Mar 25, 2009, 5:23:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSGUI.cc
r2817 r2844 32 32 #include <OgreViewport.h> 33 33 #include "core/Clock.h" 34 #include "core/ConsoleCommand.h" 34 35 #include "core/input/InputManager.h" 35 36 #include "core/input/SimpleInputState.h" 36 37 #include "gui/GUIManager.h" 37 38 #include "GraphicsManager.h" 39 #include "core/Game.h" 38 40 39 41 namespace orxonox 40 42 { 41 GSGUI::GSGUI() 42 : GameState("gui") 43 AddGameState(GSGUI, "gui"); 44 45 GSGUI::GSGUI(const std::string& name) 46 : GameState(name) 43 47 { 44 48 } … … 48 52 } 49 53 50 void GSGUI:: enter()54 void GSGUI::activate() 51 55 { 52 56 guiManager_ = GUIManager::getInstancePtr(); … … 56 60 guiManager_->showGUI("MainMenu", 0); 57 61 GraphicsManager::getInstance().getViewport()->setCamera(guiManager_->getCamera()); 62 63 { 64 // time factor console command 65 FunctorMember<GSGUI>* functor = createFunctor(&GSGUI::startGame); 66 functor->setObject(this); 67 this->ccStartGame_ = createConsoleCommand(functor, "startGame"); 68 CommandExecutor::addConsoleCommandShortcut(this->ccStartGame_); 69 } 58 70 } 59 71 60 void GSGUI:: leave()72 void GSGUI::deactivate() 61 73 { 74 if (this->ccStartGame_) 75 { 76 delete this->ccStartGame_; 77 this->ccStartGame_ = 0; 78 } 79 62 80 guiManager_->hideGUI(); 63 81 } 64 82 65 void GSGUI:: ticked(const Clock& time)83 void GSGUI::update(const Clock& time) 66 84 { 67 85 // tick CEGUI 68 86 guiManager_->update(time); 87 } 69 88 70 this->tickChild(time); 89 void GSGUI::startGame() 90 { 91 // HACK - HACK 92 Game::getInstance().popState(); 93 Game::getInstance().requestState("standalone"); 94 Game::getInstance().requestState("level"); 71 95 } 72 96 }
Note: See TracChangeset
for help on using the changeset viewer.