Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 30, 2010, 4:34:01 PM (14 years ago)
Author:
rgrieder
Message:

Use "P." instead of "P:" when using our sheets as objects, not classes.
And use "P." instead of "self.".
This does not count for BasicGUI.lua because this is in fact seen as a class!!!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestate/data/gui/scripts/PickupInventory.lua

    r6621 r6659  
    88
    99-- events
    10 function P:frmUpdate(e)
     10function P.frmUpdate(e)
    1111    local equipCount = orxonox.PickupInventory:getEquipmentCount()
    1212    local usableCount = orxonox.PickupInventory:getUsableCount()
    1313
    14     if equipCount ~= self.lastEquipmentCount_ or usableCount ~= self.lastUsableCount_ then
    15         self:updateTabs()
     14    if equipCount ~= P.lastEquipmentCount_ or usableCount ~= P.lastUsableCount_ then
     15        P.updateTabs()
    1616    end
    1717end
     
    2525end
    2626
    27 function P:mItemClicked(e)
     27function P.mItemClicked(e)
    2828    local w = CEGUI.toWindowEventArgs(e).window
    2929    local name = w:getName()
     
    3636
    3737    if t == "use" then
    38         if self.currentUsableID_ >= 0 then
    39             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")
    4040        end
    4141        orxonox.PickupInventory:selectUsable(tonumber(i))
    42         self.currentUsableID_ = tonumber(i)
     42        P.currentUsableID_ = tonumber(i)
    4343        winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444")
    4444    end
     
    4646
    4747-- methods
    48 function P:updateTabs()
     48function P.updateTabs()
    4949    local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment")
    5050    local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable")
     
    5252    orxonox.PickupInventory:getSingleton():updateTabs(winMgr, eqWin, usWin)
    5353
    54     self.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex()
    55     self.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount()
    56     self.lastUsableCount_ = orxonox.PickupInventory:getUsableCount()
     54    P.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex()
     55    P.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount()
     56    P.lastUsableCount_ = orxonox.PickupInventory:getUsableCount()
    5757end
    5858
Note: See TracChangeset for help on using the changeset viewer.