diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-08 19:50:07 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-05-08 19:50:07 -0400 |
| commit | f529fc47c87ce254aad2c0506259b9d7521d3512 (patch) | |
| tree | ba832069036110de65e4a69a95241a299a6da9a2 /gamemode/cl_panels.lua | |
| parent | 232ee552f30a37d1b0080f4aa4de43d7639971a5 (diff) | |
| parent | 5a7639b486aa9f672813fec32510e57a554d750b (diff) | |
| download | gmstranded-f529fc47c87ce254aad2c0506259b9d7521d3512.tar.gz gmstranded-f529fc47c87ce254aad2c0506259b9d7521d3512.tar.bz2 gmstranded-f529fc47c87ce254aad2c0506259b9d7521d3512.zip | |
Merge branch 'master' of ssh://cogarr.net:43/home/git/gmstranded
Diffstat (limited to 'gamemode/cl_panels.lua')
| -rw-r--r-- | gamemode/cl_panels.lua | 48 |
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 |
