Changeset 6632 for code/branches/pickup4/data
- Timestamp:
- Mar 29, 2010, 12:30:32 PM (15 years ago)
- Location:
- code/branches/pickup4/data
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup4/data/gui/layouts/PickupInventory.layout
r6417 r6632 1 <?xml version="1.0" encoding="UTF-8" ?> 2 <GUILayout> 3 <Window Type="TaharezLook/FrameWindow" Name="orxonox/Inventory"> 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 <Property Name="Text" Value="Inventory" /> 9 <Property Name="CloseButtonEnabled" Value="False" /> 1 <?xml version="1.0" encoding="UTF-8"?> 10 2 11 <Window Type="TaharezLook/TabControl" Name="orxonox/Inventory/TabControl" > 12 <Property Name="Tooltip" Value="Inventory" /> 13 <Property Name="TabHeight" Value="{0,-1}" /> 3 <GUILayout > 4 <Window Type="DefaultWindow" Name="orxonox/PickupInventory/Background" > 5 <Property Name="InheritsAlpha" Value="False" /> 6 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 7 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 8 <Window Type="TaharezLook/StaticText" Name="orxonox/PickupInventory/PickupInventory" > 9 <Property Name="Text" Value="Pickup Inventory" /> 10 <Property Name="Alpha" Value="0.8" /> 11 <Property Name="InheritsAlpha" Value="False" /> 12 <Property Name="HorzFormatting" Value="HorzCentred" /> 14 13 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 15 <Property Name="TabPanePosition" Value="Bottom" /> 16 <Property Name="UnifiedAreaRect" Value="{{0,10},{0,30},{1,-10},{1,-10}}" /> 17 18 <Window Type="TaharezLook/ScrollablePane" Name="orxonox/Inventory/TabControl/TabEquipment"> 19 <Property Name="Text" Value="Equipment" /> 20 <Property Name="UnifiedPosition" Value="{{0.0,3},{0.0,3}}"/> 21 <Property Name="UnifiedSize" Value="{{1.0,-6},{1.0,-6}}"/> 22 </Window> 23 <Window Type="TaharezLook/ScrollablePane" Name="orxonox/Inventory/TabControl/TabUsable"> 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}}"/> 14 <Property Name="VertFormatting" Value="TopAligned" /> 15 <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.15,0},{0.85,0},{0.8,0}}" /> 16 <Window Type="TaharezLook/StaticText" Name="orxonox/PickupInventory/Wrapper" > 17 <Property Name="TextColours" Value="FF4444FF" /> 18 <Property Name="InheritsAlpha" Value="False" /> 19 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 20 <Property Name="HorzFormatting" Value="HorzCentred" /> 21 <Property Name="VertFormatting" Value="TopAligned" /> 22 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" /> 23 <Window Type="TaharezLook/ScrollablePane" Name="orxonox/PickupInventory/Inventory" > 24 <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" /> 25 <Property Name="HorzStepSize" Value="0.005" /> 26 <Property Name="VertStepSize" Value="0.005" /> 27 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 28 <Property Name="HorzOverlapSize" Value="0.01" /> 29 <Property Name="UnifiedAreaRect" Value="{{0.005,0},{0.01,0},{0.995,0},{0.99,0}}" /> 30 <Property Name="VertOverlapSize" Value="0.01" /> 31 <Property Name="HorzScrollPosition" Value="0" /> 32 <Property Name="VertScrollPosition" Value="0" /> 33 </Window> 27 34 </Window> 28 35 </Window> 29 30 <Event Name="WindowUpdate" Function="PickupInventory.update" /> 36 <Window Type="TaharezLook/Button" Name="orxonox/PickupInventory/InventoryBackButton" > 37 <Property Name="Text" Value="Back" /> 38 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 39 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.8350,0},{0.6,0},{0.8800,0}}" /> 40 <Event Name="Clicked" Function="PickupInventory.InventoryBackButton_clicked"/> 41 </Window> 31 42 </Window> 32 43 </GUILayout> -
code/branches/pickup4/data/gui/scripts/PickupInventory.lua
r6417 r6632 3 3 BasicGUI = require("BasicGUI") 4 4 local P = BasicGUI:new() --inherit everything from the gui package 5 5 6 if _REQUIREDNAME == nil then 6 7 PickupInventory = P … … 12 13 P.layoutString = "PickupInventory.layout" 13 14 14 P.lastEquipmentCount_ = 0 15 P.lastUsableCount_ = 0 16 P.currentUsableID_ = 0 15 function P:init() 16 17 end 17 18 18 -- events 19 function P:frmUpdate(e) 20 local equipCount = orxonox.PickupInventory:getEquipmentCount() 21 local usableCount = orxonox.PickupInventory:getUsableCount() 22 23 if equipCount ~= self.lastEquipmentCount_ or usableCount ~= self.lastUsableCount_ then 24 self:updateTabs() 19 function P:show() 20 self.window:show() -- TODO: Do this through parent... 21 self.visible = true 22 23 carrierList = {} 24 25 -- TODO: Nicer? 26 local pickupManager = orxonox.PickupManager:getInstance() 27 local carrier = pickupManager:getPawn() 28 P.getCarrierList(carrier) 29 30 for k,v in pairs(carrierList) do 31 local args = {} 32 table.insert(args, v) 33 table.insert(args, k) 34 local window = P.createCarrierBox(args) 25 35 end 26 36 end 27 37 28 function P.update(e) 29 loadedGUIs["PickupInventory"]:frmUpdate(e) 30 end 38 function P.getCarrierList(carrier) 31 39 32 function P.itemClicked(e) 33 loadedGUIs["PickupInventory"]:mItemClicked(e) 34 end 35 36 function P:mItemClicked(e) 37 local w = CEGUI.toWindowEventArgs(e).window 38 local name = w:getName() 39 local t = name:sub(25, 27) 40 local i = name:sub(29) 41 42 if t == "equ" then 43 40 -- TODO: Test for nil or 0? 41 if carrier == nil then 42 return 44 43 end 45 46 if t == "use" then 47 if self.currentUsableID_ >= 0 then 48 winMgr:getWindow("orxonox/Inventory/Title/use/" .. self.currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF") 44 45 table.insert(carrierList, carrier) 46 47 local numCarriers = orxonox.PickupManager.getInstance():getNumCarrierChildren(carrier) 48 if numCarriers == 0 then 49 return 50 end 51 52 for i=0,numCarriers-1,1 do 53 local child = orxonox.PickupManager.getInstance():getCarrierChild(i, carrier) 54 if child ~= nil then 55 P.getCarrierList(child) 49 56 end 50 orxonox.PickupInventory:selectUsable(tonumber(i))51 self.currentUsableID_ = tonumber(i)52 winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444")53 57 end 54 58 end 55 59 56 -- methods 57 function P:updateTabs() 58 local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment") 59 local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable") 60 orxonox.PickupInventory:getSingleton():clearInventory(winMgr, eqWin, usWin) 61 orxonox.PickupInventory:getSingleton():updateTabs(winMgr, eqWin, usWin) 60 function P.createCarrierBox(args) 61 local carrier = args[1] 62 local index = args[2] 63 64 local name = "orxonox/PickupInventory/Carrier" .. index 65 local window = winMgr:createWindow("TaharezLook/StaticText", name .. "/Title") 66 window:setText(carrier:getCarrierName()) 67 -- TODO: Does this exist? 68 local height = window:getHeight() 69 70 local box = winMgr:createWindow("TaharezLook/ScrollablePane", name .. "/Box") 71 box:setPosition(CEGUI.UVector2(CEGUI.UDim(0.05, 0), CEGUI.UDim(0, height))) 72 box:setWidth(CEGUI.UDim(0.9, 0)) 73 74 local numPickups = orxonox.PickupManager.getInstance():getNumPickups(carrier) 75 for i=0,numPickups-1,1 do 76 77 end 78 79 return window 80 end 62 81 63 self.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex() 64 self.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount() 65 self.lastUsableCount_ = orxonox.PickupInventory:getUsableCount() 82 function P.InventoryUseButton_clicked(e) 83 84 end 85 86 function P.InventoryDropButton_clicked(e) 87 88 end 89 90 function P.InventoryShowDetails_clicked(e) 91 92 end 93 94 function P.InventoryBackButton_clicked(e) 95 hideGUI("PickupInventory") 66 96 end 67 97 -
code/branches/pickup4/data/gui/scripts/QuestGUI.lua
r6417 r6632 11 11 12 12 function P:show() 13 self.window:show() -- T DO: Do this through parent...13 self.window:show() -- TODO: Do this through parent... 14 14 self.visible = true 15 15 -
code/branches/pickup4/data/overlays/hudtemplates3.oxo
r5980 r6632 101 101 visible = "false" 102 102 /> 103 104 <GUIOverlay 105 name = "PickupInventory" 106 guiname = "PickupInventory" 107 visible = "false" 108 /> 103 109 104 110 </OverlayGroup>
Note: See TracChangeset
for help on using the changeset viewer.