Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2010, 1:05:28 AM (15 years ago)
Author:
rgrieder
Message:

Merged revisions 6621-6661 to gamestates2.

Location:
code/branches/gamestates2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2

  • code/branches/gamestates2/data/gui/scripts/PickupInventory.lua

    r6595 r6662  
    11-- PickupInventory.lua
    22
    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
     3local P = createSheet("PickupInventory")
    104
    115P.lastEquipmentCount_ = 0
     
    148
    159-- events
    16 function P:frmUpdate(e)
     10function P.frmUpdate(e)
    1711    local equipCount = orxonox.PickupInventory:getEquipmentCount()
    1812    local usableCount = orxonox.PickupInventory:getUsableCount()
    1913
    20     if equipCount ~= self.lastEquipmentCount_ or usableCount ~= self.lastUsableCount_ then
    21         self:updateTabs()
     14    if equipCount ~= P.lastEquipmentCount_ or usableCount ~= P.lastUsableCount_ then
     15        P.updateTabs()
    2216    end
    2317end
     
    3125end
    3226
    33 function P:mItemClicked(e)
     27function P.mItemClicked(e)
    3428    local w = CEGUI.toWindowEventArgs(e).window
    3529    local name = w:getName()
     
    4236
    4337    if t == "use" then
    44         if self.currentUsableID_ >= 0 then
    45             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")
    4640        end
    4741        orxonox.PickupInventory:selectUsable(tonumber(i))
    48         self.currentUsableID_ = tonumber(i)
     42        P.currentUsableID_ = tonumber(i)
    4943        winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444")
    5044    end
     
    5246
    5347-- methods
    54 function P:updateTabs()
     48function P.updateTabs()
    5549    local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment")
    5650    local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable")
     
    5852    orxonox.PickupInventory:getSingleton():updateTabs(winMgr, eqWin, usWin)
    5953
    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()
    6357end
    6458
Note: See TracChangeset for help on using the changeset viewer.