Permalink
Browse files

Fix derma.SkinTexture

Not sure what this function is for, but it should be functioning either way.
  • Loading branch information...
1 parent 102bd2c commit db07041ca47a5be3e78dd7651a77e3c467a20627 @robotboy655 robotboy655 committed May 19, 2014
Showing with 13 additions and 14 deletions.
  1. +13 −14 garrysmod/lua/derma/derma.lua
@@ -208,33 +208,32 @@ end
--[[---------------------------------------------------------
- SkinTexture( strName )
+ SkinTexture( strName, panel, default )
-----------------------------------------------------------]]
-function SkinTexture( strName )
+function SkinTexture( strName, panel, default )
local Skin = panel:GetSkin()
- if ( !Skin ) then return end
- local Textures = Skin.Textures
- if ( !Textures ) then return end
+ if ( !Skin ) then return default end
+
+ local Textures = Skin.tex
+
+ if ( !Textures ) then return default end
- return Textures[ strName ]
+ return Textures[ strName ] or default
end
--[[---------------------------------------------------------
- SkinHook( strType, strName, panel )
+ Color( strName, panel, default )
-----------------------------------------------------------]]
function Color( strName, panel, default )
local Skin = panel:GetSkin()
- if ( !Skin ) then return end
- local color = Skin[ strName ]
-
- if ( !color ) then return default end
-
- return color
+ if ( !Skin ) then return default end
+
+ return Skin[ strName ] or default
end
@@ -250,4 +249,4 @@ end
-----------------------------------------------------------]]
function RefreshSkins()
iSkinChangeIndex = iSkinChangeIndex + 1
-end
+end

0 comments on commit db07041

Please sign in to comment.