Changeset 2808 for code/branches
- Timestamp:
- Mar 21, 2009, 1:07:53 AM (16 years ago)
- Location:
- code/branches/gui/src/orxonox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSGUI.cc
r2801 r2808 53 53 54 54 // show main menu 55 guiManager_->loadScene("MainMenu");55 //guiManager_->loadScene("MainMenu"); 56 56 guiManager_->showGUI("MainMenu", 0); 57 57 GraphicsManager::getInstance().getViewport()->setCamera(guiManager_->getCamera()); -
code/branches/gui/src/orxonox/gamestates/GSStandalone.cc
r2801 r2808 39 39 namespace orxonox 40 40 { 41 SetConsoleCommand(GSStandalone, showGUI, true).setAsInputCommand();42 43 bool GSStandalone::guiShowing_s = false;44 45 41 GSStandalone::GSStandalone() 46 42 : GameState<GSGraphics>("standalone") … … 52 48 } 53 49 54 void GSStandalone::showGUI()55 {56 GSStandalone::guiShowing_s = true;57 }58 50 59 51 void GSStandalone::enter() … … 66 58 // not sure if necessary 67 59 // guiManager_->loadScene("IngameMenu"); 60 61 Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport(); 62 guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager()); 68 63 } 69 64 … … 77 72 void GSStandalone::ticked(const Clock& time) 78 73 { 79 if (guiShowing_s) 80 { 81 Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport(); 82 guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager()); 83 } 84 else 85 { 86 if (guiManager_) 87 guiManager_->hideGUI(); 88 } 74 Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport(); 75 //COUT(0) << "** " << viewport->getCamera()->getSceneManager() << std::endl; 76 //guiManager_->testFct(); 77 //Ogre::Viewport* viewport = GraphicsManager::getInstance().getViewport(); 78 guiManager_->showGUI("IngameMenu", viewport->getCamera()->getSceneManager()); 79 89 80 // tick CEGUI 90 81 guiManager_->update(time); -
code/branches/gui/src/orxonox/gamestates/GSStandalone.h
r2790 r2808 41 41 GSStandalone(); 42 42 ~GSStandalone(); 43 static void showGUI();44 43 45 44 private: … … 49 48 50 49 GUIManager* guiManager_; 51 static bool guiShowing_s;52 50 }; 53 51 } -
code/branches/gui/src/orxonox/gui/GUIManager.cc
r2801 r2808 63 63 namespace orxonox 64 64 { 65 SetConsoleCommandShortcut(GUIManager, showGUI_s).keybindMode(KeybindMode::OnPress);65 SetConsoleCommandShortcut(GUIManager, toggleGUI).keybindMode(KeybindMode::OnPress); 66 66 67 67 GUIManager* GUIManager::singletonRef_s = 0; … … 143 143 144 144 // Note: No SceneManager specified yet 145 this->guiRenderer_ = new OgreCEGUIRenderer(renderWindow_, Ogre::RENDER_QUEUE_ MAIN, true, 3000);145 this->guiRenderer_ = new OgreCEGUIRenderer(renderWindow_, Ogre::RENDER_QUEUE_OVERLAY, true, 3000); 146 146 this->resourceProvider_ = guiRenderer_->createResourceProvider(); 147 147 this->resourceProvider_->setDefaultResourceGroup("GUI"); … … 172 172 173 173 // load the background scene 174 //loadScenes();174 loadScenes(); 175 175 //CEGUI::KeyEventArgs e; 176 176 //e.codepoint … … 204 204 tolua_Orxonox_open(this->scriptModule_->getLuaState()); 205 205 */ 206 this->scriptModule_->executeScriptFile(" ingameGUI.lua", "GUI");206 this->scriptModule_->executeScriptFile("loadGUI.lua", "GUI"); 207 207 } 208 208 catch (CEGUI::Exception& ex) … … 261 261 } 262 262 263 void GUIManager::toggleGUI() 264 { 265 //COUT(0) << "********* TOGGLE TOGGLE **********" << std::endl; 266 getInstance().scriptModule_->executeScriptGlobal("toggleGUI"); 267 } 268 263 269 void GUIManager::showGUI(const std::string& name, Ogre::SceneManager* sceneManager)// bool showBackground) 264 270 { … … 271 277 try 272 278 { 273 //COUT (0) << "************* sceneManager: " << sceneManager << std::endl;279 // COUT (0) << "************* sceneManager: " << sceneManager << std::endl; 274 280 if (!sceneManager) 275 281 { … … 286 292 //this->viewport_->setClearEveryFrame(false); 287 293 this->guiRenderer_->setTargetSceneManager(sceneManager); 294 currentSceneManager_ = sceneManager; 288 295 //this->viewport_->setCamera(this->emptyCamera_); 289 296 … … 311 318 COUT(2) << "Warning: GUI Manager not yet initialised, cannot load a GUI" << std::endl; 312 319 } 320 } 321 322 void GUIManager::testFct() 323 { 324 //COUT(0) << "**** " << currentSceneManager_ << std::endl; 325 this->showGUI("IngameMenu", currentSceneManager_); 326 } 327 328 void GUIManager::testOutput(const std::string& str) 329 { 330 COUT(0) << "***" << str << "***" << std::endl; 313 331 } 314 332 -
code/branches/gui/src/orxonox/gui/GUIManager.h
r2800 r2808 79 79 void showGUI(const std::string& name, Ogre::SceneManager* sceneManager);// bool showBackground); // tolua_export 80 80 void hideGUI(); // tolua_export 81 void testOutput(const std::string& str); // tolua_export 82 83 static void toggleGUI(); 81 84 82 85 Ogre::Camera* getCamera() { return this->backgroundCamera_; } … … 86 89 getInstance().showGUI(name, sceneManager); 87 90 } 91 92 // please remove 93 void testFct(); 88 94 89 95 static GUIManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } // tolua_export … … 128 134 CEGUI::Imageset* backgroundImage_; 129 135 lua_State* luaState_; 136 Ogre::SceneManager* currentSceneManager_; 130 137 131 138 State state_;
Note: See TracChangeset
for help on using the changeset viewer.