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.

Location:
code/branches/presentation3/data
Files:
2 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)
  • code/branches/presentation3/data/levels/pickups.oxw

    r7083 r7162  
    136136    </PickupSpawner>
    137137
     138    <PickupSpawner position="25,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
     139      <pickup>
     140        <MetaPickup metaType="destroy" />
     141      </pickup>
     142    </PickupSpawner>
     143
     144    <PickupSpawner position="50,75,-125" triggerDistance="10" respawnTime="5" maxSpawnedItems="10">
     145      <pickup>
     146        <MetaPickup metaType="destroyCarrier" />
     147      </pickup>
     148    </PickupSpawner>
     149
    138150    <!-- Pickup Collection pickups -->
    139151
     
    162174    >
    163175      <pickup>
    164         <HealthPickup health=50 activationType="onUse" durationType="once" />
     176        <HealthPickup health=500 activationType=immediate healthRate=10 durationType=continuous />
    165177      </pickup>
    166178    </PickupRepresentation>
     
    168180    <PickupSpawner position="-50,0,-125" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
    169181      <pickup>
    170         <HealthPickup health=50 activationType=onUse durationType=once />
     182        <HealthPickup health=500 activationType=immediate healthRate=10 durationType=continuous />
    171183      </pickup>
    172184    </PickupSpawner>
Note: See TracChangeset for help on using the changeset viewer.