forked from wrldspawn/Themer
Add skin switching support
This commit is contained in:
parent
62c495721d
commit
17f60b8af5
BIN
icon.jpg
BIN
icon.jpg
Binary file not shown.
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 48 KiB |
@ -9,6 +9,7 @@ Info: This file loads everything and contains the main code of stuff
|
||||
--cvars
|
||||
local themer_enabled = CreateClientConVar("themer_enabled", "1", true)
|
||||
local derma_skinname = CreateClientConVar("derma_skinname", "gmoddefault", true)
|
||||
local themer_skin = CreateClientConVar("themer_skin", "themer", true)
|
||||
|
||||
local themer_tweaks_uselabel = CreateClientConVar("themer_tweaks_uselabel", "1", true)
|
||||
local themer_options_gear = CreateClientConVar("themer_options_gear", "0", true)
|
||||
@ -40,10 +41,10 @@ local function ColorHack()
|
||||
end
|
||||
|
||||
hook.Add("ForceDermaSkin","Themer",function()
|
||||
if themer_enabled:GetBool() then return "themer" end
|
||||
if themer_enabled:GetBool() then return themer_skin:GetString() or "themer" end
|
||||
end)
|
||||
concommand.Add("themer_refresh_derma",function()
|
||||
include("skins/themer.lua")
|
||||
--include("skins/themer.lua")
|
||||
derma.RefreshSkins()
|
||||
ColorHack()
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
local themer_enabled = GetConVar("themer_enabled")
|
||||
local derma_skinname = GetConVar("derma_skinname")
|
||||
local themer_skin = GetConVar("themer_skin")
|
||||
|
||||
local themer_tweaks_uselabel = GetConVar("themer_tweaks_uselabel")
|
||||
local themer_options_gear = GetConVar("themer_options_gear")
|
||||
@ -36,14 +37,22 @@ All changes require applying changes.]])
|
||||
files[f] = true
|
||||
end
|
||||
|
||||
local list = panel:ComboBox("Skin:","derma_skinname")
|
||||
local filelist = panel:ComboBox("Skin Image:","derma_skinname")
|
||||
for f,_ in pairs(files) do
|
||||
list:AddChoice(f)
|
||||
filelist:AddChoice(f)
|
||||
end
|
||||
|
||||
local reload = panel:Button("Refresh List")
|
||||
panel:Help([[Alternatively, you can select a full built skin, which may have other features or better compatibiliy.]])
|
||||
|
||||
local skinlist = panel:ComboBox("Skin:","themer_skin")
|
||||
for f,_ in pairs(derma.SkinList) do
|
||||
skinlist:AddChoice(f)
|
||||
end
|
||||
|
||||
local reload = panel:Button("Refresh Lists")
|
||||
reload.DoClick = function(s)
|
||||
list:Clear()
|
||||
filelist:Clear()
|
||||
skinlist:Clear()
|
||||
files = {}
|
||||
|
||||
for _,f in pairs(file.Find("materials/gwenskin/*.png","GAME")) do
|
||||
@ -56,7 +65,11 @@ All changes require applying changes.]])
|
||||
end
|
||||
|
||||
for f,_ in pairs(files) do
|
||||
list:AddChoice(f)
|
||||
filelist:AddChoice(f)
|
||||
end
|
||||
|
||||
for f,_ in pairs(derma.SkinList) do
|
||||
skinlist:AddChoice(f)
|
||||
end
|
||||
end
|
||||
reload:SetIcon("icon16/arrow_refresh.png")
|
||||
|
Loading…
Reference in New Issue
Block a user