- Timestamp:
- Apr 1, 2010, 10:21:35 AM (15 years ago)
- Location:
- code/branches/pickup4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup4/data/gui/scripts/PickupInventory.lua
r6632 r6669 13 13 P.layoutString = "PickupInventory.layout" 14 14 15 function P:init() 15 P.carrierList = {} 16 17 function P.init() 16 18 17 19 end 18 20 19 function P :show()20 self.window:show() -- TODO: Do this through parent...21 self.visible = true21 function P.show() 22 P.window:show() -- TODO: Do this through parent... 23 P.visible = true 22 24 23 carrierList = {}25 table.insert(P.carrierList, 4) 24 26 25 -- TODO: Nicer?26 27 local pickupManager = orxonox.PickupManager:getInstance() 27 28 local carrier = pickupManager:getPawn() 28 29 P.getCarrierList(carrier) 29 30 30 for k,v in pairs( carrierList) do31 for k,v in pairs(P.carrierList) do 31 32 local args = {} 32 33 table.insert(args, v) … … 43 44 end 44 45 45 table.insert( carrierList, carrier)46 table.insert(P.carrierList, carrier) 46 47 47 local numCarriers = orxonox.PickupManager .getInstance():getNumCarrierChildren(carrier)48 local numCarriers = orxonox.PickupManager:getInstance():getNumCarrierChildren(carrier) 48 49 if numCarriers == 0 then 49 50 return … … 51 52 52 53 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) 54 55 if child ~= nil then 55 56 P.getCarrierList(child) -
code/branches/pickup4/src/modules/pickup/PickupManager.cc
r6632 r6669 129 129 unsigned int PickupManager::getNumCarrierChildren(PickupCarrier* carrier) 130 130 { 131 if(carrier == NULL) 132 return 0; 131 133 return carrier->getNumCarrierChildren(); 132 134 } -
code/branches/pickup4/src/modules/pickup/PickupManager.h
r6632 r6669 47 47 { // tolua_export 48 48 49 //TODO: Remove after transfer to orxonox/pickup50 class PickupCarrier; // tolua_export51 52 49 /** 53 50 @brief … … 73 70 74 71 // tolua_begin 75 PickupCarrier* getPawn(void);72 orxonox::PickupCarrier* getPawn(void); 76 73 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); 79 76 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); 84 81 // tolua_end 85 82
Note: See TracChangeset
for help on using the changeset viewer.