Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 8, 2010, 8:53:52 PM (14 years ago)
Author:
dafrick
Message:

Significant structural changes to the pickup module. Lots of bugs found and fixed.
Introduced a new class CollectiblePickup (which is now the only kind a PickupCollection can consist of) to solve some issues cleanly.
MetaPickup received additional functionality. It can now also be set to either destroy all the pickups of a PickupCarrier or destroy the PickupCarrier itself. (This was done mainly for testing purposes)
I've done some extensive testing on the pickups, so they should really work now.

File:
1 edited

Legend:

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

    r7072 r7162  
    5454                        useButton:setText("unuse")
    5555                        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")
     56                        if pickup:isUsable() == false then
     57                            useButton:setEnabled(false)
     58                        end
    5659                    else
    5760                        useButton:setText("use")
    5861                        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")
     62                        if pickup:isUnusable() == false then
     63                            useButton:setEnabled(false)
     64                        end
    5965                    end
    6066
     
    130136        useButton:setText("use")
    131137        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")
     138        if pickup:isUsable() == false then
     139            useButton:setEnabled(false)
     140        end
    132141    else
    133142        useButton:setText("unuse")
    134143        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseButton_clicked")
     144        if pickup:isUnusable() == false then
     145            useButton:setEnabled(false)
     146        end
    135147    end
    136148    item:addChildWindow(useButton)
     
    229241        useButton:setText("use")
    230242        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")
     243        if pickup:isUsable() == false then
     244            useButton:setEnabled(false)
     245        end
    231246    else
    232247        useButton:setText("unuse")
    233248        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")
     249        if pickup:isUnusable() == false then
     250            useButton:setEnabled(false)
     251        end
    234252    end
    235253    wrapper:addChildWindow(useButton)
Note: See TracChangeset for help on using the changeset viewer.