summaryrefslogtreecommitdiff
path: root/gamemode/client/cl_inventory.lua
blob: 9e1804069bcee75e91cd90d34ab935ad1aefbd79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
print("Custom inventory loaded")

local function createPanel()
  local frame = vgui.Create( "DFrame" )
  frame:SetSize( 300, 300 )
  frame:SetTitle( "Inventory" )
  frame:MakePopup()
  frame:Center()

  local layout = vgui.Create( "DTileLayout", frame )
  layout:SetBaseSize( 32 ) -- Tile size
  layout:Dock( FILL )

  //Draw a background so we can see what it's doing
  --layout:SetDrawBackground( true )
  --layout:SetBackgroundColor( Color( 0, 100, 100 ) )

  layout:MakeDroppable( "unique_name" ) -- Allows us to rearrange children
  for k, v in SortedPairs( Resources ) do
    layout:Add( Label( v .. k) )
  end
  /*
  for i = 1, 32 do
  	layout:Add( Label( " Label " .. i ) )
  end
  */
end

local invpanel = nil
function GM:OnSpawnMenuOpen()
  print("Spawn menu hooked correctly")
  if(invpanel == nil) then
    invpanel = createPanel()
  end
end

function GM:OnSpawnMenuClose()

end

function GM:SpawnMenuEnabled()
	return false
end