summaryrefslogtreecommitdiff
path: root/gamemode/cl_panels.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/cl_panels.lua')
-rw-r--r--gamemode/cl_panels.lua48
1 files changed, 43 insertions, 5 deletions
diff --git a/gamemode/cl_panels.lua b/gamemode/cl_panels.lua
index 43e133a..33f32e5 100644
--- a/gamemode/cl_panels.lua
+++ b/gamemode/cl_panels.lua
@@ -925,8 +925,8 @@ function PANEL:Paint( w, h )
surface.SetDrawColor( 200, 200, 200, 255 )
//surface.DrawRect( 0, 0, self:GetWide(), self:GetTall() )*/
- surface.SetMaterial( self.BGTexID )
- surface.DrawTexturedRect( -( 128 - w ) / 2, -( 128 - h ) / 2, 128, 128 )
+ //surface.SetMaterial( self.BGTexID )
+ //surface.DrawTexturedRect( -( 128 - w ) / 2, -( 128 - h ) / 2, 128, 128 )
surface.SetDrawColor( StrandedBorderColor )
surface.DrawOutlinedRect( 0, 0, self:GetWide(), self:GetTall() )
@@ -955,8 +955,8 @@ function PANEL:Paint( w, h )
surface.SetDrawColor( 255, 255, 255, 255 )
- surface.SetMaterial( self.TexID )
- surface.DrawTexturedRect( -( 128 - w ) / 2, -( 128 - h ) / 2, 128, 128 )
+ //surface.SetMaterial( self.TexID )
+ //surface.DrawTexturedRect( -( 128 - w ) / 2, -( 128 - h ) / 2, 128, 128 )
local y = self:GetTall() / 2 + self:GetTall() / 4
draw.SimpleTextOutlined( self.CombiTable.Name, "DefaultSmall", self:GetWide() / 2, y, Color( 255, 255, 255, 255 ), 1, 1, 0.5, Color( 100, 100, 100, 140 ) )
@@ -965,7 +965,45 @@ function PANEL:Paint( w, h )
end
function PANEL:SetInfo( name, tbl )
- if ( tbl.Texture && Material( tbl.Texture ) ) then self.TexID = Material( tbl.Texture ) end
+ //if ( tbl.Texture && Material( tbl.Texture ) ) then self.TexID = Material( tbl.Texture ) end
+
+ local img = vgui.Create("DImage", self)
+ img:SetPos(20, 10)
+ img:SetSize(self:GetWide()-40, self:GetTall()-40)
+ img:SetImage("vgui/avatar_default")
+ PrintTable(tbl)
+ if (tbl.Results != nil) then
+
+ for k,v in pairs(tbl.Results) do
+ if(GMS.Resources[k] == nil) then --This resource is not registered!
+ img:SetImage("vgui/avatar_default")
+ print("Resource:" .. k .. " not registed! This might be a bug!")
+ continue
+ elseif(GMS.Resources[k].Icon == nil) then
+ img:SetImage("vgui/avatar_default")
+ print("Resource:" .. k .. " does not have an .Icon field! This might be a bug!")
+ continue
+ else
+ img:SetImage(GMS.Resources[k].Icon)
+ end
+
+ end
+
+ elseif (tbl.FoodValue != nil) then
+ img:SetPos(0, 0)
+ img:SetSize(self:GetSize())
+ img:SetImage("items/gms_none.png")
+
+ else
+
+ img:SetPos(0, -10)
+ img:SetSize(self:GetSize())
+ img:SetImage("items/gms_weapon.png")
+
+ end
+
+ //if (GMS.GetResourceByName(name).Icon != nil) then img:SetImage(GMS.GetResourceByName(name).Icon) else img:SetImage("vgui/avatar_default") end
+
self.Combi = name
self.CombiTable = tbl
end