Changeset 8035 for code/branches/usability/data/gui/scripts
- Timestamp:
- Mar 6, 2011, 4:32:05 PM (14 years ago)
- Location:
- code/branches/usability/data/gui/scripts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/GUISheet.lua
r8028 r8035 29 29 30 30 -- Override this function if you want to react on keystrokes 31 function P:onKeyPressed( )31 function P:onKeyPressed(mode) 32 32 end 33 33 … … 85 85 86 86 -- Handles key pressed while the gui sheed is displayed 87 function P:keyPressed( )87 function P:keyPressed(mode) 88 88 if self.buttons then 89 if code == "208" then -- key down89 if mode == "down" then -- key down 90 90 self:moveSelectionRow(1) 91 elseif code == "200" then -- key up91 elseif mode == "up" then -- key up 92 92 self:moveSelectionRow(-1) 93 elseif code == "205" then -- key right93 elseif mode == "right" then -- key right 94 94 self:moveSelectionColumn(1) 95 elseif code == "203" then -- key left95 elseif mode == "left" then -- key left 96 96 self:moveSelectionColumn(-1) 97 elseif code == "28" or code == "156"then -- key enter or key numpad enter97 elseif mode == "enter" then -- key enter or key numpad enter 98 98 self:pressSelectedButton() 99 99 end 100 100 end 101 101 102 self:onKeyPressed( )102 self:onKeyPressed(mode) 103 103 end 104 104 -
code/branches/usability/data/gui/scripts/GraphicsMenu.lua
r8034 r8035 1 1 -- GraphicsMenu.lua 2 2 3 local P = createMenuSheet("GraphicsMenu" )3 local P = createMenuSheet("GraphicsMenu", true, TriBool.True, TriBool.True) 4 4 5 5 P.resolutionList = {"custom", "640 x 480", "720 x 480", "720 x 576", "800 x 600", "1024 x 600", "1024 x 768", "1152 x 864", "1280 x 720", "1280 x 800", "1280 x 960", "1280 x 1024", "1360 x 768", "1440 x 900", "1600 x 900", "1600 x 1200", "1680 x 1050"} -
code/branches/usability/data/gui/scripts/MenuSheet.lua
r7689 r8035 16 16 newSheet.bHidePrevious = handleDefArg(_bHidePrevious, true) 17 17 newSheet.tShowCursor = handleDefArg(_tShowCusor, TriBool.True) 18 newSheet.tUseKeyboard = handleDefArg(_tUseKeyboard, TriBool. True)18 newSheet.tUseKeyboard = handleDefArg(_tUseKeyboard, TriBool.Dontcare) 19 19 newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false) 20 20 -
code/branches/usability/data/gui/scripts/SheetManager.lua
r8033 r8035 5 5 local activeMenuSheets = {size = 0, topSheetTuple = nil} 6 6 local menuSheetsRoot = guiMgr:getMenuRootWindow() 7 local bInGameConsoleClosed = false8 7 local mainMenuLoaded = false 9 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")8 --orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed") 10 9 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "Sized", "windowResized") 11 10 … … 132 131 if previous and previous.pressedEnter and menuSheet:hasSelection() == false then 133 132 menuSheet:setSelectionNear(1, 1) 133 end 134 135 if activeMenuSheets.size > 0 then 136 guiMgr:guisActiveChanged(true) 134 137 end 135 138 … … 204 207 end 205 208 209 if activeMenuSheets.size == 0 then 210 guiMgr:guisActiveChanged(false) 211 end 212 206 213 sheetTuple.sheet:quit() 207 214 end … … 217 224 -- HUGE, very HUGE hacks! 218 225 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. 226 -- Count the number of sheets that don't need input until the first that does. 226 227 local counter = noInputSheetIndex() 227 228 … … 237 238 end 238 239 239 function keyPressed(e) 240 local we = tolua.cast(e, "CEGUI::KeyEventArgs") 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) 241 243 local sheet = activeMenuSheets[activeMenuSheets.size] 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() 244 sheet.sheet:keyPressed(mode) 252 245 end 253 246 … … 293 286 end 294 287 return counter 295 end296 297 function inGameConsoleClosed()298 bInGameConsoleClosed = not bInGameConsoleClosed;299 288 end 300 289
Note: See TracChangeset
for help on using the changeset viewer.