summaryrefslogtreecommitdiff
path: root/gamemode/cl_panels.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-04-16 22:30:18 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-04-16 22:30:18 -0400
commitc3bec1047513b8c19eb24fef5f3230486dd17cbd (patch)
tree1e20bdf27b743ad4c10553060ac538967f780d41 /gamemode/cl_panels.lua
parentb16a5f74fc68b34c42c4c201a3f3e1030928bc81 (diff)
downloadgmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.tar.gz
gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.tar.bz2
gmstranded-c3bec1047513b8c19eb24fef5f3230486dd17cbd.zip
Fixed most recepies not showing up in the structures menu
Diffstat (limited to 'gamemode/cl_panels.lua')
-rw-r--r--gamemode/cl_panels.lua42
1 files changed, 27 insertions, 15 deletions
diff --git a/gamemode/cl_panels.lua b/gamemode/cl_panels.lua
index da01d3c..215f7d9 100644
--- a/gamemode/cl_panels.lua
+++ b/gamemode/cl_panels.lua
@@ -1,5 +1,5 @@
-surface.CreateFont( "DefaultBold", {
+surface.CreateFont( "DefaultBold", {
font = "Tahoma",
size = 16,
weight = 1000,
@@ -7,7 +7,7 @@ surface.CreateFont( "DefaultBold", {
additive = false
} )
-surface.CreateFont( "GMSUnlockDescription", {
+surface.CreateFont( "GMSUnlockDescription", {
font = "Tahoma",
size = 14,
weight = 500,
@@ -209,7 +209,7 @@ function PANEL:Paint()
surface.DrawLine( self:GetWide() - 1, 0, self:GetWide() - 1, self:GetTall() ) -- Nice line instead of messy outlined rect
surface.DrawLine( 0, self:GetTall() - 1, self:GetWide(), self:GetTall() - 1 )
surface.DrawLine( 0, 0, 0, self:GetTall() )
- if ( self.Extended ) then
+ if ( self.Extended ) then
surface.DrawLine( 0, 33, self:GetWide(), 33 )
end
@@ -236,8 +236,8 @@ function PANEL:RefreshSkills()
if ( !self.Extended ) then lbl:SetVisible( false ) end
end
- if ( self.Extended ) then
- self:SetSize( ScrW() / 6, 40 + ( table.Count( self.SkillLabels ) * 21 ) )
+ if ( self.Extended ) then
+ self:SetSize( ScrW() / 6, 40 + ( table.Count( self.SkillLabels ) * 21 ) )
end
end
@@ -351,9 +351,9 @@ function PANEL:RefreshResources()
if ( !self.Extended ) then lbl:SetVisible( false ) end
end
end
-
+
self.Line = self.Line + 21
-
+
local lblT = vgui.Create( "gms_ResourcePanelTotal", self )
lblT:SetPos( 0, self.Line )
lblT:SetSize( self:GetWide(), 16 )
@@ -362,10 +362,10 @@ function PANEL:RefreshResources()
table.insert( self.ResourceLabels, lblT )
if ( !self.Extended ) then lblT:SetVisible( false ) end
- if ( self.Extended ) then
- self:SetSize( ScrW() / 6, 40 + ( ( table.Count( self.ResourceLabels ) + 1 ) * 21 ) )
+ if ( self.Extended ) then
+ self:SetSize( ScrW() / 6, 40 + ( ( table.Count( self.ResourceLabels ) + 1 ) * 21 ) )
end
-
+
if ( GAMEMODE.CommandsHud ) then GAMEMODE.CommandsHud:SetPos( ScrW() / 6 + 2, self:GetTall() ) end
end
@@ -602,8 +602,8 @@ function PANEL:RefreshCommands()
local line7b = self:CreateButton( halfsize, self.Line, threesize, 16, "gms_tribes", "Join", Color( 200, 0, 200, 176 ) )
local line7c = self:CreateButton( halfsize + threesize, self.Line, threesize, 16, "gms_leave", "Leave", Color( 200, 0, 200, 176 ) )
- if ( self.Extended ) then
- self:SetSize( ScrW() / 6, 40 + ( self.Lines * 21 ) )
+ if ( self.Extended ) then
+ self:SetSize( ScrW() / 6, 40 + ( self.Lines * 21 ) )
end
end
@@ -848,9 +848,21 @@ function PANEL:Init()
end
function PANEL:SetTable( str )
+ --print("GMS.Combinations full:")
+ --PrintTable(GMS.Combinations)
+ print("----SetTable method-----")
+ for k,v in pairs(GMS.Combinations) do
+ print("Recognize " .. k)
+ if(k == "Structures") then
+ for i,j in pairs(v) do
+ print("\tFound: " .. i)
+ end
+ end
+ end
self:SetTitle( "#" .. str )
self.CombiGroupName = str
self.CombiGroup = GMS.Combinations[ str ]
+
self:Clear()
for name, tbl in SortedPairs( self.CombiGroup or {} ) do
local icon = vgui.Create( "GMS_CombiIcon", self.CombiList )
@@ -872,7 +884,7 @@ function PANEL:SetActive( combi, tbl )
if ( tbl.Req or tbl.SkillReq ) then
desc = desc .. "\n\nYou need:"
end
-
+
if ( tbl.Req and table.Count( tbl.Req ) > 0 ) then
for res, num in pairs( tbl.Req ) do
if ( tbl.AllSmelt ) then
@@ -898,7 +910,7 @@ end
function PANEL:ClearActive()
self.ActiveCombi = nil
- self.ActiveTable = nil
+ self.ActiveTable = nil
self.Info.NameLabel:SetText( "Select a recipe" )
self.Info.DescLabel:SetText( "" )
end
@@ -1155,4 +1167,4 @@ function PANEL:SetRes( str, num, isAll )
self.IsAll = isAll
end
-vgui.Register( "gms_StoreButton", PANEL, "DButton" ) \ No newline at end of file
+vgui.Register( "gms_StoreButton", PANEL, "DButton" )