- Timestamp:
- May 20, 2009, 8:55:23 PM (16 years ago)
- Location:
- data/media
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/gui/layouts/PickupInventory.layout
r5506 r5526 2 2 <GUILayout> 3 3 <Window Type="TaharezLook/FrameWindow" Name="orxonox/Inventory"> 4 <Property Name="UnifiedMinSize" Value="{{0. 4,0},{0.3,0}}" />5 <Property Name="UnifiedMaxSize" Value="{{0. 8,0},{0.8,0}}" />6 <Property Name="UnifiedPosition" Value="{{0. 3,0},{0.35,0}}" />7 <Property Name="UnifiedSize" Value="{{0. 4,0},{0.3,0}}" />4 <Property Name="UnifiedMinSize" Value="{{0.0,385},{0.0,200}}" /> 5 <Property Name="UnifiedMaxSize" Value="{{0.0,385},{0.0,200}}" /> 6 <Property Name="UnifiedPosition" Value="{{0.5,-100},{0.5,-85}}" /> 7 <Property Name="UnifiedSize" Value="{{0.0,385},{0.0,200}}" /> 8 8 <Property Name="Text" Value="Inventory" /> 9 9 <Property Name="CloseButtonEnabled" Value="False" /> … … 18 18 <Window Type="TaharezLook/ScrollablePane" Name="orxonox/Inventory/TabControl/TabEquipment"> 19 19 <Property Name="Text" Value="Equipment" /> 20 <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}"/> 21 <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/> 22 23 <Window Type="TaharezLook/Button" Name="orxonox/Inventory/equipmentButton/1"> 24 <Property Name="UnifiedPosition" Value="{{0.0,6},{0.0,6}}"/> 25 <Property Name="UnifiedSize" Value="{{0.2,-12},{0.2,-12}}"/> 26 <Property Name="Text" Value="1"/> 27 </Window> 28 <Window Type="TaharezLook/Button" Name="orxonox/Inventory/equipmentButton/2"> 29 <Property Name="UnifiedPosition" Value="{{0.2,6},{0.0,6}}"/> 30 <Property Name="UnifiedSize" Value="{{0.2,-12},{0.2,-12}}"/> 31 <Property Name="Text" Value="2"/> 32 </Window> 33 <Window Type="TaharezLook/Button" Name="orxonox/Inventory/equipmentButton/3"> 34 <Property Name="UnifiedPosition" Value="{{0.4,6},{0.0,6}}"/> 35 <Property Name="UnifiedSize" Value="{{0.2,-12},{0.2,-12}}"/> 36 <Property Name="Text" Value="3"/> 37 </Window> 38 <Window Type="TaharezLook/Button" Name="orxonox/Inventory/equipmentButton/4"> 39 <Property Name="UnifiedPosition" Value="{{0.6,6},{0.0,6}}"/> 40 <Property Name="UnifiedSize" Value="{{0.2,-12},{0.2,-12}}"/> 41 <Property Name="Text" Value="4"/> 42 </Window> 43 <Window Type="TaharezLook/Button" Name="orxonox/Inventory/equipmentButton/5"> 44 <Property Name="UnifiedPosition" Value="{{0.8,6},{0.0,6}}"/> 45 <Property Name="UnifiedSize" Value="{{0.2,-12},{0.2,-12}}"/> 46 <Property Name="Text" Value="5"/> 47 </Window> 20 <Property Name="UnifiedPosition" Value="{{0.0,3},{0.0,3}}"/> 21 <Property Name="UnifiedSize" Value="{{1.0,-6},{1.0,-6}}"/> 48 22 </Window> 49 23 <Window Type="TaharezLook/ScrollablePane" Name="orxonox/Inventory/TabControl/TabUsable"> 50 24 <Property Name="Text" Value="Usable" /> 25 <Property Name="UnifiedPosition" Value="{{0.0,3},{0.0,3}}"/> 26 <Property Name="UnifiedSize" Value="{{1.0,-6},{1.0,-6}}"/> 51 27 </Window> 52 28 -
data/media/gui/scripts/PickupInventory.lua
r5506 r5526 1 1 layoutPath = "PickupInventory.layout" 2 3 -- variables 4 local winMgr = CEGUI.WindowManager:getSingleton() 5 local lastEquipmentCount_ = 0 6 local lastUsableCount_ = 0 7 8 local currentUsableID_ = -1 9 local lastUsedEquipID_ = 0 10 local lastUsedUsableID_ = 0 2 11 3 12 -- events … … 7 16 end 8 17 function frmUpdate(e) 18 local equipCount = orxonox.PickupInventory:getEquipmentCount() 19 local usableCount = orxonox.PickupInventory:getUsableCount() 9 20 21 if equipCount ~= lastEquipmentCount_ or usableCount ~= lastUsableCount_ then 22 updateTabs() 23 end 10 24 end 11 25 12 function noButtonClicked(e) 13 orxonox.PickupInventory:toggleInventory() 26 function itemClicked(e) 27 local w = CEGUI.toWindowEventArgs(e).window 28 local name = w:getName() 29 local t = name:sub(25, 27) 30 local i = name:sub(29) 31 32 if t == "equ" then 33 34 end 35 36 if t == "use" then 37 if currentUsableID_ >= 0 then 38 winMgr:getWindow("orxonox/Inventory/Title/use/" .. currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF") 39 end 40 orxonox.PickupInventory:selectUsable(tonumber(i)) 41 currentUsableID_ = tonumber(i) 42 winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444") 43 end 14 44 end 45 46 -- methods 47 function updateTabs() 48 local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment") 49 local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable") 50 orxonox.PickupInventory:clearInventory(winMgr, lastEquipmentCount_, lastUsableCount_) 51 orxonox.PickupInventory:updateTabs(winMgr, eqWin, usWin) 52 53 currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex() 54 lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount() 55 lastUsableCount_ = orxonox.PickupInventory:getUsableCount() 56 end -
data/media/levels/pickuptest.oxw
r5506 r5526 15 15 16 16 <Template name="jumpTest" baseclass="Jump"> 17 <Jump velocity="0,0,500" jumpsAvailable="1 0" />17 <Jump velocity="0,0,500" jumpsAvailable="1" guiImage="decal.jpg" guiText="TEST" /> 18 18 </Template> 19 19 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" /> 20 20 21 <PickupSpawner item="jumpTest" triggerDistance="20" respawnTime=" 10" position="100, 0, 0">21 <PickupSpawner item="jumpTest" triggerDistance="20" respawnTime="2" position="100, 0, 0"> 22 22 <attached> 23 23 <Model mesh="sphere.mesh" scale="3.0" />
Note: See TracChangeset
for help on using the changeset viewer.