Changeset 7504 for code/trunk/data/gui
- Timestamp:
- Oct 6, 2010, 8:00:40 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/data/gui/scripts/PickupInventory.lua
r7163 r7504 45 45 local useButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/UseButton") 46 46 local dropButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/DropButton") 47 if orxonox.PickupManager:getInstance():isValidPickup(pickup ) == false then47 if orxonox.PickupManager:getInstance():isValidPickup(pickup.pickup) == false then 48 48 useButton:setEnabled(false) 49 49 dropButton:setEnabled(false) … … 51 51 else 52 52 useButton:setEnabled(true) 53 if pickup :isUsed()== true then53 if pickup.inUse == true then 54 54 useButton:setText("unuse") 55 55 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked") 56 if pickup :isUsable()== false then56 if pickup.usable == false then 57 57 useButton:setEnabled(false) 58 58 end … … 60 60 useButton:setText("use") 61 61 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked") 62 if pickup :isUnusable()== false then62 if pickup.unusable == false then 63 63 useButton:setEnabled(false) 64 64 end 65 65 end 66 66 67 if pickup :isPickedUp()== false then67 if pickup.pickedUp == false then 68 68 useButton:setEnabled(false) 69 69 dropButton:setEnabled(false) … … 108 108 109 109 function P.createPickupEntry(index, pickup) 110 local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup )110 local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup.pickup) 111 111 112 112 local name = "orxonox/PickupInventory/Box/Pickup" .. index … … 133 133 useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+10),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2))) 134 134 useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 135 if pickup :isUsed()== false then135 if pickup.inUse == false then 136 136 useButton:setText("use") 137 137 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked") 138 if pickup :isUsable()== false then138 if pickup.usable == false then 139 139 useButton:setEnabled(false) 140 140 end … … 142 142 useButton:setText("unuse") 143 143 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseButton_clicked") 144 if pickup :isUnusable()== false then144 if pickup.unusable == false then 145 145 useButton:setEnabled(false) 146 146 end … … 193 193 function P.createDetailsWindow(pickupIndex) 194 194 local pickup = P.pickupsList[pickupIndex] 195 local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup )195 local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup.pickup) 196 196 197 197 local index = P.getNewDetailNumber() … … 238 238 useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10),CEGUI.UDim(1, -40))) 239 239 useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 240 if pickup :isUsed()== false then240 if pickup.inUse == false then 241 241 useButton:setText("use") 242 242 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked") 243 if pickup :isUsable()== false then243 if pickup.usable == false then 244 244 useButton:setEnabled(false) 245 245 end … … 247 247 useButton:setText("unuse") 248 248 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked") 249 if pickup :isUnusable()== false then249 if pickup.unusable == false then 250 250 useButton:setEnabled(false) 251 251 end … … 277 277 function P.InventoryUseButton_clicked(e) 278 278 local pickupIndex = P.windowToPickupHelper(e) 279 orxonox.PickupManager:getInstance():usePickup(P.pickupsList[pickupIndex], true) 279 local pickup = P.pickupsList[pickupIndex] 280 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, true) 280 281 end 281 282 282 283 function P.InventoryUnuseButton_clicked(e) 283 284 local pickupIndex = P.windowToPickupHelper(e) 284 orxonox.PickupManager:getInstance():usePickup(P.pickupsList[pickupIndex], false) 285 local pickup = P.pickupsList[pickupIndex] 286 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, false) 285 287 end 286 288 287 289 function P.InventoryDropButton_clicked(e) 288 290 local pickupIndex = P.windowToPickupHelper(e) 289 orxonox.PickupManager:getInstance():dropPickup(P.pickupsList[pickupIndex]) 291 local pickup = P.pickupsList[pickupIndex] 292 orxonox.PickupManager:getInstance():dropPickup(pickup.pickup) 290 293 end 291 294 … … 297 300 function P.InventoryUseDetailButton_clicked(e) 298 301 local pickupIndex = P.windowToPickupHelper(e) 299 orxonox.PickupManager:getInstance():usePickup(P.detailPickups[pickupIndex], true) 302 local pickup = P.detailPickups[pickupIndex] 303 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, true) 300 304 end 301 305 302 306 function P.InventoryUnuseDetailButton_clicked(e) 303 307 local pickupIndex = P.windowToPickupHelper(e) 304 orxonox.PickupManager:getInstance():usePickup(P.detailPickups[pickupIndex], false) 308 local pickup = P.detailPickups[pickupIndex] 309 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, false) 305 310 end 306 311 307 312 function P.InventoryDropDetailButton_clicked(e) 308 313 local pickupIndex = P.windowToPickupHelper(e) 309 orxonox.PickupManager:getInstance():dropPickup(P.detailPickups[pickupIndex]) 314 local pickup = P.detailPickups[pickupIndex] 315 orxonox.PickupManager:getInstance():dropPickup(pickup.pickup) 310 316 end 311 317
Note: See TracChangeset
for help on using the changeset viewer.