diff options
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/cl_panels.lua | 48 | ||||
| -rw-r--r-- | gamemode/client/cl_inventory.lua | 13 | ||||
| -rw-r--r-- | gamemode/craftablesystem/gunlabs/pistolgunlab.lua | 2 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/deaddroppable.lua | 3 | ||||
| -rw-r--r-- | gamemode/itemsystem/items/medicine.lua | 8 |
5 files changed, 61 insertions, 13 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 diff --git a/gamemode/client/cl_inventory.lua b/gamemode/client/cl_inventory.lua index 73df961..c779384 100644 --- a/gamemode/client/cl_inventory.lua +++ b/gamemode/client/cl_inventory.lua @@ -413,8 +413,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 diff --git a/gamemode/craftablesystem/gunlabs/pistolgunlab.lua b/gamemode/craftablesystem/gunlabs/pistolgunlab.lua index be79a1e..f336599 100644 --- a/gamemode/craftablesystem/gunlabs/pistolgunlab.lua +++ b/gamemode/craftablesystem/gunlabs/pistolgunlab.lua @@ -296,7 +296,7 @@ COMBI.Entity = "gms_pistolgunlab" COMBI.Req = {} COMBI.Req["Platinum Gunslide"] = 1 COMBI.Req["Platinum Gungrip"] = 1 -COMBI.Req["PLatinum Gunbarrel"] = 1 +COMBI.Req["Platinum Gunbarrel"] = 1 COMBI.Req["Platinum Gunmagazine"] = 1 COMBI.Req["Platinum Weapon Scope"] = 1 diff --git a/gamemode/itemsystem/items/deaddroppable.lua b/gamemode/itemsystem/items/deaddroppable.lua index 9278e96..c820f20 100644 --- a/gamemode/itemsystem/items/deaddroppable.lua +++ b/gamemode/itemsystem/items/deaddroppable.lua @@ -42,6 +42,7 @@ local tbl = { {"Resin","Something you can craft with!","items/resin.png"}, {"Rope","Something you can craft with!","items/rope.png"}, {"Salmon","Something you can craft with!","items/salmon.png"}, + {"Saltpetre","Something you can craft with!","items/saltpetre.png"}, {"Sand","How in the world are you holding this stuff?","items/sand.png"}, {"Shark","Something you can craft with!","items/shark.png"}, {"Silver","Something you can craft with!","items/ingot_silver.png"}, @@ -51,7 +52,7 @@ local tbl = { {"Steel Ore","Something you can craft with!","items/ore_steel.png"}, {"Stone","Something you can craft with!","items/stone.png"}, {"Strange Stone","Something you can craft with!","items/sulpher.png"}, - {"Sulpher","Watch out, it's explosive!","items/sulpher.png"}, + {"Sulphur","Watch out, it's explosive!","items/sulphur.png"}, {"Teak","You've got wood.","items/wood_teak.png"}, {"Tech","You're blinded by SCIENCE!","items/ingot_tech.png"}, {"Tech Ore","Something you can craft with!","items/ore_tech.png"}, diff --git a/gamemode/itemsystem/items/medicine.lua b/gamemode/itemsystem/items/medicine.lua index 1281883..405188d 100644 --- a/gamemode/itemsystem/items/medicine.lua +++ b/gamemode/itemsystem/items/medicine.lua @@ -11,14 +11,14 @@ if(SERVER) then end local client_use = function() - net.Start("gms_eatberry") + net.Start("gms_usemedicine") net.SendToServer() end local finisheduseing = function(player) - self.Owner:DecResource( "Medicine", 1 ) - self.Owner:SendMessage( "You're feeling a bit better now.", 3, Color( 10, 200, 10, 255 ) ) - self.Owner:Heal( 10 ) + player:DecResource( "Medicine", 1 ) + player:SendMessage( "You're feeling a bit better now.", 3, Color( 10, 200, 10, 255 ) ) + player:Heal( 10 ) end local use_medicine = function(ln, player) |
