Changeset 5559 for data/media/gui
- Timestamp:
- May 25, 2009, 10:08:48 PM (15 years ago)
- Location:
- data/media/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/gui/layouts/PickupInventory.layout
r5551 r5559 27 27 </Window> 28 28 </Window> 29 30 <Event Name="WindowUpdate" Function=" frmUpdate" />29 30 <Event Name="WindowUpdate" Function="PickupInventory.update" /> 31 31 </Window> 32 32 </GUILayout> -
data/media/gui/scripts/PickupInventory.lua
r5529 r5559 1 layoutPath = "PickupInventory.layout" 1 gui = require("gui") 2 local P = gui:new() --inherit everything from the gui package 2 3 3 -- variables 4 local winMgr = CEGUI.WindowManager:getSingleton() 4 PickupInventory = P 5 5 6 local lastEquipmentCount_ = 0 7 local lastUsableCount_ = 0 8 local currentUsableID_ = 0 6 P.filename = "PickupInventory" 7 P.layoutString = "PickupInventory.layout" 8 9 P.lastEquipmentCount_ = 0 10 P.lastUsableCount_ = 0 11 P.currentUsableID_ = 0 9 12 10 13 -- events 11 function frmUpdate(e)14 function P:frmUpdate(e) 12 15 local equipCount = orxonox.PickupInventory:getEquipmentCount() 13 16 local usableCount = orxonox.PickupInventory:getUsableCount() 14 17 15 if equipCount ~= lastEquipmentCount_ or usableCount ~=lastUsableCount_ then16 updateTabs()18 if equipCount ~= self.lastEquipmentCount_ or usableCount ~= self.lastUsableCount_ then 19 self:updateTabs() 17 20 end 18 21 end 19 22 20 function itemClicked(e) 23 function P.update(e) 24 loadedGUIs["PickupInventory"]:frmUpdate(e) 25 end 26 27 function P.itemClicked(e) 28 loadedGUIs["PickupInventory"]:mItemClicked(e) 29 end 30 31 function P:mItemClicked(e) 21 32 local w = CEGUI.toWindowEventArgs(e).window 22 33 local name = w:getName() … … 29 40 30 41 if t == "use" then 31 if currentUsableID_ >= 0 then32 winMgr:getWindow("orxonox/Inventory/Title/use/" .. currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF")42 if self.currentUsableID_ >= 0 then 43 winMgr:getWindow("orxonox/Inventory/Title/use/" .. self.currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF") 33 44 end 34 45 orxonox.PickupInventory:selectUsable(tonumber(i)) 35 currentUsableID_ = tonumber(i)46 self.currentUsableID_ = tonumber(i) 36 47 winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444") 37 48 end … … 39 50 40 51 -- methods 41 function updateTabs()52 function P:updateTabs() 42 53 local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment") 43 54 local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable") … … 45 56 orxonox.PickupInventory:getSingleton():updateTabs(winMgr, eqWin, usWin) 46 57 47 currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex()48 lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount()49 lastUsableCount_ = orxonox.PickupInventory:getUsableCount()58 self.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex() 59 self.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount() 60 self.lastUsableCount_ = orxonox.PickupInventory:getUsableCount() 50 61 end 62 63 return PickupInventory -
data/media/gui/scripts/gui.lua
r5527 r5559 15 15 setmetatable(newElement, self) -- connects new element with class 16 16 self.__index = self 17 self:init()18 17 return newElement 19 18 end … … 36 35 37 36 function P:load () 38 return self:new(winMgr:loadWindowLayout(self.layoutString), self.filename) 37 self.window = winMgr:loadWindowLayout(self.layoutString) 38 self:init() 39 return self 39 40 end 40 41 -
data/media/gui/scripts/mainmenu_2.lua
r5532 r5559 12 12 preselect = orxonox.Game:getInstance():getLevel() 13 13 orxonox.GUIManager:getInstance():getLevelList() --levellist variable ist set now 14 table.sort(levellist) 14 15 for k,v in pairs(levellist) do 15 16 item = CEGUI.createListboxTextItem(v)
Note: See TracChangeset
for help on using the changeset viewer.