- Timestamp:
- Mar 31, 2010, 1:05:28 AM (15 years ago)
- Location:
- code/branches/gamestates2
- Files:
-
- 2 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/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
Note: See TracChangeset
for help on using the changeset viewer.