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 |
@ -8,7 +8,8 @@ Info: This file loads everything and contains the main code of stuff
|
|||||||
|
|
||||||
--cvars
|
--cvars
|
||||||
local themer_enabled = CreateClientConVar("themer_enabled", "1", true)
|
local themer_enabled = CreateClientConVar("themer_enabled", "1", true)
|
||||||
local derma_skinname = CreateClientConVar("derma_skinname", "gmoddefault", 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_tweaks_uselabel = CreateClientConVar("themer_tweaks_uselabel", "1", true)
|
||||||
local themer_options_gear = CreateClientConVar("themer_options_gear", "0", true)
|
local themer_options_gear = CreateClientConVar("themer_options_gear", "0", true)
|
||||||
@ -40,10 +41,10 @@ local function ColorHack()
|
|||||||
end
|
end
|
||||||
|
|
||||||
hook.Add("ForceDermaSkin","Themer",function()
|
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)
|
end)
|
||||||
concommand.Add("themer_refresh_derma",function()
|
concommand.Add("themer_refresh_derma",function()
|
||||||
include("skins/themer.lua")
|
--include("skins/themer.lua")
|
||||||
derma.RefreshSkins()
|
derma.RefreshSkins()
|
||||||
ColorHack()
|
ColorHack()
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local themer_enabled = GetConVar("themer_enabled")
|
local themer_enabled = GetConVar("themer_enabled")
|
||||||
local derma_skinname = GetConVar("derma_skinname")
|
local derma_skinname = GetConVar("derma_skinname")
|
||||||
|
local themer_skin = GetConVar("themer_skin")
|
||||||
|
|
||||||
local themer_tweaks_uselabel = GetConVar("themer_tweaks_uselabel")
|
local themer_tweaks_uselabel = GetConVar("themer_tweaks_uselabel")
|
||||||
local themer_options_gear = GetConVar("themer_options_gear")
|
local themer_options_gear = GetConVar("themer_options_gear")
|
||||||
@ -36,14 +37,22 @@ All changes require applying changes.]])
|
|||||||
files[f] = true
|
files[f] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local list = panel:ComboBox("Skin:","derma_skinname")
|
local filelist = panel:ComboBox("Skin Image:","derma_skinname")
|
||||||
for f,_ in pairs(files) do
|
for f,_ in pairs(files) do
|
||||||
list:AddChoice(f)
|
filelist:AddChoice(f)
|
||||||
end
|
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)
|
reload.DoClick = function(s)
|
||||||
list:Clear()
|
filelist:Clear()
|
||||||
|
skinlist:Clear()
|
||||||
files = {}
|
files = {}
|
||||||
|
|
||||||
for _,f in pairs(file.Find("materials/gwenskin/*.png","GAME")) do
|
for _,f in pairs(file.Find("materials/gwenskin/*.png","GAME")) do
|
||||||
@ -56,7 +65,11 @@ All changes require applying changes.]])
|
|||||||
end
|
end
|
||||||
|
|
||||||
for f,_ in pairs(files) do
|
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
|
||||||
end
|
end
|
||||||
reload:SetIcon("icon16/arrow_refresh.png")
|
reload:SetIcon("icon16/arrow_refresh.png")
|
||||||
|
Loading…
Reference in New Issue
Block a user