Changeset 2896 for code/trunk/src/orxonox/gamestates/GSStandalone.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/GSStandalone.cc
r2790 r2896 32 32 #include <OgreViewport.h> 33 33 #include <OgreCamera.h> 34 #include "core/Core.h" 34 #include "core/Game.h" 35 #include "core/GameMode.h" 35 36 #include "core/ConsoleCommand.h" 36 37 #include "gui/GUIManager.h" 38 #include "GraphicsManager.h" 37 39 38 40 namespace orxonox 39 41 { 40 SetConsoleCommand(GSStandalone, showGUI, true).setAsInputCommand();42 AddGameState(GSStandalone, "standalone"); 41 43 42 bool GSStandalone::guiShowing_s = false; 43 44 GSStandalone::GSStandalone() 45 : GameState<GSGraphics>("standalone") 44 GSStandalone::GSStandalone(const std::string& name) 45 : GameState(name) 46 46 { 47 47 } … … 51 51 } 52 52 53 void GSStandalone::showGUI() 53 54 void GSStandalone::activate() 54 55 { 55 G SStandalone::guiShowing_s = true;56 GameMode::setIsStandalone(true); 56 57 } 57 58 58 void GSStandalone:: enter()59 void GSStandalone::deactivate() 59 60 { 60 Core::setIsStandalone(true); 61 62 GSLevel::enter(this->getParent()->getViewport()); 63 64 guiManager_ = getParent()->getGUIManager(); 65 // not sure if necessary 66 // guiManager_->loadScene("IngameMenu"); 61 GameMode::setIsStandalone(false); 67 62 } 68 63 69 void GSStandalone:: leave()64 void GSStandalone::update(const Clock& time) 70 65 { 71 GSLevel::leave();72 73 Core::setIsStandalone(false);74 }75 76 void GSStandalone::ticked(const Clock& time)77 {78 if (guiShowing_s)79 {80 guiManager_->showGUI("IngameMenu", this->getParent()->getViewport()->getCamera()->getSceneManager());81 }82 else83 {84 if (guiManager_)85 guiManager_->hideGUI();86 }87 // tick CEGUI88 guiManager_->tick(time.getDeltaTime());89 90 GSLevel::ticked(time);91 this->tickChild(time);92 66 } 93 67 }
Note: See TracChangeset
for help on using the changeset viewer.