- Timestamp:
- Mar 15, 2011, 9:09:58 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/SheetManager.lua
r8035 r8078 5 5 local activeMenuSheets = {size = 0, topSheetTuple = nil} 6 6 local menuSheetsRoot = guiMgr:getMenuRootWindow() 7 local bInGameConsoleClosed = false 7 8 local mainMenuLoaded = false 8 --orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")9 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed") 9 10 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "Sized", "windowResized") 10 11 … … 131 132 if previous and previous.pressedEnter and menuSheet:hasSelection() == false then 132 133 menuSheet:setSelectionNear(1, 1) 133 end134 135 if activeMenuSheets.size > 0 then136 guiMgr:guisActiveChanged(true)137 134 end 138 135 … … 207 204 end 208 205 209 if activeMenuSheets.size == 0 then210 guiMgr:guisActiveChanged(false)211 end212 213 206 sheetTuple.sheet:quit() 214 207 end … … 224 217 -- HUGE, very HUGE hacks! 225 218 226 -- Count the number of sheets that don't need input until the first that does. 219 -- If the InGameConsole is active, ignore the ESC command. 220 if bInGameConsoleClosed == true then 221 bInGameConsoleClosed = false 222 return 223 end 224 225 -- Count the number of sheets that don't need input till the first that does. 227 226 local counter = noInputSheetIndex() 228 227 … … 238 237 end 239 238 240 -- Function to navigate the GUI, is called by the GUIManager, whenever a relevant key is pressed. 241 -- The mode specifies the action to be taken. 242 function navigateGUI(mode) 239 function keyPressed(e) 240 local we = tolua.cast(e, "CEGUI::KeyEventArgs") 243 241 local sheet = activeMenuSheets[activeMenuSheets.size] 244 sheet.sheet:keyPressed(mode) 242 code = tostring(we.scancode) 243 -- Some preprocessing 244 if not mainMenuLoaded and not sheet.bNoInput then 245 if code == "1" then 246 keyESC() 247 elseif code == "0"then 248 orxonox.CommandExecutor:execute("InGameConsole openConsole") 249 end 250 end 251 sheet.sheet:keyPressed() 245 252 end 246 253 … … 286 293 end 287 294 return counter 295 end 296 297 function inGameConsoleClosed() 298 bInGameConsoleClosed = not bInGameConsoleClosed; 288 299 end 289 300
Note: See TracChangeset
for help on using the changeset viewer.