Changeset 7403 for code/trunk/data/gui/scripts
- Timestamp:
- Sep 11, 2010, 10:20:44 AM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 5 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/notifications (added) merged: 7319,7324,7326,7338-7343,7348-7349,7351,7354-7355,7358-7360,7362,7395,7398-7400
- Property svn:mergeinfo changed
-
code/trunk/data/gui/scripts/GUISheet.lua
r6748 r7403 40 40 end 41 41 42 -- Override this function if you need to do work just after the sheet has been hidden 43 function P:afterHide() 44 end 45 42 46 function P:load() 43 47 -- Load the layout that describes the sheet -
code/trunk/data/gui/scripts/KeyBindMenu.lua
r7163 r7403 113 113 return "Joystick " .. name 114 114 elseif( string.find(group, "JoyStickAxes") ~= nil ) then 115 return "Joystick Axis " .. string.sub(name, 5, 6) .. string.sub(name, string.find(name, 'Axis%d%d(.*)')+6)115 return "Joystick Axis " .. string.sub(name, 5, 6) .. string.sub(name, string.find(name, 'Axis%d%d(.*)')+6) 116 116 elseif( group == "MouseAxes" ) then 117 117 return "Mouse " .. string.sub(name, string.find(name, '.(.*)')+1) .. " " .. string.sub(name, 1, 1) .. "-Axis" -
code/trunk/data/gui/scripts/MiscConfigMenu.lua
r7284 r7403 51 51 table.insert(P.nameList, "Number of Bots") 52 52 table.insert(P.nameList, "UnderAttack: game time") 53 table.insert(P.nameList, "TeamDeathmatch: Num er of teams")53 table.insert(P.nameList, "TeamDeathmatch: Number of teams") 54 54 table.insert(P.nameList, "Playername") 55 55 table.insert(P.nameList, "Chat: display time") -
code/trunk/data/gui/scripts/SheetManager.lua
r6746 r7403 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 -- Set bNoInput to false if it hasn't been set. 66 if bNoInput == nil then 67 bNoInput = false 68 end 69 70 -- Count the number of sheets that don't need input till the first that does. 71 local counter = noInputSheetCounter() 65 72 -- Pause game control if this is the first menu to be displayed 66 73 -- HUGE HACK? 67 if activeMenuSheets.size== 0 then74 if bNoInput == false and counter == 0 then 68 75 orxonox.HumanController:pauseControl() 69 76 end … … 72 79 if activeMenuSheets[name] ~= nil then 73 80 hideMenuSheet(name) 81 end 82 83 if bNoInput == true then 84 menuSheet.tShowCursor = TriBool.Dontcare 74 85 end 75 86 … … 78 89 { 79 90 ["sheet"] = menuSheet, 80 ["bHidePrevious"] = bHidePrevious 91 ["bHidePrevious"] = bHidePrevious, 92 ["bNoInput"] = bNoInput 81 93 } 82 94 table.insert(activeMenuSheets, sheetTuple) -- indexed array access … … 89 101 90 102 -- Handle input distribution 91 inputMgr:enterState(menuSheet.inputState) 103 if bNoInput == false then 104 inputMgr:enterState(menuSheet.inputState) 105 end 92 106 93 107 -- Only change cursor situation if menuSheet.tShowCursor ~= TriBool.Dontcare … … 148 162 149 163 -- Leave the input state 150 inputMgr:leaveState(sheetTuple.sheet.inputState) 164 if not sheetTuple.bNoInput then 165 inputMgr:leaveState(sheetTuple.sheet.inputState) 166 end 151 167 152 168 -- CURSOR SHOWING … … 162 178 end 163 179 164 -- Resume control if the last menu is hidden 165 if activeMenuSheets.size == 0 then 180 -- Count the number of sheets that don't need input till the first that does. 181 local counter = noInputSheetCounter() 182 -- Resume control if the last (non-noInput) menu is hidden 183 if counter == 0 then 166 184 orxonox.HumanController:resumeControl() 167 185 hideCursor() 168 186 end 187 188 sheetTuple.sheet:afterHide() 169 189 end 170 190 … … 178 198 function keyESC() 179 199 -- HUGE, very HUGE hacks! 180 if activeMenuSheets.size == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then 200 201 -- Count the number of sheets that don't need input till the first that does. 202 local counter = noInputSheetCounter() 203 204 -- If the first sheet that needs input is the MainMenu. 205 if counter == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then 181 206 orxonox.execute("exit") 182 elseif activeMenuSheets.size > 0 then 183 orxonox.execute("hideGUI "..activeMenuSheets.topSheetTuple.sheet.name) 207 -- If there is at least one sheet that needs input. 208 elseif counter > 0 then 209 orxonox.execute("hideGUI "..activeMenuSheets[counter].sheet.name) 184 210 else 185 211 showMenuSheet("InGameMenu") … … 189 215 function setBackgroundImage(imageSet, imageName) 190 216 guiMgr:setBackgroundImage(imageSet, imageName) 217 end 218 219 function noInputSheetCounter() 220 -- Count the number of sheets that don't need input till the first that does. 221 local counter = activeMenuSheets.size 222 while counter > 0 and activeMenuSheets[counter].bNoInput do 223 counter = counter - 1 224 end 225 return counter 191 226 end 192 227
Note: See TracChangeset
for help on using the changeset viewer.