Trying to fix a derma skin.

**Hi, I am fairly new to derma and I found this skin. When I use Panel.SetSkin on my Derma frame I get no errors, yet derma stays as default. I’m not really sure what has went wrong any help is appricated.

Thanks.**

**cl_vindows.lua | In lua/autorun/client **



local function msg(txt)
	Msg("[VINDOWS] ")
	print(txt)
end
msg("Initialized.")
function derma.ApplySkin(skinname)
	vgui.GetWorldPanel():SetSkin(skinname)
end
local SKIN = {}
function SKIN:PaintFrame( pan)
	local pan=pan
	surface.SetDrawColor(192,192,192,255)
	local w,h=pan:GetSize()
	surface.DrawRect(0,0,w,h)
	surface.SetDrawColor(0,0,128,255)
	surface.DrawRect(0,0,w,23)
end
function SKIN:PaintButton(btn,isgrip)
	if(btn.m_Image) then return end
	local w,h=btn:GetSize()
	btn.m_colText=Color(0,0,0)
	surface.SetDrawColor(192,192,192,255)
	surface.DrawRect(0,0,w,h)
	if(btn.Depressed and not isgrip) then
		surface.SetDrawColor(0,0,0,255)
		surface.DrawLine(0,0,0,h)
		surface.DrawLine(0,0,w,0)
		surface.SetDrawColor(255,255,255,255)
		surface.DrawLine(0,h-1,w,h-1)
		surface.DrawLine(w-1,0,w-1,h)
	else
		surface.SetDrawColor(255,255,255,255)
		surface.DrawLine(0,0,0,h)
		surface.DrawLine(0,0,w,0)
		surface.SetDrawColor(0,0,0,255)
		surface.DrawLine(0,h-1,w,h-1)
		surface.DrawLine(w-1,0,w-1,h)
	end
	if(not btn.m_Image and not isgrip) then
		btn:SetColor(Color(0,0,0))
	end
end
function SKIN:PaintListViewLine(line)
	if(line.m_bSelected) then
		surface.SetDrawColor(0,0,126,255)
	end
	surface.DrawRect(0,0,line:GetSize())
end
function SKIN:PaintListView(lv)
	surface.SetDrawColor(255,255,255,255)
	surface.DrawRect(0,0,lv:GetSize())
end
function SKIN:PaintListViewLabel(lbl)
	surface.SetTextColor(0,0,0,255)
	surface.SetFont("Default")
	surface.SetTextPos(0,0)
	surface.DrawText(lbl:GetText())
	return true
end
function SKIN:PaintSysButton(btn)
	btn:SetColor(Color(0,0,0))
	SKIN:PaintButton(btn)
end
function SKIN:PaintVScrollBar(scb)
	surface.SetDrawColor(192,192,192,255)
	surface.DrawRect(0,0,scb:GetSize())
end
function SKIN:PaintScrollBarGrip(grip)
	SKIN:PaintButton(grip,true)
end
function SKIN:PaintTab(tab)
	SKIN:PaintButton(tab,true)
end
function SKIN:PaintCheckBox(chkbx)
	local w,h=chkbx:GetSize()
	surface.SetDrawColor(255,255,255,255)
	surface.DrawRect(0,0,w,h)
	surface.SetDrawColor(0,0,0,255)
	surface.DrawLine(0,0,0,h)
	surface.DrawLine(0,0,w,0)
	surface.SetDrawColor(255,255,255,255)
	surface.DrawLine(0,h-1,w,h-1)
	surface.DrawLine(w-1,0,w-1,h)
	--print("aliens")
end
function SKIN:PaintNumSlider(slider)
	local w,h=slider:GetSize()
	surface.SetDrawColor(0,0,0,255)
	surface.DrawLine(0,h/2,w,h/2)
end
vgui.GetWorldPanel():SetSkin("Default")
derma.DefineSkin( "vindows", "Test", SKIN )
local cv=CreateClientConVar("vindows_dermaskin_enabled",1,true,false)
if(cv:GetBool()) then derma.ApplySkin("vindows") msg("Applied skin") end
cvars.AddChangeCallback("vindows_dermaskin_enabled",function(_,_,v)
	if(tonumber(v)==0) then
		derma.ApplySkin("Default")
		msg("Deapplied skin")
	else
		derma.ApplySkin("vindows")
		msg("Applied skin")
	end
end)


**vindowsskin.lua | In lua/menu_plugins **



include("autorun/client/cl_vindows.lua")



Return your skin name with

GM:ForceDermaSkin if you want every panel created to use that skin in particular. If you want the skin to apply on certain panels only, use

Panel:SetSkin

Yeah, I did that. It did not load the skin. No errors.