more color fixes, force them

This commit is contained in:
worldspawn 2021-01-23 16:02:49 -07:00
parent d7b553ea9d
commit 2124e64dd1
2 changed files with 42 additions and 27 deletions

View File

@ -11,7 +11,6 @@ local themer_enabled = CreateClientConVar("themer_enabled", "1",
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)
local themer_spawnlist_icons = CreateClientConVar("themer_spawnlist_icons", "0", true)
@ -41,7 +40,7 @@ end
--Main loading
local function ColorHack()
local DMenuOption = table.Copy(vgui.GetControlTable("DMenuOption"))
if themer_tweaks_uselabel:GetBool() then
local DComboBox = table.Copy(vgui.GetControlTable("DComboBox"))
DMenuOption.Init = function(self)
self:SetContentAlignment(4)
self:SetTextInset(30,0)
@ -49,10 +48,31 @@ local function ColorHack()
self:SetChecked(false)
end
DMenuOption.UpdateColours = function(self, skin)
if self:IsHovered() then
self:SetTextColor(skin.Colours.Label.Bright)
return self:SetTextStyleColor(skin.Colours.Label.Bright)
end
self:SetTextColor(skin.Colours.Label.Dark)
return self:SetTextStyleColor(skin.Colours.Label.Dark)
end
derma.DefineControl( "DMenuOption", "Menu Option Line", DMenuOption, "DButton" )
derma.DefineControl( "DMenuOptionCVar", "", vgui.GetControlTable("DMenuOptionCVar"), "DMenuOption" )
DComboBox.UpdateColours = function(self, skin)
if self.Depressed or self:IsMenuOpen() then
self:SetTextColor(skin.Colours.Label.Bright)
return self:SetTextStyleColor(skin.Colours.Label.Bright)
end
self:SetTextColor(skin.Colours.Label.Dark)
return self:SetTextStyleColor(skin.Colours.Label.Dark)
end
derma.DefineControl( "DComboBox", "", DComboBox, "DButton" )
local DProperties = table.Copy(vgui.GetControlTable("DProperties"))
local tblCategory = getupvalues(DProperties.GetCategory).tblCategory
DProperties.GetCategory = function(self, name, bCreate)
@ -74,6 +94,16 @@ local function ColorHack()
end
derma.DefineControl("DProperties", "", DProperties, "Panel")
local DTree_Node_Button = table.Copy(vgui.GetControlTable("DTree_Node_Button"))
DTree_Node_Button.UpdateColours = function(self, skin)
-- m_bSelectable is false on this for some reason
if self.m_bSelected then return self:SetTextStyleColor( skin.Colours.Tree.Selected ) end
if self.Hovered then return self:SetTextStyleColor( skin.Colours.Tree.Hover ) end
return self:SetTextStyleColor( skin.Colours.Tree.Normal )
end
derma.DefineControl( "DTree_Node_Button", "Tree Node Button", DTree_Node_Button, "DButton" )
end
hook.Add("ForceDermaSkin","Themer",function()

View File

@ -49,8 +49,8 @@ All changes require applying changes.]])
skinlist:AddChoice(f)
end
local reload = panel:Button("Refresh Lists")
reload.DoClick = function(s)
local refresh = panel:Button("Refresh Lists")
refresh.DoClick = function(s)
filelist:Clear()
skinlist:Clear()
files = {}
@ -72,7 +72,7 @@ All changes require applying changes.]])
skinlist:AddChoice(f)
end
end
reload:SetIcon("icon16/arrow_refresh.png")
refresh:SetIcon("icon16/arrow_refresh.png")
local reload = panel:Button("Reload Spawnmenu","spawnmenu_reload")
reload:SetTooltip("Only do this if you really have to, as in things aren't updating.")
@ -82,14 +82,6 @@ All changes require applying changes.]])
apply:SetIcon("icon16/tick.png")
end
local function Tweaks(panel)
panel:Help([[Here you can tweak various settings to match the theme.
Things like text entries and options in menus don't have their own color setting within the image file, so you can set them here.]])
panel:CheckBox("Use Label Color for Text Entry and Menu Options","themer_tweaks_uselabel")
panel:ControlHelp("(requires theme reapplication)")
end
local function IconSettings(panel)
panel:Help([[Why only be limited to just the theme? Here you can set icons for spawnmenu tabs and such.
@ -163,7 +155,6 @@ end
hook.Add("PopulateToolMenu","Themer.ToolMenu",function()
spawnmenu.AddToolMenuOption("Theming","Theming","\1Theme Options","Theme Options","","",MakeMenu)
spawnmenu.AddToolMenuOption("Theming","Configuration","Finer Tweaking","Finer Tweaking","","",Tweaks)
spawnmenu.AddToolMenuOption("Theming","Configuration","Icons","Icons","","",IconSettings)
spawnmenu.AddToolMenuOption("Theming","Misc","About","About","","",About)
@ -192,12 +183,6 @@ local function ExtSettings()
main:SetName("Theme Options")
tabs:AddSheet("Theme Options",main,"icon16/palette.png")
--Tweaks--
local tweaks = vgui.Create("DForm",tabs)
Tweaks(tweaks)
tweaks:SetName("Finer Tweaks")
tabs:AddSheet("Finer Tweaks",tweaks,"icon16/wrench.png")
--Icons--
local icons = vgui.Create("DForm",tabs)
IconSettings(icons)