Changeset 6662 for code/branches/gamestates2/data/gui
- Timestamp:
- Mar 31, 2010, 1:05:28 AM (15 years ago)
- Location:
- code/branches/gamestates2
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2
- Property svn:mergeinfo changed
/code/branches/gamestate merged: 6621-6630,6655-6661
- Property svn:mergeinfo changed
-
code/branches/gamestates2/data/gui/scripts/AudioMenu.lua
r6595 r6662 1 1 -- AudioMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("AudioMenu") 5 if _REQUIREDNAME == nil then 6 AudioMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("AudioMenu") 10 4 11 function P :init()5 function P.init() 12 6 soundMgr = orxonox.SoundManager:getInstance() 13 7 block = false -
code/branches/gamestates2/data/gui/scripts/BasicGUI.lua
r6595 r6662 1 -- gui.lua1 -- BasicGUI.lua 2 2 3 3 local P = {} 4 if _REQUIREDNAME == nil then 5 BasicGUI = P 6 else 7 _G[_REQUIREDNAME] = P 8 end 4 _G[_REQUIREDNAME or "BasicGUI"] = P 9 5 10 6 -- useless, even wrong? P is the class, not the object.. … … 27 23 end 28 24 29 -- Override this function if you need to 25 -- Override this function if you want to change one of the three input parameters: 26 -- showCursor = true, useKeyboard = true and blockJoyStick = false 30 27 -- But don't forget to stick to the naming convention ("GUI_" .. self.filename) 31 28 function P:createInputState() -
code/branches/gamestates2/data/gui/scripts/ControlsMenu.lua
r6595 r6662 1 1 -- ControlsMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("ControlsMenu") 5 if _REQUIREDNAME == nil then 6 ControlsMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("ControlsMenu") 10 4 11 5 function P.ControlsMouseControlsButton_clicked(e) -
code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua
r6595 r6662 1 1 -- CreditsMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("CreditsMenu") 5 if _REQUIREDNAME == nil then 6 CreditsMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local sheetName = _REQUIREDNAME or "CreditsMenu" 4 -- Create object of type BasicGUI and make it global 5 local P = require("BasicGUI"):new(sheetName) 6 _G[sheetName] = P 10 7 11 8 function P.CreditsBackButton_clicked(e) -
code/branches/gamestates2/data/gui/scripts/DecisionPopup.lua
r6595 r6662 1 1 -- DecisionPopup.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("DecisionPopup") 5 if _REQUIREDNAME == nil then 6 DecisionPopup = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("DecisionPopup") 10 4 11 5 function P.setCallback(functionPtr) -
code/branches/gamestates2/data/gui/scripts/GUITools.lua
r6417 r6662 1 function createSheet(sheetName) 2 -- Create object of type BasicGUI and make it global 3 local sheet = require("BasicGUI"):new(sheetName) 4 _G[sheetName] = sheet 5 return sheet 6 end 7 1 8 function openDecisionPopup( text, callbackPtr ) 2 9 showGUI("DecisionPopup", false, true) -
code/branches/gamestates2/data/gui/scripts/GameplayMenu.lua
r6595 r6662 1 1 -- GameplayMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("GameplayMenu") 5 if _REQUIREDNAME == nil then 6 GameplayMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("GameplayMenu") 10 4 11 function P :init()5 function P.init() 12 6 dropdown = winMgr:getWindow("orxonox/ThemeCombobox") 13 7 local themeList = {} … … 24 18 function P.GameplayThemeCombobox_changed(e) 25 19 -- theme 26 debug("event: theme")20 logMessage(0, "event: theme") 27 21 end 28 22 29 23 function P.GameplayDifficultyEasyButton_clicked(e) 30 24 -- difficulty easy 31 debug("event: easy")25 logMessage(0, "event: easy") 32 26 end 33 27 34 28 function P.GameplayDifficultyNormalButton_clicked(e) 35 29 -- difficulty normal 36 debug("event: normal")30 logMessage(0, "event: normal") 37 31 end 38 32 39 33 function P.GameplayDifficultyHardButton_clicked(e) 40 34 -- difficulty hard 41 debug("event: hard")35 logMessage(0, "event: hard") 42 36 end 43 37 -
code/branches/gamestates2/data/gui/scripts/GraphicsMenu.lua
r6595 r6662 1 1 -- GraphicsMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("GraphicsMenu") 5 if _REQUIREDNAME == nil then 6 GraphicsMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("GraphicsMenu") 10 4 11 function P :init()5 function P.init() 12 6 block = true 13 7 file = orxonox.PathConfig:getConfigPathString() .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_") … … 149 143 if scrollbar_active == false then 150 144 -- brightness 151 debug("event: brightness")145 logMessage(0, "event: brightness") 152 146 end 153 147 end … … 159 153 function P.GraphicsBrightnessScrollbar_ended(e) 160 154 -- brightness 161 debug("event: brightness")155 logMessage(0, "event: brightness") 162 156 scrollbar_active = false 163 157 end -
code/branches/gamestates2/data/gui/scripts/InGameMenu.lua
r6595 r6662 1 1 -- InGameMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("InGameMenu") 5 if _REQUIREDNAME == nil then 6 InGameMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("InGameMenu") 10 4 11 5 -- events for ingamemenu -
code/branches/gamestates2/data/gui/scripts/InfoPopup.lua
r6595 r6662 1 1 -- InfoPopup.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("InfoPopup") 5 6 if _REQUIREDNAME == nil then 7 InfoPopup = P 8 else 9 _G[_REQUIREDNAME] = P 10 end 3 local P = createSheet("InfoPopup") 11 4 12 5 function P.execute(functionPtr, arguments) -
code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua
r6595 r6662 29 29 system:setDefaultTooltip("MenuWidgets/Tooltip") 30 30 31 loadedGUIs = {} 32 cursorVisibility = {} 33 activeSheets = {} 34 nrOfActiveSheets = 0 35 root = nil 36 bShowsCursor = false 37 bHidePrevious = {} 31 local loadedSheets = {} 32 local activeMenuSheets = {size = 0, topSheet = nil} 33 --activeHUDSheets = {size = 0, topSheet = nil} 34 local root = nil 38 35 39 36 -- Require all tools 40 37 require("GUITools") 41 38 42 -- loads the GUI with the specified filename 43 -- be sure to set the global variable "filename" before calling this function 44 function loadGUI(filename) 45 -- check if it already exists 46 loadedGui = loadedGUIs[filename] 47 if loadedGui == nil then 48 loadedGuiNS = require(filename) 49 if loadedGuiNS == nil then 39 40 ----------------------- 41 --- Local functions --- 42 ----------------------- 43 44 -- Loads the GUI with the specified name 45 -- The name corresponds to the filename of the *.lua and *.layout files 46 -- but without the extension 47 local function loadSheet(name) 48 -- Check if it has already been loaded 49 local sheet = loadedSheets[name] 50 if sheet == nil then 51 -- Load the sheet 52 sheet = require(name) 53 if sheet == nil then 50 54 return 51 55 end 52 loadedGui = loadedGuiNS:load() 53 loadedGUIs[filename] = loadedGui 54 -- if there has no GUI been loaded yet, set new GUI as current 55 if table.getn(loadedGUIs) == 1 then 56 current = loadedGUIs[1] 57 end 58 -- hide new GUI as we do not want to show it accidentially 59 loadedGui:hide() 60 end 61 return loadedGui 62 end 63 64 function showGUI(filename, hidePrevious, bCursorVisible, ptr) 65 gui = showGUI(filename, hidePrevious, bCursorVisible) 56 sheet:load() 57 loadedSheets[name] = sheet 58 -- Hide new GUI as we do not want to show it accidentally 59 sheet:hide() 60 end 61 return sheet 62 end 63 64 local function hideCursor() 65 if cursor:isVisible() then 66 cursor:hide() 67 end 68 end 69 70 local function showCursor() 71 if not cursor:isVisible() and orxonox.InputManager:getInstance():isMouseExclusive() then 72 cursor:show() 73 end 74 end 75 76 local function find(table, value) 77 for i, v in ipairs(table) do 78 if v == value then 79 return i 80 end 81 end 82 return nil 83 end 84 85 86 ------------------------ 87 --- Global functions --- 88 ------------------------ 89 90 -- ? 91 function showGUI(name, bHidePrevious, bShowCursor, ptr) 92 gui = showGUI(name, bHidePrevious, bShowCursor) 66 93 gui.overlay = ptr 67 94 end 68 95 69 -- shows the specified GUI sheet and loads it if not loaded already 70 function showGUI(filename, hidePrevious, bCursorVisible) 71 if bCursorVisible == nil then 72 if nrOfActiveSheets > 0 then 73 bCursorVisible = cursorVisibility[activeSheets[nrOfActiveSheets]] 96 -- Shows the specified menu sheet and loads it if neccessary 97 function showGUI(name, bHidePrevious, bShowCursor) 98 -- Handle default value for bShowCursor 99 if bShowCursor == nil then 100 if activeMenuSheets.size > 0 then 101 bShowCursor = activeMenuSheets.topSheet.bShowCursor 74 102 else 75 bCursorVisible = true 76 end 77 end 78 79 if root == nil then 103 bShowCursor = true 104 end 105 end 106 107 -- Hide if already displayed (to make sure it is up front in the end) 108 if activeMenuSheets[name] ~= nil then 109 hideGUI(name) 110 end 111 112 if not root then 80 113 setBackground("") 81 114 end 82 115 83 local currentGUI = loadedGUIs[filename] 84 if(currentGUI == nil) then 85 currentGUI = loadGUI(filename) 86 end 87 88 if(root:isChild(currentGUI.window)) then 89 root:removeChildWindow(currentGUI.window) 90 end 91 root:addChildWindow(currentGUI.window) 92 93 if bCursorVisible then 116 -- Get sheet (or load it) 117 local menuSheet = loadSheet(name) 118 if not menuSheet then 119 return 120 end 121 122 -- Add sheet to the root window 123 root:addChildWindow(menuSheet.window) 124 125 -- Pause game control if this is the first menu to be displayed 126 -- HUGE HACK? 127 if activeMenuSheets.size == 0 then 128 orxonox.HumanController:pauseControl() 129 end 130 131 -- Handle input distribution 132 orxonox.InputManager:getInstance():enterState(menuSheet.inputState) 133 134 if bShowCursor then 94 135 showCursor() 95 136 else … … 97 138 end 98 139 99 if find( activeSheets, filename ) ~= nil then 100 table.remove( activeSheets, find( activeSheets, filename ) ) 101 nrOfActiveSheets = nrOfActiveSheets - 1 102 else 103 if nrOfActiveSheets == 0 then 104 --orxonox.InputManager:getInstance():enterState("guiMouseOnly") 105 orxonox.HumanController:pauseControl() 106 end 107 end 108 orxonox.InputManager:getInstance():enterState(currentGUI.inputState) 109 110 nrOfActiveSheets = nrOfActiveSheets + 1 111 table.insert(activeSheets, filename) 112 activeSheets[nrOfActiveSheets] = filename 113 bHidePrevious[filename]=hidePrevious 114 cursorVisibility[filename] = bCursorVisible 115 116 if hidePrevious == true then 117 for i=1,nrOfActiveSheets-1 do 118 loadedGUIs[ activeSheets[i] ]:hide() 119 end 120 end 121 currentGUI:show() 122 return currentGUI 123 end 124 125 function hideCursor() 126 if bShowsCursor==true then 127 bShowsCursor=false 128 cursor:hide() 129 end 130 end 131 132 function showCursor() 133 if bShowsCursor==false then 134 bShowsCursor=true 135 cursor:show() 136 end 137 end 138 139 function hideGUI(filename) 140 local currentGUI = loadedGUIs[filename] 141 if currentGUI == nil then 140 -- Add the sheet in a tuple of additional information 141 local sheetTuple = 142 { 143 ["menuSheet"] = menuSheet, 144 ["name"] = name, 145 ["bShowCursor"] = bShowCursor, 146 ["bHidePrevious"] = bHidePrevious 147 } 148 table.insert(activeMenuSheets, sheetTuple) -- indexed array access 149 activeMenuSheets[name] = sheetTuple -- name access 150 activeMenuSheets.size = activeMenuSheets.size + 1 151 activeMenuSheets.topSheet = sheetTuple 152 153 -- Hide all previous sheets if necessary 154 if bHidePrevious then 155 for i = 1, activeMenuSheets.size - 1 do 156 activeMenuSheets[i].menuSheet:hide() 157 end 158 end 159 160 menuSheet:show() 161 return menuSheet 162 end 163 164 function hideGUI(name) 165 local sheetTuple = activeMenuSheets[name] 166 if sheetTuple == nil then 142 167 return 143 168 end 144 currentGUI:hide() 145 if bHidePrevious[filename] == true then 146 local i = nrOfActiveSheets-1 147 while i>0 do 148 loadedGUIs[ activeSheets[i] ]:show() 149 if bHidePrevious[filename]==true then 150 break 151 else 152 i=i-1 169 170 -- Hide the sheet 171 sheetTuple.menuSheet:hide() 172 173 -- Show sheets that were hidden by the sheet to be removed 174 local i = activeMenuSheets.size 175 -- Only do something if all sheets on top of sheetTuple 176 -- have bHidePrevious == false and sheetTuple.bHidePrevious == true 177 while i > 0 do 178 if activeMenuSheets[i].bHidePrevious == true then 179 if activeMenuSheets[i] == sheetTuple then 180 i = i - 1 181 while i > 0 do 182 activeMenuSheets[i].menuSheet:show() 183 if activeMenuSheets[i].bHidePrevious == true then 184 break 185 end 186 i = i - 1 187 end 153 188 end 154 end 155 end 156 root:removeChildWindow(currentGUI.window) 157 local i=1 158 while activeSheets[i] do 159 if activeSheets[i+1] == nil then 160 if activeSheets[i-1] ~= nil then 161 if cursorVisibility[ activeSheets[i-1] ] == true then 162 showCursor() 163 else 164 hideCursor() 165 end 166 else 167 hideCursor() 168 end 169 end 170 if activeSheets[i] == filename then 171 table.remove( activeSheets, i ) 172 nrOfActiveSheets = nrOfActiveSheets-1 173 else 174 i = i+1 175 end 176 end 177 cursorVisibility[filename] = nil -- remove the cursor visibility of the current gui from the table 178 bHidePrevious[filename] = nil 179 if nrOfActiveSheets == 0 then 180 --orxonox.InputManager:getInstance():leaveState("guiMouseOnly") 189 break 190 end 191 i = i - 1 192 end 193 194 -- Remove sheet with its tuple from the table 195 root:removeChildWindow(sheetTuple.menuSheet.window) 196 table.remove(activeMenuSheets, find(activeMenuSheets, sheetTuple)) 197 activeMenuSheets[name] = nil 198 activeMenuSheets.size = activeMenuSheets.size - 1 199 activeMenuSheets.topSheet = activeMenuSheets[activeMenuSheets.size] 200 201 -- Leave the input state 202 orxonox.InputManager:getInstance():leaveState(sheetTuple.menuSheet.inputState) 203 204 -- See whether to show or hide cursor 205 if activeMenuSheets.size > 0 and activeMenuSheets.topSheet.bShowCursor then 206 showCursor() 207 else 208 hideCursor() 209 end 210 211 -- Resume control if the last menu is hidden 212 if activeMenuSheets.size == 0 then 181 213 orxonox.HumanController:resumeControl() 182 214 hideCursor() 183 215 end 184 orxonox.InputManager:getInstance():leaveState(currentGUI.inputState) 185 end 186 216 end 217 218 -- Hides all menu GUI sheets 187 219 function hideAllGUIs() 188 while nrOfActiveSheets~= 0 do189 hideGUI(active Sheets[nrOfActiveSheets])220 while activeMenuSheets.size ~= 0 do 221 hideGUI(activeMenuSheets.topSheet.name) 190 222 end 191 223 end 192 224 193 225 function keyESC() 194 if nrOfActiveSheets == 1 and activeSheets[1] == "MainMenu" then 226 -- HUGE, very HUGE hacks! 227 if activeMenuSheets.size == 1 and activeMenuSheets[1].name == "MainMenu" then 195 228 orxonox.execute("exit") 196 elseif nrOfActiveSheets> 0 then197 orxonox.execute("hideGUI "..active Sheets[nrOfActiveSheets])229 elseif activeMenuSheets.size > 0 then 230 orxonox.execute("hideGUI "..activeMenuSheets.topSheet.name) 198 231 else 199 232 showGUI("InGameMenu") … … 201 234 end 202 235 203 function setBackground( filename)236 function setBackground(name) 204 237 local newroot 205 238 if root ~= nil then 206 239 root:rename("oldRootWindow") 207 240 end 208 if filename ~= "" then209 newroot = winMgr:loadWindowLayout( filename .. ".layout")241 if name ~= "" then 242 newroot = winMgr:loadWindowLayout(name .. ".layout") 210 243 newroot:rename("AbsoluteRootWindow") 211 244 system:setGUISheet(newroot) … … 228 261 root = newroot 229 262 end 230 231 function find(table, value)232 local i=0233 while table[i] ~= nil do234 if table[i]==value then235 return i236 else237 i=i+1238 end239 end240 return nil241 end242 243 function test(e)244 debug(0, "Blubb")245 end -
code/branches/gamestates2/data/gui/scripts/KeyBindMenu.lua
r6595 r6662 1 1 -- KeyBindMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("KeyBindMenu") 5 6 if _REQUIREDNAME == nil then 7 KeyBindMenu = P 8 else 9 _G[_REQUIREDNAME] = P 10 end 11 12 function P:init() 3 local P = createSheet("KeyBindMenu") 4 5 function P.init() 13 6 14 7 commandList = {} -
code/branches/gamestates2/data/gui/scripts/MainMenu.lua
r6595 r6662 1 1 -- MainMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("MainMenu") 5 if _REQUIREDNAME == nil then 6 MainMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("MainMenu") 10 4 11 5 -- events for MainMenu -
code/branches/gamestates2/data/gui/scripts/MouseControlsMenu.lua
r6595 r6662 1 1 -- MouseControlsMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("MouseControlsMenu") 5 if _REQUIREDNAME == nil then 6 MouseControlsMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("MouseControlsMenu") 10 4 11 function P :init()5 function P.init() 12 6 block = false 13 7 mousenormalscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MouseNormalScrollbar"),"CEGUI::Scrollbar") -
code/branches/gamestates2/data/gui/scripts/MultiplayerMenu.lua
r6595 r6662 1 1 -- MultiplayerMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("MultiplayerMenu") 5 if _REQUIREDNAME == nil then 6 MultiplayerMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("MultiplayerMenu") 10 4 11 function P :init()5 function P.init() 12 6 listbox = winMgr:getWindow("orxonox/MultiplayerLevelListbox") 13 7 preselect = orxonox.LevelManager:getInstance():getDefaultLevel() -
code/branches/gamestates2/data/gui/scripts/MultiplayerOptionsMenu.lua
r6595 r6662 1 1 -- MultiplayerOptionsMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("MultiplayerOptionsMenu") 5 if _REQUIREDNAME == nil then 6 MultiplayerOptionsMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("MultiplayerOptionsMenu") 10 4 11 5 function P.MultiplayerOptionsBackButton_clicked(e) -
code/branches/gamestates2/data/gui/scripts/PickupInventory.lua
r6595 r6662 1 1 -- PickupInventory.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("PickupInventory") 5 if _REQUIREDNAME == nil then 6 PickupInventory = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("PickupInventory") 10 4 11 5 P.lastEquipmentCount_ = 0 … … 14 8 15 9 -- events 16 function P :frmUpdate(e)10 function P.frmUpdate(e) 17 11 local equipCount = orxonox.PickupInventory:getEquipmentCount() 18 12 local usableCount = orxonox.PickupInventory:getUsableCount() 19 13 20 if equipCount ~= self.lastEquipmentCount_ or usableCount ~= self.lastUsableCount_ then21 self:updateTabs()14 if equipCount ~= P.lastEquipmentCount_ or usableCount ~= P.lastUsableCount_ then 15 P.updateTabs() 22 16 end 23 17 end … … 31 25 end 32 26 33 function P :mItemClicked(e)27 function P.mItemClicked(e) 34 28 local w = CEGUI.toWindowEventArgs(e).window 35 29 local name = w:getName() … … 42 36 43 37 if t == "use" then 44 if self.currentUsableID_ >= 0 then45 winMgr:getWindow("orxonox/Inventory/Title/use/" .. self.currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF")38 if P.currentUsableID_ >= 0 then 39 winMgr:getWindow("orxonox/Inventory/Title/use/" .. P.currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF") 46 40 end 47 41 orxonox.PickupInventory:selectUsable(tonumber(i)) 48 self.currentUsableID_ = tonumber(i)42 P.currentUsableID_ = tonumber(i) 49 43 winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444") 50 44 end … … 52 46 53 47 -- methods 54 function P :updateTabs()48 function P.updateTabs() 55 49 local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment") 56 50 local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable") … … 58 52 orxonox.PickupInventory:getSingleton():updateTabs(winMgr, eqWin, usWin) 59 53 60 self.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex()61 self.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount()62 self.lastUsableCount_ = orxonox.PickupInventory:getUsableCount()54 P.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex() 55 P.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount() 56 P.lastUsableCount_ = orxonox.PickupInventory:getUsableCount() 63 57 end 64 58 -
code/branches/gamestates2/data/gui/scripts/QuestGUI.lua
r6595 r6662 1 gui = require("BasicGUI") 2 local P = BasicGUI:new("QuestGUI") 3 if _REQUIREDNAME == nil then 4 QuestGUI = P 5 else 6 _G[_REQUIREDNAME] = P 7 end 1 -- QuestGUI.lua 8 2 9 function P:show() 10 self.window:show() -- TDO: Do this through parent... 11 self.visible = true 3 local P = createSheet("QuestGUI") 4 5 function P.show() 6 P.window:show() -- TDO: Do this through parent... 7 P.visible = true 12 8 13 9 local questManager = orxonox.QuestManager:getInstance() -
code/branches/gamestates2/data/gui/scripts/SettingsMenu.lua
r6595 r6662 1 1 -- SettingsMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("SettingsMenu") 5 if _REQUIREDNAME == nil then 6 SettingsMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("SettingsMenu") 10 4 11 5 function P.SettingsGameplayButton_clicked(e) … … 31 25 function P.SettingsResetSettingsButton_clicked(e) 32 26 -- reset settings 33 debug("event: reset settings")27 logMessage(0, "event: reset settings") 34 28 end 35 29 -
code/branches/gamestates2/data/gui/scripts/SingleplayerMenu.lua
r6595 r6662 1 1 -- SingleplayerMenu.lua 2 2 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new("SingleplayerMenu") 5 if _REQUIREDNAME == nil then 6 SingleplayerMenu = P 7 else 8 _G[_REQUIREDNAME] = P 9 end 3 local P = createSheet("SingleplayerMenu") 10 4 11 function P :init()5 function P.init() 12 6 listbox = winMgr:getWindow("orxonox/SingleplayerLevelListbox") 13 7 preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
Note: See TracChangeset
for help on using the changeset viewer.