Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6669


Ignore:
Timestamp:
Apr 1, 2010, 10:21:35 AM (15 years ago)
Author:
dafrick
Message:

Committing recent changes in PickupInventory, to be able to try out some things and easily revert if they don't work out.

Location:
code/branches/pickup4
Files:
3 edited

Legend:

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

    r6632 r6669  
    1313P.layoutString = "PickupInventory.layout"
    1414
    15 function P:init()
     15P.carrierList = {}
     16
     17function P.init()
    1618   
    1719end
    1820
    19 function P:show()
    20     self.window:show() -- TODO: Do this through parent...
    21     self.visible = true
     21function P.show()
     22    P.window:show() -- TODO: Do this through parent...
     23    P.visible = true
    2224   
    23     carrierList = {}
     25    table.insert(P.carrierList, 4)
    2426   
    25     -- TODO: Nicer?
    2627    local pickupManager = orxonox.PickupManager:getInstance()
    2728    local carrier = pickupManager:getPawn()
    2829    P.getCarrierList(carrier)
    2930   
    30     for k,v in pairs(carrierList) do
     31    for k,v in pairs(P.carrierList) do
    3132        local args = {}
    3233        table.insert(args, v)
     
    4344    end
    4445   
    45     table.insert(carrierList, carrier)
     46    table.insert(P.carrierList, carrier)
    4647   
    47     local numCarriers = orxonox.PickupManager.getInstance():getNumCarrierChildren(carrier)
     48    local numCarriers = orxonox.PickupManager:getInstance():getNumCarrierChildren(carrier)
    4849    if numCarriers == 0 then
    4950        return
     
    5152   
    5253    for i=0,numCarriers-1,1 do
    53         local child = orxonox.PickupManager.getInstance():getCarrierChild(i, carrier)
     54        local child = orxonox.PickupManager:getInstance():getCarrierChild(i, carrier)
    5455        if child ~= nil then
    5556            P.getCarrierList(child)
  • code/branches/pickup4/src/modules/pickup/PickupManager.cc

    r6632 r6669  
    129129    unsigned int PickupManager::getNumCarrierChildren(PickupCarrier* carrier)
    130130    {
     131        if(carrier == NULL)
     132            return 0;
    131133        return carrier->getNumCarrierChildren();
    132134    }
  • code/branches/pickup4/src/modules/pickup/PickupManager.h

    r6632 r6669  
    4747{ // tolua_export
    4848
    49     //TODO: Remove after transfer to orxonox/pickup
    50     class PickupCarrier; // tolua_export
    51 
    5249    /**
    5350    @brief
     
    7370           
    7471            // tolua_begin
    75             PickupCarrier* getPawn(void);
     72            orxonox::PickupCarrier* getPawn(void);
    7673           
    77             unsigned int getNumCarrierChildren(PickupCarrier* carrier);
    78             PickupCarrier* getCarrierChild(unsigned int index, PickupCarrier* carrier);
     74            unsigned int getNumCarrierChildren(orxonox::PickupCarrier* carrier);
     75            orxonox::PickupCarrier* getCarrierChild(unsigned int index, orxonox::PickupCarrier* carrier);
    7976           
    80             unsigned int getNumPickups(PickupCarrier* carrier);
    81             PickupRepresentation* getPickupRepresentation(unsigned int index, PickupCarrier* carrier);
    82             void dropPickup(unsigned int index, PickupCarrier* carrier);
    83             void usePickup(unsigned int index, PickupCarrier* carrier, bool use);
     77            unsigned int getNumPickups(orxonox::PickupCarrier* carrier);
     78            PickupRepresentation* getPickupRepresentation(unsigned int index, orxonox::PickupCarrier* carrier);
     79            void dropPickup(unsigned int index, orxonox::PickupCarrier* carrier);
     80            void usePickup(unsigned int index, orxonox::PickupCarrier* carrier, bool use);
    8481            // tolua_end
    8582           
Note: See TracChangeset for help on using the changeset viewer.