Changeset 8023
- Timestamp:
- Mar 5, 2011, 11:07:39 PM (14 years ago)
- Location:
- code/branches/usability
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/GraphicsMenu.lua
r8022 r8023 337 337 -- prompt for confirmation 338 338 openDecisionPopup("Do you want to keep these settings? (Settings will be reverted in 10 seconds if not accepted)", GraphicsMenu.callback_ApplyDecisionPopup) 339 if checkedFullscreen then 340 showCursor() 341 end 339 342 end 340 343 -
code/branches/usability/data/gui/scripts/SheetManager.lua
r8018 r8023 10 10 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "Sized", "windowResized") 11 11 12 -----------------------13 --- Local functions ---14 -----------------------15 16 local function hideCursor()17 if cursor:isVisible() then18 cursor:hide()19 end20 end21 22 local function showCursor()23 if not cursor:isVisible() and inputMgr:isMouseExclusive() then24 cursor:show()25 end26 end27 28 29 12 ------------------------ 30 13 --- Global functions --- 31 14 ------------------------ 15 16 function hideCursor() 17 if cursor:isVisible() then 18 cursor:hide() 19 end 20 end 21 22 function showCursor() 23 if not cursor:isVisible() and inputMgr:isMouseExclusive() then 24 cursor:show() 25 end 26 end 32 27 33 28 -- Loads the GUI with the specified name … … 257 252 258 253 function windowResized(e) 259 local sheet = activeMenuSheets[activeMenuSheets.size] 260 if sheet then 261 sheet.sheet:windowResized() 254 for name, sheet in pairs(loadedSheets) do 255 if orxonox.GraphicsManager:getInstance():isFullScreen() or sheet.tShowCursor == TriBool.False then 256 inputMgr:setMouseExclusive(sheet.inputState, TriBool.True) 257 else 258 inputMgr:setMouseExclusive(sheet.inputState, TriBool.False) 259 end 260 end 261 local sheetTuple = activeMenuSheets[activeMenuSheets.size] 262 if sheetTuple then 263 if orxonox.GraphicsManager:getInstance():isFullScreen() and sheetTuple.sheet.tShowCursor ~= TriBool.False then 264 showCursor() 265 else 266 hideCursor() 267 end 268 sheetTuple.sheet:windowResized() 262 269 end 263 270 end -
code/branches/usability/src/libraries/core/input/InputManager.cc
r7874 r8023 641 641 state->destroy(); 642 642 } 643 644 bool InputManager::setMouseExclusive(const std::string& name, TriBool::Value value) 645 { 646 if (name == "empty") 647 { 648 COUT(2) << "InputManager: Changing the empty state is not allowed!" << std::endl; 649 return false; 650 } 651 std::map<std::string, InputState*>::iterator it = statesByName_.find(name); 652 if (it != statesByName_.end()) 653 { 654 it->second->setMouseExclusive(value); 655 return true; 656 } 657 return false; 658 } 643 659 } -
code/branches/usability/src/libraries/core/input/InputManager.h
r7874 r8023 163 163 */ 164 164 bool destroyState(const std::string& name); // tolua_export 165 /** 166 @brief 167 Changes the mouse mode of an input state. 168 @return 169 True if the call was successful, fals if the name was not found 170 */ 171 bool setMouseExclusive(const std::string& name, TriBool::Value value); // tolua_export 165 172 166 173 //-------------------------------
Note: See TracChangeset
for help on using the changeset viewer.