better color fixes

This commit is contained in:
worldspawn 2019-05-19 13:42:09 -06:00
parent 3cade4af50
commit 071a5a7165
7 changed files with 296 additions and 330 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
themer.gma

View File

@ -1,2 +1,3 @@
# [Themer](https://steamcommunity.com/sharedfiles/filedetails/?id=938347376)
A tool to make derma skin application easier.
Themer is a utility to replace derma themes on the fly without overwriting files.

View File

@ -1,6 +1,6 @@
{
"description": "A tool to make derma skin application easier.",
"ignore": ["*.psd", ".git/*", "icon.jpg", "themer.gma"],
"ignore": ["*.psd", ".git/*", ".gitignore", "icon.jpg", "themer.gma"],
"logo": "icon.jpg",
"tags": ["build", "scenic"],
"title": "Themer",

BIN
icon.jpg

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
include'themer/iconbrowser.lua'
include'themer/spawnmenu.lua'
include("themer/iconbrowser.lua")
include("themer/spawnmenu.lua")
--[[
File: themer/main.lua
@ -7,8 +7,8 @@ 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_enabled = CreateClientConVar("themer_enabled", "1", true)
local derma_skinname = CreateClientConVar("derma_skinname", "gmoddefault", true)
local themer_tweaks_uselabel = CreateClientConVar("themer_tweaks_uselabel", "1", true)
local themer_options_gear = CreateClientConVar("themer_options_gear", "0", true)
@ -24,36 +24,12 @@ local themer_icon_dupes = CreateClientConVar("themer_icon_dupes", "ico
local themer_icon_saves = CreateClientConVar("themer_icon_saves", "icon16/disk.png", true)
--Main loading
local function ColorHack()
local DMenuOption = table.Copy(vgui.GetControlTable("DMenuOption"))
local DTextEntry = table.Copy(vgui.GetControlTable("DTextEntry"))
if themer_tweaks_uselabel:GetBool() then
DMenuOption.Init = function(self)
self:SetContentAlignment(4)
self:SetTextInset(30,0)
self:SetTextColor(self:GetSkin().Colours.Label.Dark)
self:SetChecked(false)
end
DTextEntry.GetTextColor = function(self)
return self.m_colText || self:GetSkin().Colours.Label.Dark
end
DTextEntry.GetCursorColor = function(self)
return self.m_colCursor || self:GetSkin().Colours.Label.Dark
end
derma.DefineControl( "DMenuOption", "Menu Option Line", DMenuOption, "DButton" )
derma.DefineControl( "DMenuOptionCVar", "", vgui.GetControlTable("DMenuOptionCVar"), "DMenuOption" ) --need to reregister for colors to apply, that's all
derma.DefineControl( "DTextEntry", "A simple TextEntry control", DTextEntry, "TextEntry" )
end
end
hook.Add("ForceDermaSkin","Themer",function()
if themer_enabled:GetBool() then return "themer" end
end)
concommand.Add("themer_refresh_derma",function()
include'skins/themer.lua'
include("skins/themer.lua")
derma.RefreshSkins()
ColorHack()
for k,v in pairs(hook.GetTable()["ForceDermaSkin"]) do
if k ~= "Themer" then
@ -68,6 +44,9 @@ hook.Add("SpawnMenuOpen","Themer.IconHack",function()
if v.Name == "Options" then
v.Tab.Image:SetImage(themer_options_gear:GetBool() and "icon16/cog.png" or "icon16/wrench.png")
end
if v.Name == "Utilities" then
v.Tab.Image:SetImage(themer_options_gear:GetBool() and "icon16/cog.png" or "icon16/page_white_wrench.png")
end
end
local SpawnTabs = g_SpawnMenu.CreateMenu.Items
@ -125,7 +104,6 @@ end)
hook.Add("PlayerInitialSpawn","Themer.ColorTweaks",function()
timer.Simple(0,function()
ColorHack()
for k,v in pairs(hook.GetTable()["ForceDermaSkin"]) do
if k ~= "Themer" then
hook.Remove("ForceDermaSkin", k)
@ -138,12 +116,4 @@ for k,v in pairs(hook.GetTable()["ForceDermaSkin"]) do
if k ~= "Themer" then
hook.Remove("ForceDermaSkin", k)
end
end
if hook.GetTable()["OnGamemodeLoaded"] and hook.GetTable()["OnGamemodeLoaded"]["CreateMenuBar"] then
local oldCreateMenuBar = oldCreateMenuBar or hook.GetTable()["OnGamemodeLoaded"]["CreateMenuBar"]
hook.Add( "OnGamemodeLoaded", "CreateMenuBar", function()
ColorHack()
oldCreateMenuBar()
end)
end

View File

@ -3,6 +3,7 @@ local derma_skinname = GetConVar("derma_skinname")
local themer_tweaks_uselabel = GetConVar("themer_tweaks_uselabel")
local themer_options_gear = GetConVar("themer_options_gear")
local themer_merge_options = GetConVar("themer_merge_options")
local themer_spawnlist_icons = GetConVar("themer_spawnlist_icons")
local themer_icon_spawnlists = GetConVar("themer_icon_spawnlists")
@ -133,10 +134,6 @@ All of these require reopening (not reloading) of the spawnmenu to apply changes
panel:TextEntry("#spawnmenu.category.saves", "themer_icon_saves")
end
local function ServerSettings(panel)
panel:Help("soon\xe2\x84\xa2")
end
local function About(panel)
local title = vgui.Create("DLabel",panel)
title:Dock(TOP)
@ -144,7 +141,7 @@ local function About(panel)
title:SetText("Themer")
title:SizeToContents()
title:DockMargin(8,8,8,8)
title:SetColor(panel:GetSkin().Colours.Label.Dark)
title:SetDark()
local github = panel:Button("GitHub")
github:SetIcon("icon16/world_link.png")
@ -155,7 +152,6 @@ 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","Server","Server Settings","Server Settings","","",ServerSettings)
spawnmenu.AddToolMenuOption("Theming","Misc","About","About","","",About)
for k,v in pairs(spawnmenu.GetTools()) do
@ -195,12 +191,6 @@ local function ExtSettings()
icons:SetName("Icons")
tabs:AddSheet("Icons",icons,"icon16/pictures.png")
--Server Settings--
local sv = vgui.Create("DForm",tabs)
ServerSettings(sv)
sv:SetName("Server Settings")
tabs:AddSheet("Server Settings",sv,"icon16/server.png")
--About--
local about = vgui.Create("DForm",tabs)
About(about)