Changeset 6595 for code/branches/gamestates2/data/gui/scripts
- Timestamp:
- Mar 22, 2010, 2:47:10 PM (15 years ago)
- Location:
- code/branches/gamestates2
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamestates2
- Property svn:mergeinfo changed
/code/branches/gamestate merged: 6441-6442,6459,6537,6544-6546,6548,6564,6566-6567,6569,6571-6572
- Property svn:mergeinfo changed
-
code/branches/gamestates2/data/gui/scripts/AudioMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("AudioMenu") 5 5 if _REQUIREDNAME == nil then 6 6 AudioMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "AudioMenu"12 P.layoutString = "AudioMenu.layout"13 10 14 11 function P:init() … … 43 40 for k,v in pairs(themeList) do 44 41 item = CEGUI.createListboxTextItem(v) 45 item:setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush")42 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 46 43 CEGUI.toListbox(listboxwindow):addItem(item) 47 44 end -
code/branches/gamestates2/data/gui/scripts/BasicGUI.lua
r5781 r6595 8 8 end 9 9 10 -- useless, even wrong? P is the class, not the object.. 10 11 P.overlay = nil 11 12 12 13 -- constructor of the GUI 13 function P:new (gui, fname) 14 local newElement = { window = gui, filename = fname, visible = false } or {} 14 function P:new(_filename, _gui, _visible) 15 local newElement = { 16 filename = _filename, 17 gui = _gui, 18 visible = _visible or false 19 } or {} 15 20 setmetatable(newElement, self) -- connects new element with class 16 21 self.__index = self … … 18 23 end 19 24 25 -- Override this function if you need to 20 26 function P:init() 21 -- this function is empty and intended for inheriting GUIs to use 27 end 28 29 -- Override this function if you need to 30 -- But don't forget to stick to the naming convention ("GUI_" .. self.filename) 31 function P:createInputState() 32 self.inputState = guiMgr:createInputState("GUI_" .. self.filename) 22 33 end 23 34 24 35 -- hide function for the GUI 25 function P:hide 36 function P:hide() 26 37 self.window:hide() 27 38 self.visible = false … … 29 40 30 41 -- show function for the GUI 31 function P:show 42 function P:show() 32 43 self.window:show() 33 44 self.visible = true 34 45 end 35 46 36 function P:load () 37 self.window = winMgr:loadWindowLayout(self.layoutString) 47 function P:load() 48 self.window = winMgr:loadWindowLayout(self.filename .. ".layout") 49 self:createInputState() 38 50 self:init() 39 51 return self -
code/branches/gamestates2/data/gui/scripts/ControlsMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("ControlsMenu") 5 5 if _REQUIREDNAME == nil then 6 6 ControlsMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "ControlsMenu"12 P.layoutString = "ControlsMenu.layout"13 10 14 11 function P.ControlsMouseControlsButton_clicked(e) -
code/branches/gamestates2/data/gui/scripts/CreditsMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("CreditsMenu") 5 5 if _REQUIREDNAME == nil then 6 6 CreditsMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "CreditsMenu"12 P.layoutString = "CreditsMenu.layout"13 10 14 11 function P.CreditsBackButton_clicked(e) -
code/branches/gamestates2/data/gui/scripts/DecisionPopup.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("DecisionPopup") 5 5 if _REQUIREDNAME == nil then 6 6 DecisionPopup = P 7 7 else 8 8 _G[_REQUIREDNAME] = P 9 end10 11 P.filename = "DecisionPopup"12 P.layoutString = "DecisionPopup.layout"13 14 function P:init()15 9 end 16 10 -
code/branches/gamestates2/data/gui/scripts/GameplayMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("GameplayMenu") 5 5 if _REQUIREDNAME == nil then 6 6 GameplayMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "GameplayMenu"12 P.layoutString = "GameplayMenu.layout"13 10 14 11 function P:init() … … 20 17 for k,v in pairs(themeList) do 21 18 item = CEGUI.createListboxTextItem(v) 22 item:setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush")19 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 23 20 CEGUI.toCombobox(dropdown):addItem(item) 24 21 end -
code/branches/gamestates2/data/gui/scripts/GraphicsMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("GraphicsMenu") 5 5 if _REQUIREDNAME == nil then 6 6 GraphicsMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "GraphicsMenu"12 P.layoutString = "GraphicsMenu.layout"13 10 14 11 function P:init() … … 62 59 for k,v in pairs(resolutionList) do 63 60 item = CEGUI.createListboxTextItem(v) 64 item:setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush")61 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 65 62 CEGUI.toListbox(listboxwindow):addItem(item) 66 63 end -
code/branches/gamestates2/data/gui/scripts/InGameMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("InGameMenu") 5 5 if _REQUIREDNAME == nil then 6 6 InGameMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "InGameMenu"12 P.layoutString = "InGameMenu.layout"13 14 function P:init()15 end16 17 10 18 11 -- events for ingamemenu -
code/branches/gamestates2/data/gui/scripts/InfoPopup.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("InfoPopup") 5 5 6 6 if _REQUIREDNAME == nil then … … 8 8 else 9 9 _G[_REQUIREDNAME] = P 10 end11 12 P.filename = "InfoPopup"13 P.layoutString = "InfoPopup.layout"14 15 function P:init()16 10 end 17 11 … … 26 20 end 27 21 28 function P.setText( text)22 function P.setText(text) 29 23 winMgr:getWindow("orxonox/InfoPopup_text"):setText( text ) 30 24 end … … 42 36 -- events for ingamemenu 43 37 function P.close(e) 44 hideGUI( "InfoPopup")38 hideGUI(P.filename) 45 39 end 46 40 -
code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua
r6417 r6595 1 winMgr = CEGUI.WindowManager:getSingleton() 2 guiMgr = orxonox.GUIManager:getInstance() 3 inputMgr = orxonox.InputManager:getInstance() 4 1 5 local schemeMgr = CEGUI.SchemeManager:getSingleton() 2 winMgr = CEGUI.WindowManager:getSingleton() 3 local logger = CEGUI.Logger:getSingleton() 4 local system = CEGUI.System:getSingleton() 5 local cursor = CEGUI.MouseCursor:getSingleton() 6 7 schemeMgr:loadScheme("TaharezLookSkin.scheme") 8 -- load scheme with our own images 6 local system = CEGUI.System:getSingleton() 7 local cursor = CEGUI.MouseCursor:getSingleton() 8 9 -- Load all required skins 10 schemeMgr:loadScheme("TaharezGreenLook.scheme") 11 --schemeMgr:loadScheme("TaharezLook.scheme") 12 --schemeMgr:loadScheme("WindowsLook.scheme") 13 --schemeMgr:loadScheme("VanillaLook.scheme") 14 --schemeMgr:loadScheme("SleekSpaceLook.scheme") 15 16 -- Connect skin specific window types with our own window types 17 -- By loading a different file (if there is) you can change the skin 18 -- of the menus or the HUD independently 19 schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme") 20 menuImageSet = "TaharezGreenLook" 21 schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme") 22 hudImageSet = "TaharezGreenLook" 23 24 -- Just a remaining test hack 9 25 schemeMgr:loadScheme("OrxonoxGUIScheme.scheme") 10 26 11 system:setDefaultMouseCursor( "TaharezLook", "MouseArrow")27 system:setDefaultMouseCursor(menuImageSet, "MouseArrow") 12 28 system:setDefaultFont("BlueHighway-12") 13 system:setDefaultTooltip(" TaharezLook/Tooltip")29 system:setDefaultTooltip("MenuWidgets/Tooltip") 14 30 15 31 loadedGUIs = {} … … 51 67 end 52 68 53 -- shows the specified and loads it if not loaded already 54 -- be sure to set the global variable "filename" before calling this function 69 -- shows the specified GUI sheet and loads it if not loaded already 55 70 function showGUI(filename, hidePrevious, bCursorVisible) 56 71 if bCursorVisible == nil then … … 87 102 else 88 103 if nrOfActiveSheets == 0 then 89 orxonox.InputManager:getInstance():enterState("guiMouseOnly")104 --orxonox.InputManager:getInstance():enterState("guiMouseOnly") 90 105 orxonox.HumanController:pauseControl() 91 106 end 92 107 end 108 orxonox.InputManager:getInstance():enterState(currentGUI.inputState) 109 93 110 nrOfActiveSheets = nrOfActiveSheets + 1 94 111 table.insert(activeSheets, filename) … … 161 178 bHidePrevious[filename] = nil 162 179 if nrOfActiveSheets == 0 then 163 orxonox.InputManager:getInstance():leaveState("guiMouseOnly")180 --orxonox.InputManager:getInstance():leaveState("guiMouseOnly") 164 181 orxonox.HumanController:resumeControl() 165 182 hideCursor() 166 183 end 184 orxonox.InputManager:getInstance():leaveState(currentGUI.inputState) 167 185 end 168 186 -
code/branches/gamestates2/data/gui/scripts/KeyBindMenu.lua
r6549 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("KeyBindMenu") 5 5 6 6 if _REQUIREDNAME == nil then … … 9 9 _G[_REQUIREDNAME] = P 10 10 end 11 12 P.filename = "KeyBindMenu"13 P.layoutString = "KeyBindMenu.layout"14 11 15 12 function P:init() … … 68 65 69 66 --Calculate design parameters: 70 sampleWindow = winMgr:createWindow(" TaharezLook/StaticText", "orxonox/KeyBindPane/SampleWindow")67 sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/SampleWindow") 71 68 sampleWindow:setText("SampleText") 72 69 … … 125 122 line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, lineHeight*(k-1)))) 126 123 127 local command = winMgr:createWindow(" TaharezLook/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command")124 local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command") 128 125 command:setText(nameList[k]) 129 126 command:setSize(CEGUI.UVector2(CEGUI.UDim(0, commandWidth), CEGUI.UDim(1, 0))) … … 132 129 offset = offset + commandWidth + spaceWidth 133 130 134 local plus = winMgr:createWindow(" TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus")131 local plus = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Plus") 135 132 plus:setSize(CEGUI.UVector2(CEGUI.UDim(0, addWidth), CEGUI.UDim(0.7, 0))) 136 133 plus:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0))) … … 142 139 local numButtons = orxonox.KeyBinderManager:getInstance():getCurrent():getNumberOfBindings(commandList[k]); 143 140 for i=0,(numButtons-1) do 144 local button = winMgr:createWindow(" TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i)141 local button = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button" .. i) 145 142 local name = orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(commandList[k],i) 146 143 name = P.KeyNameNiceifier(name) … … 156 153 offset = offset + buttonWidth 157 154 158 local clear = winMgr:createWindow(" TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i)155 local clear = winMgr:createWindow("MenuWidgets/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear" .. i) 159 156 clear:setSize(CEGUI.UVector2(CEGUI.UDim(0, clearWidth), CEGUI.UDim(0.7, 0))) 160 157 clear:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.15, 0))) -
code/branches/gamestates2/data/gui/scripts/MainMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("MainMenu") 5 5 if _REQUIREDNAME == nil then 6 6 MainMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "MainMenu"12 P.layoutString = "MainMenu.layout"13 10 14 11 -- events for MainMenu -
code/branches/gamestates2/data/gui/scripts/MouseControlsMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("MouseControlsMenu") 5 5 if _REQUIREDNAME == nil then 6 6 MouseControlsMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "MouseControlsMenu"12 P.layoutString = "MouseControlsMenu.layout"13 10 14 11 function P:init() -
code/branches/gamestates2/data/gui/scripts/MultiplayerMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("MultiplayerMenu") 5 5 if _REQUIREDNAME == nil then 6 6 MultiplayerMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "MultiplayerMenu"12 P.layoutString = "MultiplayerMenu.layout"13 10 14 11 function P:init() … … 30 27 for k,v in pairs(levelList) do 31 28 item = CEGUI.createListboxTextItem(v) 32 item:setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush")29 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 33 30 CEGUI.toListbox(listbox):addItem(item) 34 31 if v .. ".oxw" == preselect then -
code/branches/gamestates2/data/gui/scripts/MultiplayerOptionsMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("MultiplayerOptionsMenu") 5 5 if _REQUIREDNAME == nil then 6 6 MultiplayerOptionsMenu = P … … 9 9 end 10 10 11 P.filename = "MultiplayerOptionsMenu"12 P.layoutString = "MultiplayerOptionsMenu.layout"13 14 11 function P.MultiplayerOptionsBackButton_clicked(e) 15 12 hideGUI(P.filename) -
code/branches/gamestates2/data/gui/scripts/PickupInventory.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("PickupInventory") 5 5 if _REQUIREDNAME == nil then 6 6 PickupInventory = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "PickupInventory"12 P.layoutString = "PickupInventory.layout"13 10 14 11 P.lastEquipmentCount_ = 0 -
code/branches/gamestates2/data/gui/scripts/QuestGUI.lua
r6417 r6595 1 1 gui = require("BasicGUI") 2 local P = BasicGUI:new( ) --inherit everything from the gui package2 local P = BasicGUI:new("QuestGUI") 3 3 if _REQUIREDNAME == nil then 4 4 QuestGUI = P … … 6 6 _G[_REQUIREDNAME] = P 7 7 end 8 9 P.filename = "QuestGUI"10 P.layoutString = "QuestGUI.layout"11 8 12 9 function P:show() -
code/branches/gamestates2/data/gui/scripts/SettingsMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("SettingsMenu") 5 5 if _REQUIREDNAME == nil then 6 6 SettingsMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "SettingsMenu"12 P.layoutString = "SettingsMenu.layout"13 10 14 11 function P.SettingsGameplayButton_clicked(e) -
code/branches/gamestates2/data/gui/scripts/SingleplayerMenu.lua
r6417 r6595 2 2 3 3 BasicGUI = require("BasicGUI") 4 local P = BasicGUI:new( ) --inherit everything from the gui package4 local P = BasicGUI:new("SingleplayerMenu") 5 5 if _REQUIREDNAME == nil then 6 6 SingleplayerMenu = P … … 8 8 _G[_REQUIREDNAME] = P 9 9 end 10 11 P.filename = "SingleplayerMenu"12 P.layoutString = "SingleplayerMenu.layout"13 10 14 11 function P:init() … … 30 27 for k,v in pairs(levelList) do 31 28 item = CEGUI.createListboxTextItem(v) 32 item:setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush")29 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 33 30 CEGUI.toListbox(listbox):addItem(item) 34 31 if v .. ".oxw" == preselect then
Note: See TracChangeset
for help on using the changeset viewer.