From b676208c9f1e97375564eacd23713a6f0f76f7be Mon Sep 17 00:00:00 2001 From: Scott Date: Sun, 8 May 2016 18:11:45 -0400 Subject: Added images to combimenus, fixed image typos, added saltpetre --- gamemode/client/cl_inventory.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gamemode/client/cl_inventory.lua') diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 1e69ec7..5c394e6 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -409,8 +409,17 @@ function PANEL:Init() // for some reason has stone twice? v for j,k in SortedPairs(v.Results) do if (j != "Stone") then - icon = GMS.GetResourceByName(j).Icon - if (icon != nil && icon != "test.png") then img:SetImage(icon) else img:SetImage("vgui/avatar_default") end + if(GMS.Resources[j] == nil) then --This resource is not registered! + img:SetImage("vgui/avatar_default") + print("Resource:" .. j .. " not registed! This might be a bug!") + continue + elseif(GMS.Resources[j].Icon == nil) then + img:SetImage("vgui/avatar_default") + print("Resource:" .. j .. " does not have an .Icon field! This might be a bug!") + continue + else + img:SetImage(GMS.Resources[j].Icon) + end end end -- cgit v1.2.3-70-g09d2