Changeset 6048 for code/branches/menu/src/libraries
- Timestamp:
- Nov 12, 2009, 11:32:41 AM (15 years ago)
- Location:
- code/branches/menu/src/libraries/core
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menu/src/libraries/core/GUIManager.cc
r6036 r6048 108 108 , resourceProvider_(0) 109 109 , camera_(NULL) 110 , bShowIngameGUI_(false) 110 111 { 111 112 using namespace CEGUI; … … 251 252 } 252 253 } 254 255 void GUIManager::toggleIngameGUI() 256 { 257 if ( this->bShowIngameGUI_==false ) 258 { 259 GUIManager::showGUI("InGameMenu"); 260 this->bShowIngameGUI_ = true; 261 } 262 else 263 { 264 GUIManager::hideGUI("InGameMenu"); 265 this->bShowIngameGUI_ = false; 266 } 267 } 253 268 254 void GUIManager::setToggleMode(const bool& mode) 255 { 256 this->bToggleMode_ = mode; 257 this->executeCode("setToggleMode(" + multi_cast<std::string>(mode) + ")"); 269 void GUIManager::keyESC() 270 { 271 if( this->showingGUIs_.size() == 0 ) 272 this->showGUI("InGameMenu"); 273 else 274 this->executeCode("keyESC()"); 258 275 } 259 276 -
code/branches/menu/src/libraries/core/GUIManager.h
r6032 r6048 71 71 void showGUIExtra(const std::string& name, const std::string& ptr, bool hidePrevious=false, bool showCursor=true); 72 72 static void hideGUI(const std::string& name); 73 void setToggleMode(const bool& mode); 73 void toggleIngameGUI(); 74 void keyESC(); 74 75 void setBackground(const std::string& name); 75 76 … … 113 114 114 115 static GUIManager* singletonPtr_s; //!< Singleton reference to GUIManager 115 bool b ToggleMode_;116 bool bShowIngameGUI_; 116 117 117 118 }; -
code/branches/menu/src/libraries/core/Game.cc
r6047 r6048 51 51 #include "GameMode.h" 52 52 #include "GameState.h" 53 #include "GUIManager.h" 53 54 54 55 namespace orxonox … … 57 58 { Game::getInstance().stop(); } 58 59 SetConsoleCommandShortcutExternAlias(stop_game, "exit"); 60 static void key_esc() 61 { Game::getInstance().keyESC(); } 62 SetConsoleCommandShortcutExternAlias(key_esc, "keyESC"); 59 63 static void printFPS() 60 64 { COUT(0) << Game::getInstance().getAvgFPS() << std::endl; } … … 354 358 } 355 359 360 void Game::keyESC() 361 { 362 if( this->getState("mainMenu") && this->getState("mainMenu")->getActivity().active==true ) 363 this->stop(); 364 else 365 GUIManager::getInstance().keyESC(); 366 } 367 356 368 void Game::stop() 357 369 { -
code/branches/menu/src/libraries/core/Game.h
r6024 r6048 98 98 void run(); 99 99 void stop(); 100 void keyESC(); 100 101 101 102 static Game& getInstance(){ return Singleton<Game>::getInstance(); } // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.