diff options
Diffstat (limited to 'gamemode/client/cl_inventory.lua')
| -rw-r--r-- | gamemode/client/cl_inventory.lua | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 7578609..30dd74c 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -9,6 +9,8 @@ local invxsize = (scrx*0.40)-invxadj-38 --no idea why the 38 works, but it does local invysize = scry local function createMenuFor(menu, tbl) + print("Createing actions for:") + PrintTable(tbl) for k,v in pairs(tbl) do if(isfunction(v)) then --This is a dead-end, add the menu local thisoption = menu:AddOption(k,v) @@ -38,6 +40,10 @@ local function createPanel() local invtab = vgui.Create("DPanel",tabsheet) tabsheet:AddSheet( "Inventory", invtab, "icon16/database.png" ) + local structtab = vgui.Create("DPanel",tabsheet) + tabsheet:AddSheet( "Structures", structtab, "icon16/bullet_blue.png") + local combitab = vgui.Create("DPanel",tabsheet) + tabsheet:AddSheet( "Combinations", combitab, "icon16/bullet_picture.png") local equiptab = vgui.Create("DPanel",tabsheet) tabsheet:AddSheet( "Equipment", equiptab, "icon16/user.png" ) local proptab = vgui.Create("DPanel",tabsheet) @@ -47,14 +53,47 @@ local function createPanel() tabsheet:AddSheet("Admin", admintab, "icon16/bullet_star.png") end - --Inventory + --Combinations in the combinations button + local layout = vgui.Create( "DTileLayout", combitab) + layout:SetBaseSize( 64 ) -- Tile size + layout:Dock( FILL ) + layout:MakeDroppable( "unique_name" ) -- Allows us to rearrange children + for k,v in pairs(GMS.Combinations["Combinations"]) do + print("Combinator a " .. v.Name) + local combipanel = vgui.Create("DButton", layout) + combipanel:SetSize(64,64) + combipanel:SetText(v.Name) + combipanel.DoClick = function() + print("I want to combine a " .. v.Name) + LocalPlayer():ConCommand("gms_MakeCombination Combinations " .. v.Name) + end + layout:Add(combipanel) + end + --Structure building + local layout = vgui.Create( "DTileLayout", structtab) + layout:SetBaseSize( 64 ) -- Tile size + layout:Dock( FILL ) + layout:MakeDroppable( "unique_name" ) -- Allows us to rearrange children + for k,v in pairs(GMS.Combinations["Structures"]) do + --print("Createing panel for " .. v.BuildSiteModel) + local modelPanel = vgui.Create( "DModelPanel", layout ) + --modelPanel:SetPos( 0, 0 ) + modelPanel:SetSize( 64, 64 ) + modelPanel:SetModel( v.BuildSiteModel ) + modelPanel.DoClick = function() + print("I want to construct a " .. k) + LocalPlayer():ConCommand("gms_MakeCombination Structures " .. k ) + end + layout:Add(modelPanel) + end + + --Inventory local layout = vgui.Create( "DTileLayout", invtab ) layout:SetBaseSize( 64 ) -- Tile size layout:Dock( FILL ) layout:MakeDroppable( "unique_name" ) -- Allows us to rearrange children - PrintTable(Resources) for k, v in SortedPairs( Resources ) do if(v == 0) then continue @@ -83,6 +122,8 @@ local function createPanel() return end local menu = vgui.Create("DMenu") + print("makeing menu for " .. k) + PrintTable(GMS.Resources[k]) createMenuFor(menu,GMS.Resources[k].Actions) menu:Open() end |
