Changeset 11710 for code/trunk/data
- Timestamp:
- Jan 7, 2018, 12:50:29 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/data/gui/scripts/PickupInventory.lua
r9348 r11710 51 51 else 52 52 useButton:setEnabled(true) 53 if pickup.inUse == true then 54 useButton:setText("unuse") 55 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked") 53 if pickup.inUse == false then 54 useButton:setText("use") 56 55 if pickup.usable == false then 57 56 useButton:setEnabled(false) 58 57 end 59 58 else 60 useButton:setText("use") 61 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked") 59 useButton:setText("unuse") 62 60 if pickup.unusable == false then 63 61 useButton:setEnabled(false) … … 135 133 if pickup.inUse == false then 136 134 useButton:setText("use") 137 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")138 135 if pickup.usable == false then 139 136 useButton:setEnabled(false) … … 141 138 else 142 139 useButton:setText("unuse") 143 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseButton_clicked")144 140 if pickup.unusable == false then 145 141 useButton:setEnabled(false) 146 142 end 147 143 end 144 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseUnuseButton_clicked") 148 145 item:addChildWindow(useButton) 149 146 … … 240 237 if pickup.inUse == false then 241 238 useButton:setText("use") 242 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")243 239 if pickup.usable == false then 244 240 useButton:setEnabled(false) … … 246 242 else 247 243 useButton:setText("unuse") 248 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")249 244 if pickup.unusable == false then 250 245 useButton:setEnabled(false) 251 246 end 252 247 end 248 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseUnuseDetailButton_clicked") 253 249 wrapper:addChildWindow(useButton) 254 250 … … 275 271 end 276 272 277 function P.InventoryUse Button_clicked(e)273 function P.InventoryUseUnuseButton_clicked(e) 278 274 local pickupIndex = P.windowToPickupHelper(e) 279 275 local pickup = P.pickupsList[pickupIndex] 280 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, true) 281 end 282 283 function P.InventoryUnuseButton_clicked(e) 284 local pickupIndex = P.windowToPickupHelper(e) 285 local pickup = P.pickupsList[pickupIndex] 286 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, false) 276 if pickup.inUse == false then 277 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, true) 278 else 279 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, false) 280 end 287 281 end 288 282 … … 298 292 end 299 293 300 function P.InventoryUse DetailButton_clicked(e)294 function P.InventoryUseUnuseDetailButton_clicked(e) 301 295 local pickupIndex = P.windowToPickupHelper(e) 302 296 local pickup = P.detailPickups[pickupIndex] 303 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, true) 304 end 305 306 function P.InventoryUnuseDetailButton_clicked(e) 307 local pickupIndex = P.windowToPickupHelper(e) 308 local pickup = P.detailPickups[pickupIndex] 309 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, false) 297 if pickup.inUse == false then 298 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, true) 299 else 300 orxonox.PickupManager:getInstance():usePickup(pickup.pickup, false) 301 end 310 302 end 311 303
Note: See TracChangeset
for help on using the changeset viewer.