From 8947791ae22821974a02d34eeca73eca43cde9bd Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 1 May 2016 11:29:11 -0400 Subject: Changed player-made items to require proper versions of their resources --- gamemode/client/cl_inventory.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gamemode/client') diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 30dd74c..815d0d9 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -21,6 +21,14 @@ local function createMenuFor(menu, tbl) end end +local function createTooltipTextFor(tbl) + local string = "" + for k,v in pairs(tbl) do + string = string .. (k .. " x" .. v .. "\n") + end + return string +end + local function createPanel() local frame = vgui.Create( "DFrame" ) frame:SetSize( invxsize, invysize ) @@ -59,10 +67,11 @@ local function createPanel() 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) + PrintTable(v) local combipanel = vgui.Create("DButton", layout) combipanel:SetSize(64,64) combipanel:SetText(v.Name) + combipanel:SetTooltip(createTooltipTextFor(v.Req)) combipanel.DoClick = function() print("I want to combine a " .. v.Name) LocalPlayer():ConCommand("gms_MakeCombination Combinations " .. v.Name) -- cgit v1.2.3-70-g09d2