Changeset 7338 for code/branches/notifications/data
- Timestamp:
- Sep 3, 2010, 3:55:32 PM (14 years ago)
- Location:
- code/branches/notifications/data/gui
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/notifications/data/gui/scripts/SheetManager.lua
r6746 r7338 43 43 44 44 -- ? 45 function showMenuSheet(name, bHidePrevious, ptr)46 local sheet = showMenuSheet(name, bHidePrevious )45 function showMenuSheet(name, bHidePrevious, bNoInput, ptr) 46 local sheet = showMenuSheet(name, bHidePrevious, bNoInput) 47 47 sheet.overlay = ptr 48 48 return sheet … … 50 50 51 51 -- Shows the specified menu sheet and loads it if neccessary 52 function showMenuSheet(name, bHidePrevious )52 function showMenuSheet(name, bHidePrevious, bNoInput) 53 53 if name == "" then 54 54 return nil … … 63 63 end 64 64 65 if bNoInput == nil then 66 bNoInput = false 67 end 68 65 69 -- Pause game control if this is the first menu to be displayed 66 70 -- HUGE HACK? … … 74 78 end 75 79 80 menuSheet.tShowCursor = TriBool.Dontcare 81 76 82 -- Add the sheet in a tuple of additional information 77 83 local sheetTuple = 78 84 { 79 85 ["sheet"] = menuSheet, 80 ["bHidePrevious"] = bHidePrevious 86 ["bHidePrevious"] = bHidePrevious, 87 ["bNoInput"] = bNoInput 81 88 } 82 89 table.insert(activeMenuSheets, sheetTuple) -- indexed array access … … 89 96 90 97 -- Handle input distribution 91 inputMgr:enterState(menuSheet.inputState) 98 if bNoInput == false then 99 inputMgr:enterState(menuSheet.inputState) 100 end 92 101 93 102 -- Only change cursor situation if menuSheet.tShowCursor ~= TriBool.Dontcare … … 148 157 149 158 -- Leave the input state 150 inputMgr:leaveState(sheetTuple.sheet.inputState) 159 if not sheetTuple.bNoInput then 160 inputMgr:leaveState(sheetTuple.sheet.inputState) 161 end 151 162 152 163 -- CURSOR SHOWING … … 178 189 function keyESC() 179 190 -- HUGE, very HUGE hacks! 180 if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then 191 192 -- Count the number of sheets that don't need input till the first that does. 193 local counter = activeMenuSheets.size 194 while counter > 0 and activeMenuSheets[counter].bNoInput do 195 counter = counter - 1 196 end 197 198 -- If the first sheet that needs input is the MainMenu. 199 if counter > 0 and activeMenuSheets.size == counter and activeMenuSheets[counter].sheet.name == "MainMenu" then 181 200 orxonox.execute("exit") 182 elseif activeMenuSheets.size > 0 then 183 orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name) 201 -- If there is at least one sheet that needs input. 202 elseif counter > 0 then 203 orxonox.execute("hideGUI "..activeMenuSheets[counter].sheet.name) 184 204 else 185 205 showMenuSheet("InGameMenu")
Note: See TracChangeset
for help on using the changeset viewer.