Changeset 8078 for code/branches/usability/src
- Timestamp:
- Mar 15, 2011, 9:09:58 PM (14 years ago)
- Location:
- code/branches/usability/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/src/libraries/core/GUIManager.cc
r8035 r8078 103 103 /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; 104 104 105 static const std::string __CC_navigateGUI_name = "navigateGUI";106 107 105 SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false); 108 106 SetConsoleCommand("hideGUI", &GUIManager::hideGUI); 109 107 SetConsoleCommand("toggleGUI", &GUIManager::toggleGUI).defaultValue(1, false).defaultValue(2, false); 110 SetConsoleCommand(__CC_navigateGUI_name, &GUIManager::navigateGUI).deactivate();111 112 //! Strings that specify modes for the GUI navigation.113 /*static*/ const std::string GUIManager::NAVIGATE_UP = "up";114 /*static*/ const std::string GUIManager::NAVIGATE_DOWN = "down";115 /*static*/ const std::string GUIManager::NAVIGATE_LEFT = "left";116 /*static*/ const std::string GUIManager::NAVIGATE_RIGHT = "right";117 /*static*/ const std::string GUIManager::NAVIGATE_ENTER = "enter";118 108 119 109 /** … … 374 364 this->rootWindow_->setProperty("Alpha", "1.0"); 375 365 this->rootWindow_->setProperty("Image", image); 376 }377 378 /**379 @brief380 Method to navigate the GUI, by specifying the mode of navigation.381 @param mode382 The mode of navigation, at this point can be either 'up', 'down', 'left', 'right' or 'enter'.383 */384 /*static*/ void GUIManager::navigateGUI(const std::string& mode)385 {386 if(mode == NAVIGATE_UP)387 GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_UP + "\")");388 else if(mode == NAVIGATE_DOWN)389 GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_DOWN + "\")");390 else if(mode == NAVIGATE_LEFT)391 GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_LEFT + "\")");392 else if(mode == NAVIGATE_RIGHT)393 GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_RIGHT + "\")");394 else if(mode == NAVIGATE_ENTER)395 GUIManager::getInstance().executeCode("navigateGUI(\"" + NAVIGATE_ENTER + "\")");396 }397 398 /**399 @brief400 Is called by lua to change whether there are any GUIs active at the moment.401 @param active402 Whether GUIs are active.403 */404 void GUIManager::guisActiveChanged(bool active)405 {406 if(this->GUIsActive_ == active)407 return;408 this->GUIsActive_ = active;409 if(this->GUIsActive_)410 ModifyConsoleCommand(__CC_navigateGUI_name).activate();411 else412 ModifyConsoleCommand(__CC_navigateGUI_name).deactivate();413 366 } 414 367 -
code/branches/usability/src/libraries/core/GUIManager.h
r8040 r8078 95 95 void setBackgroundImage(const std::string& image); 96 96 97 static void navigateGUI(const std::string& mode);98 void guisActiveChanged(bool active); // tolua_export99 100 97 /** 101 98 @brief Helper method to get the developer's mode without having to export Core.h. … … 134 131 template <typename FunctionType> 135 132 bool protectedCall(FunctionType function); 136 137 static const std::string NAVIGATE_UP;138 static const std::string NAVIGATE_DOWN;139 static const std::string NAVIGATE_LEFT;140 static const std::string NAVIGATE_RIGHT;141 static const std::string NAVIGATE_ENTER;142 143 bool GUIsActive_; //!< Whether there are any GUIs active at a given moment.144 133 145 134 // keyHandler functions -
code/branches/usability/src/orxonox/gamestates/GSMainMenu.cc
r8035 r8078 68 68 RegisterRootObject(GSMainMenu); 69 69 70 InputManager::getInstance().createInputState("MainMenuHackery" )->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());70 InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler()); 71 71 72 72 // create an empty Scene -
code/branches/usability/src/orxonox/overlays/InGameConsole.cc
r8035 r8078 49 49 #include "core/ConfigValueIncludes.h" 50 50 #include "core/command/ConsoleCommand.h" 51 #include "core/GUIManager.h" 51 52 #include "core/input/InputManager.h" 52 53 #include "core/input/InputState.h" … … 533 534 { 534 535 this->bActive_ = false; 536 GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed. 535 537 InputManager::getInstance().leaveState("console"); 536 538 this->shell_->unregisterListener(this); … … 609 611 /*static*/ void InGameConsole::closeConsole() 610 612 { 613 GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed, but not by ESC. 611 614 InGameConsole::getInstance().deactivate(); 612 615 }
Note: See TracChangeset
for help on using the changeset viewer.