From a1c373aeb03730ece1361642befa7367b61d61be Mon Sep 17 00:00:00 2001 From: worldspawn Date: Wed, 15 May 2024 23:19:51 -0600 Subject: [PATCH] cleanup - code style consistency - removed unused vars for cvars that never existed - slight optimization of loops - merge settings categories into one - force tool panel labels to fix colors on apply (to the best of ability) - fix gear icon not applying to utilities tab --- LICENSE | 2 +- README.md | 3 +- addon.json | 33 +- lua/autorun/sh_themer_loader.lua | 50 +- lua/skins/themer.lua | 1111 ++++++++++++++---------------- lua/themer/iconbrowser.lua | 75 +- lua/themer/main.lua | 458 ++++++------ lua/themer/spawnmenu.lua | 414 +++++------ 8 files changed, 1056 insertions(+), 1090 deletions(-) diff --git a/LICENSE b/LICENSE index a145548..bd1a285 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 0x3bb Solutions +Copyright (c) 2017-2024 0x3bb Solutions Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index f06dc14..a87213d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # [Themer](https://steamcommunity.com/sharedfiles/filedetails/?id=938347376) -Themer is a utility to replace derma themes on the fly without overwriting files. - +Themer is a utility to replace Derma themes or switch skins on the fly without overwriting files. diff --git a/addon.json b/addon.json index 91e2afd..cc7c5b7 100644 --- a/addon.json +++ b/addon.json @@ -1,16 +1,17 @@ -{ - "description": "A tool to make derma skin application easier.", - "ignore": [ - "*.psd", - ".git/*", - ".gitignore", - "icon.jpg", - "themer.gma", - "README.md" - ], - "logo": "icon.jpg", - "tags": ["build", "scenic"], - "title": "Themer", - "type": "tool", - "workshopid": 938347376.0 -} +{ + "description": "A tool to make derma skin application easier.", + "ignore": [ + "*.psd", + "icon.jpg", + "themer.gma", + ".git/*", + ".gitignore", + "README.md", + "LICENSE" + ], + "logo": "icon.jpg", + "tags": ["build", "scenic"], + "title": "Themer", + "type": "tool", + "workshopid": 938347376 +} diff --git a/lua/autorun/sh_themer_loader.lua b/lua/autorun/sh_themer_loader.lua index ccfc881..e90956b 100644 --- a/lua/autorun/sh_themer_loader.lua +++ b/lua/autorun/sh_themer_loader.lua @@ -1,24 +1,26 @@ -AddCSLuaFile("skins/themer.lua") -AddCSLuaFile("themer/main.lua") -AddCSLuaFile("themer/iconbrowser.lua") -AddCSLuaFile("themer/spawnmenu.lua") - -if SERVER then - resource.AddWorkshop("938347376") - return -end -include'skins/themer.lua' - -surface.CreateFont("Themer.Title",{ - font = "Roboto", - size = 48, - weight = 400, -}) - -surface.CreateFont("Themer.Title2",{ - font = "Roboto", - size = 32, - weight = 400, -}) - -include'themer/main.lua' \ No newline at end of file +AddCSLuaFile("skins/themer.lua") +AddCSLuaFile("themer/main.lua") +AddCSLuaFile("themer/iconbrowser.lua") +AddCSLuaFile("themer/spawnmenu.lua") + +if SERVER then + resource.AddWorkshop("938347376") + + return +end + +include("skins/themer.lua") + +surface.CreateFont("Themer.Title", { + font = "Roboto", + size = 48, + weight = 400, +}) + +surface.CreateFont("Themer.Title2", { + font = "Roboto", + size = 32, + weight = 400, +}) + +include("themer/main.lua") diff --git a/lua/skins/themer.lua b/lua/skins/themer.lua index 116c65f..b23f104 100644 --- a/lua/skins/themer.lua +++ b/lua/skins/themer.lua @@ -1,1016 +1,915 @@ -CreateClientConVar("derma_skinname","gmoddefault",true) +local derma_skinname = CreateClientConVar("derma_skinname", "gmoddefault", true, false, "Texture filename to load for Themer's skin") -local surface = surface -local Color = Color +local surface = surface +local Color = Color +local ColorAlpha = ColorAlpha +local Format = Format +local GWEN = GWEN +local Material = Material SKIN = {} +local SKIN = SKIN SKIN.PrintName = "Themer" -SKIN.Author = "" +SKIN.Author = "" SKIN.DermaVersion = 1 -local S = "gwenskin/" .. GetConVar("derma_skinname"):GetString() .. ".png" -local tex = Material(S) +local texture_path = Format("gwenskin/%s.png", derma_skinname:GetString()) +local tex = Material(texture_path) if not tex or tex:IsError() then - tex = Material( "gwenskin/gmoddefault.png" ) + tex = Material("gwenskin/gmoddefault.png") end SKIN.GwenTexture = tex -SKIN.bg_color = Color( 101, 100, 105, 255 ) -SKIN.bg_color_sleep = Color( 70, 70, 70, 255 ) -SKIN.bg_color_dark = Color( 55, 57, 61, 255 ) -SKIN.bg_color_bright = Color( 220, 220, 220, 255 ) -SKIN.frame_border = Color( 50, 50, 50, 255 ) +SKIN.bg_color = Color(101, 100, 105, 255) +SKIN.bg_color_sleep = Color(70, 70, 70, 255) +SKIN.bg_color_dark = Color(55, 57, 61, 255) +SKIN.bg_color_bright = Color(220, 220, 220, 255) +SKIN.frame_border = Color(50, 50, 50, 255) -SKIN.fontFrame = "DermaDefault" +SKIN.fontFrame = "DermaDefault" -SKIN.control_color = Color( 120, 120, 120, 255 ) -SKIN.control_color_highlight = Color( 150, 150, 150, 255 ) -SKIN.control_color_active = Color( 110, 150, 250, 255 ) -SKIN.control_color_bright = Color( 255, 200, 100, 255 ) -SKIN.control_color_dark = Color( 100, 100, 100, 255 ) +SKIN.control_color = Color(120, 120, 120, 255) +SKIN.control_color_highlight = Color(150, 150, 150, 255) +SKIN.control_color_active = Color(110, 150, 250, 255) +SKIN.control_color_bright = Color(255, 200, 100, 255) +SKIN.control_color_dark = Color(100, 100, 100, 255) -SKIN.bg_alt1 = Color( 50, 50, 50, 255 ) -SKIN.bg_alt2 = Color( 55, 55, 55, 255 ) +SKIN.bg_alt1 = Color(50, 50, 50, 255) +SKIN.bg_alt2 = Color(55, 55, 55, 255) -SKIN.listview_hover = Color( 70, 70, 70, 255 ) -SKIN.listview_selected = Color( 100, 170, 220, 255 ) +SKIN.listview_hover = Color(70, 70, 70, 255) +SKIN.listview_selected = Color(100, 170, 220, 255) -SKIN.text_bright = Color( 255, 255, 255, 255 ) -SKIN.text_normal = Color( 180, 180, 180, 255 ) -SKIN.text_dark = Color( 20, 20, 20, 255 ) -SKIN.text_highlight = Color( 255, 20, 20, 255 ) +SKIN.text_bright = Color(255, 255, 255, 255) +SKIN.text_normal = Color(180, 180, 180, 255) +SKIN.text_dark = Color(20, 20, 20, 255) +SKIN.text_highlight = Color(255, 20, 20, 255) -SKIN.texGradientUp = Material( "gui/gradient_up" ) -SKIN.texGradientDown = Material( "gui/gradient_down" ) +SKIN.texGradientUp = Material("gui/gradient_up") +SKIN.texGradientDown = Material("gui/gradient_down") -SKIN.combobox_selected = SKIN.listview_selected +SKIN.combobox_selected = SKIN.listview_selected -SKIN.panel_transback = Color( 255, 255, 255, 50 ) -SKIN.tooltip = Color( 255, 245, 175, 255 ) +SKIN.panel_transback = Color(255, 255, 255, 50) +SKIN.tooltip = Color(255, 245, 175, 255) -SKIN.colPropertySheet = Color( 170, 170, 170, 255 ) -SKIN.colTab = SKIN.colPropertySheet -SKIN.colTabInactive = Color( 140, 140, 140, 255 ) -SKIN.colTabShadow = Color( 0, 0, 0, 170 ) -SKIN.colTabText = Color( 255, 255, 255, 255 ) -SKIN.colTabTextInactive = Color( 0, 0, 0, 200 ) -SKIN.fontTab = "DermaDefault" +SKIN.colPropertySheet = Color(170, 170, 170, 255) +SKIN.colTab = SKIN.colPropertySheet +SKIN.colTabInactive = Color(140, 140, 140, 255) +SKIN.colTabShadow = Color(0, 0, 0, 170) +SKIN.colTabText = Color(255, 255, 255, 255) +SKIN.colTabTextInactive = Color(0, 0, 0, 200) +SKIN.fontTab = "DermaDefault" -SKIN.colCollapsibleCategory = Color( 255, 255, 255, 20 ) +SKIN.colCollapsibleCategory = Color(255, 255, 255, 20) -SKIN.colCategoryText = Color( 255, 255, 255, 255 ) -SKIN.colCategoryTextInactive = Color( 200, 200, 200, 255 ) -SKIN.fontCategoryHeader = "TabLarge" +SKIN.colCategoryText = Color(255, 255, 255, 255) +SKIN.colCategoryTextInactive = Color(200, 200, 200, 255) +SKIN.fontCategoryHeader = "TabLarge" -SKIN.colNumberWangBG = Color( 255, 240, 150, 255 ) -SKIN.colTextEntryBG = Color( 240, 240, 240, 255 ) -SKIN.colTextEntryBorder = Color( 20, 20, 20, 255 ) -SKIN.colTextEntryText = Color( 20, 20, 20, 255 ) -SKIN.colTextEntryTextHighlight = Color( 20, 200, 250, 255 ) -SKIN.colTextEntryTextCursor = Color( 0, 0, 100, 255 ) -SKIN.colTextEntryTextPlaceholder= Color( 128, 128, 128, 255 ) +SKIN.colNumberWangBG = Color(255, 240, 150, 255) +SKIN.colTextEntryBG = Color(240, 240, 240, 255) +SKIN.colTextEntryBorder = Color(20, 20, 20, 255) +SKIN.colTextEntryText = Color(20, 20, 20, 255) +SKIN.colTextEntryTextHighlight = Color(20, 200, 250, 255) +SKIN.colTextEntryTextCursor = Color(0, 0, 100, 255) +SKIN.colTextEntryTextPlaceholder = Color(128, 128, 128, 255) -SKIN.colMenuBG = Color( 255, 255, 255, 200 ) -SKIN.colMenuBorder = Color( 0, 0, 0, 200 ) +SKIN.colMenuBG = Color(255, 255, 255, 200) +SKIN.colMenuBorder = Color(0, 0, 0, 200) -SKIN.colButtonText = Color( 255, 255, 255, 255 ) -SKIN.colButtonTextDisabled = Color( 255, 255, 255, 55 ) -SKIN.colButtonBorder = Color( 20, 20, 20, 255 ) -SKIN.colButtonBorderHighlight = Color( 255, 255, 255, 50 ) -SKIN.colButtonBorderShadow = Color( 0, 0, 0, 100 ) +SKIN.colButtonText = Color(255, 255, 255, 255) +SKIN.colButtonTextDisabled = Color(255, 255, 255, 55) +SKIN.colButtonBorder = Color(20, 20, 20, 255) +SKIN.colButtonBorderHighlight = Color(255, 255, 255, 50) +SKIN.colButtonBorderShadow = Color(0, 0, 0, 100) SKIN.tex = {} -SKIN.tex.Selection = GWEN.CreateTextureBorder( 384, 32, 31, 31, 4, 4, 4, 4 ) +SKIN.tex.Selection = GWEN.CreateTextureBorder(384, 32, 31, 31, 4, 4, 4, 4) SKIN.tex.Panels = {} -SKIN.tex.Panels.Normal = GWEN.CreateTextureBorder( 256, 0, 63, 63, 16, 16, 16, 16 ) -SKIN.tex.Panels.Bright = GWEN.CreateTextureBorder( 256+64, 0, 63, 63, 16, 16, 16, 16 ) -SKIN.tex.Panels.Dark = GWEN.CreateTextureBorder( 256, 64, 63, 63, 16, 16, 16, 16 ) -SKIN.tex.Panels.Highlight = GWEN.CreateTextureBorder( 256+64, 64, 63, 63, 16, 16, 16, 16 ) +SKIN.tex.Panels.Normal = GWEN.CreateTextureBorder(256, 0, 63, 63, 16, 16, 16, 16) +SKIN.tex.Panels.Bright = GWEN.CreateTextureBorder(256+64, 0, 63, 63, 16, 16, 16, 16) +SKIN.tex.Panels.Dark = GWEN.CreateTextureBorder(256, 64, 63, 63, 16, 16, 16, 16) +SKIN.tex.Panels.Highlight = GWEN.CreateTextureBorder(256+64, 64, 63, 63, 16, 16, 16, 16) -SKIN.tex.Button = GWEN.CreateTextureBorder( 480, 0, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Button_Hovered = GWEN.CreateTextureBorder( 480, 32, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Button_Dead = GWEN.CreateTextureBorder( 480, 64, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Button_Down = GWEN.CreateTextureBorder( 480, 96, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Shadow = GWEN.CreateTextureBorder( 448, 0, 31, 31, 8, 8, 8, 8 ) +SKIN.tex.Button = GWEN.CreateTextureBorder(480, 0, 31, 31, 8, 8, 8, 8) +SKIN.tex.Button_Hovered = GWEN.CreateTextureBorder(480, 32, 31, 31, 8, 8, 8, 8) +SKIN.tex.Button_Dead = GWEN.CreateTextureBorder(480, 64, 31, 31, 8, 8, 8, 8) +SKIN.tex.Button_Down = GWEN.CreateTextureBorder(480, 96, 31, 31, 8, 8, 8, 8) +SKIN.tex.Shadow = GWEN.CreateTextureBorder(448, 0, 31, 31, 8, 8, 8, 8) -SKIN.tex.Tree = GWEN.CreateTextureBorder( 256, 128, 127, 127, 16, 16, 16, 16 ) -SKIN.tex.Checkbox_Checked = GWEN.CreateTextureNormal( 448, 32, 15, 15 ) -SKIN.tex.Checkbox = GWEN.CreateTextureNormal( 464, 32, 15, 15 ) -SKIN.tex.CheckboxD_Checked = GWEN.CreateTextureNormal( 448, 48, 15, 15 ) -SKIN.tex.CheckboxD = GWEN.CreateTextureNormal( 464, 48, 15, 15 ) -SKIN.tex.RadioButton_Checked = GWEN.CreateTextureNormal( 448, 64, 15, 15 ) -SKIN.tex.RadioButton = GWEN.CreateTextureNormal( 464, 64, 15, 15 ) -SKIN.tex.RadioButtonD_Checked = GWEN.CreateTextureNormal( 448, 80, 15, 15 ) -SKIN.tex.RadioButtonD = GWEN.CreateTextureNormal( 464, 80, 15, 15 ) -SKIN.tex.TreePlus = GWEN.CreateTextureNormal( 448, 96, 15, 15 ) -SKIN.tex.TreeMinus = GWEN.CreateTextureNormal( 464, 96, 15, 15 ) -SKIN.tex.TextBox = GWEN.CreateTextureBorder( 0, 150, 127, 21, 4, 4, 4, 4 ) -SKIN.tex.TextBox_Focus = GWEN.CreateTextureBorder( 0, 172, 127, 21, 4, 4, 4, 4 ) -SKIN.tex.TextBox_Disabled = GWEN.CreateTextureBorder( 0, 194, 127, 21, 4, 4, 4, 4 ) -SKIN.tex.MenuBG_Column = GWEN.CreateTextureBorder( 128, 128, 127, 63, 24, 8, 8, 8 ) -SKIN.tex.MenuBG = GWEN.CreateTextureBorder( 128, 192, 127, 63, 8, 8, 8, 8 ) -SKIN.tex.MenuBG_Hover = GWEN.CreateTextureBorder( 128, 256, 127, 31, 8, 8, 8, 8 ) -SKIN.tex.MenuBG_Spacer = GWEN.CreateTextureNormal( 128, 288, 127, 3 ) -SKIN.tex.Menu_Strip = GWEN.CreateTextureBorder( 0, 128, 127, 21, 8, 8, 8, 8 ) -SKIN.tex.Menu_Check = GWEN.CreateTextureNormal( 448, 112, 15, 15 ) -SKIN.tex.Tab_Control = GWEN.CreateTextureBorder( 0, 256, 127, 127, 8, 8, 8, 8 ) -SKIN.tex.TabB_Active = GWEN.CreateTextureBorder( 0, 416, 63, 31, 8, 8, 8, 8 ) -SKIN.tex.TabB_Inactive = GWEN.CreateTextureBorder( 128, 416, 63, 31, 8, 8, 8, 8 ) -SKIN.tex.TabT_Active = GWEN.CreateTextureBorder( 0, 384, 63, 31, 8, 8, 8, 8 ) -SKIN.tex.TabT_Inactive = GWEN.CreateTextureBorder( 128, 384, 63, 31, 8, 8, 8, 8 ) -SKIN.tex.TabL_Active = GWEN.CreateTextureBorder( 64, 384, 31, 63, 8, 8, 8, 8 ) -SKIN.tex.TabL_Inactive = GWEN.CreateTextureBorder( 64+128, 384, 31, 63, 8, 8, 8, 8 ) -SKIN.tex.TabR_Active = GWEN.CreateTextureBorder( 96, 384, 31, 63, 8, 8, 8, 8 ) -SKIN.tex.TabR_Inactive = GWEN.CreateTextureBorder( 96+128, 384, 31, 63, 8, 8, 8, 8 ) -SKIN.tex.Tab_Bar = GWEN.CreateTextureBorder( 128, 352, 127, 31, 4, 4, 4, 4 ) +SKIN.tex.Tree = GWEN.CreateTextureBorder(256, 128, 127, 127, 16, 16, 16, 16) +SKIN.tex.Checkbox_Checked = GWEN.CreateTextureNormal(448, 32, 15, 15) +SKIN.tex.Checkbox = GWEN.CreateTextureNormal(464, 32, 15, 15) +SKIN.tex.CheckboxD_Checked = GWEN.CreateTextureNormal(448, 48, 15, 15) +SKIN.tex.CheckboxD = GWEN.CreateTextureNormal(464, 48, 15, 15) +SKIN.tex.RadioButton_Checked = GWEN.CreateTextureNormal(448, 64, 15, 15) +SKIN.tex.RadioButton = GWEN.CreateTextureNormal(464, 64, 15, 15) +SKIN.tex.RadioButtonD_Checked = GWEN.CreateTextureNormal(448, 80, 15, 15) +SKIN.tex.RadioButtonD = GWEN.CreateTextureNormal(464, 80, 15, 15) +SKIN.tex.TreePlus = GWEN.CreateTextureNormal(448, 96, 15, 15) +SKIN.tex.TreeMinus = GWEN.CreateTextureNormal(464, 96, 15, 15) +SKIN.tex.TextBox = GWEN.CreateTextureBorder(0, 150, 127, 21, 4, 4, 4, 4) +SKIN.tex.TextBox_Focus = GWEN.CreateTextureBorder(0, 172, 127, 21, 4, 4, 4, 4) +SKIN.tex.TextBox_Disabled = GWEN.CreateTextureBorder(0, 194, 127, 21, 4, 4, 4, 4) +SKIN.tex.MenuBG_Column = GWEN.CreateTextureBorder(128, 128, 127, 63, 24, 8, 8, 8) +SKIN.tex.MenuBG = GWEN.CreateTextureBorder(128, 192, 127, 63, 8, 8, 8, 8) +SKIN.tex.MenuBG_Hover = GWEN.CreateTextureBorder(128, 256, 127, 31, 8, 8, 8, 8) +SKIN.tex.MenuBG_Spacer = GWEN.CreateTextureNormal(128, 288, 127, 3) +SKIN.tex.Menu_Strip = GWEN.CreateTextureBorder(0, 128, 127, 21, 8, 8, 8, 8) +SKIN.tex.Menu_Check = GWEN.CreateTextureNormal(448, 112, 15, 15) +SKIN.tex.Tab_Control = GWEN.CreateTextureBorder(0, 256, 127, 127, 8, 8, 8, 8) +SKIN.tex.TabB_Active = GWEN.CreateTextureBorder(0, 416, 63, 31, 8, 8, 8, 8) +SKIN.tex.TabB_Inactive = GWEN.CreateTextureBorder(128, 416, 63, 31, 8, 8, 8, 8) +SKIN.tex.TabT_Active = GWEN.CreateTextureBorder(0, 384, 63, 31, 8, 8, 8, 8) +SKIN.tex.TabT_Inactive = GWEN.CreateTextureBorder(128, 384, 63, 31, 8, 8, 8, 8) +SKIN.tex.TabL_Active = GWEN.CreateTextureBorder(64, 384, 31, 63, 8, 8, 8, 8) +SKIN.tex.TabL_Inactive = GWEN.CreateTextureBorder(64+128, 384, 31, 63, 8, 8, 8, 8) +SKIN.tex.TabR_Active = GWEN.CreateTextureBorder(96, 384, 31, 63, 8, 8, 8, 8) +SKIN.tex.TabR_Inactive = GWEN.CreateTextureBorder(96+128, 384, 31, 63, 8, 8, 8, 8) +SKIN.tex.Tab_Bar = GWEN.CreateTextureBorder(128, 352, 127, 31, 4, 4, 4, 4) SKIN.tex.Window = {} -SKIN.tex.Window.Normal = GWEN.CreateTextureBorder( 0, 0, 127, 127, 8, 24, 8, 8 ) -SKIN.tex.Window.Inactive = GWEN.CreateTextureBorder( 128, 0, 127, 127, 8, 24, 8, 8 ) +SKIN.tex.Window.Normal = GWEN.CreateTextureBorder(0, 0, 127, 127, 8, 24, 8, 8) +SKIN.tex.Window.Inactive = GWEN.CreateTextureBorder(128, 0, 127, 127, 8, 24, 8, 8) -SKIN.tex.Window.Close = GWEN.CreateTextureNormal( 32, 448, 31, 24 ) -SKIN.tex.Window.Close_Hover = GWEN.CreateTextureNormal( 64, 448, 31, 24 ) -SKIN.tex.Window.Close_Down = GWEN.CreateTextureNormal( 96, 448, 31, 24 ) +SKIN.tex.Window.Close = GWEN.CreateTextureNormal(32, 448, 31, 24) +SKIN.tex.Window.Close_Hover = GWEN.CreateTextureNormal(64, 448, 31, 24) +SKIN.tex.Window.Close_Down = GWEN.CreateTextureNormal(96, 448, 31, 24) -SKIN.tex.Window.Maxi = GWEN.CreateTextureNormal( 32 + 96 * 2, 448, 31, 24 ) -SKIN.tex.Window.Maxi_Hover = GWEN.CreateTextureNormal( 64 + 96 * 2, 448, 31, 24 ) -SKIN.tex.Window.Maxi_Down = GWEN.CreateTextureNormal( 96 + 96 * 2, 448, 31, 24 ) +SKIN.tex.Window.Maxi = GWEN.CreateTextureNormal(32 + 96 * 2, 448, 31, 24) +SKIN.tex.Window.Maxi_Hover = GWEN.CreateTextureNormal(64 + 96 * 2, 448, 31, 24) +SKIN.tex.Window.Maxi_Down = GWEN.CreateTextureNormal(96 + 96 * 2, 448, 31, 24) -SKIN.tex.Window.Restore = GWEN.CreateTextureNormal( 32 + 96 * 2, 448 + 32, 31, 24 ) -SKIN.tex.Window.Restore_Hover = GWEN.CreateTextureNormal( 64 + 96 * 2, 448 + 32, 31, 24 ) -SKIN.tex.Window.Restore_Down = GWEN.CreateTextureNormal( 96 + 96 * 2, 448 + 32, 31, 24 ) +SKIN.tex.Window.Restore = GWEN.CreateTextureNormal(32 + 96 * 2, 448 + 32, 31, 24) +SKIN.tex.Window.Restore_Hover = GWEN.CreateTextureNormal(64 + 96 * 2, 448 + 32, 31, 24) +SKIN.tex.Window.Restore_Down = GWEN.CreateTextureNormal(96 + 96 * 2, 448 + 32, 31, 24) -SKIN.tex.Window.Mini = GWEN.CreateTextureNormal( 32 + 96, 448, 31, 24 ) -SKIN.tex.Window.Mini_Hover = GWEN.CreateTextureNormal( 64 + 96, 448, 31, 24 ) -SKIN.tex.Window.Mini_Down = GWEN.CreateTextureNormal( 96 + 96, 448, 31, 24 ) +SKIN.tex.Window.Mini = GWEN.CreateTextureNormal(32 + 96, 448, 31, 24) +SKIN.tex.Window.Mini_Hover = GWEN.CreateTextureNormal(64 + 96, 448, 31, 24) +SKIN.tex.Window.Mini_Down = GWEN.CreateTextureNormal(96 + 96, 448, 31, 24) SKIN.tex.Scroller = {} -SKIN.tex.Scroller.TrackV = GWEN.CreateTextureBorder( 384, 208, 15, 127, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonV_Normal = GWEN.CreateTextureBorder( 384 + 16, 208, 15, 127, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonV_Hover = GWEN.CreateTextureBorder( 384 + 32, 208, 15, 127, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonV_Down = GWEN.CreateTextureBorder( 384 + 48, 208, 15, 127, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonV_Disabled = GWEN.CreateTextureBorder( 384 + 64, 208, 15, 127, 4, 4, 4, 4 ) +SKIN.tex.Scroller.TrackV = GWEN.CreateTextureBorder(384, 208, 15, 127, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonV_Normal = GWEN.CreateTextureBorder(384 + 16, 208, 15, 127, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonV_Hover = GWEN.CreateTextureBorder(384 + 32, 208, 15, 127, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonV_Down = GWEN.CreateTextureBorder(384 + 48, 208, 15, 127, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonV_Disabled = GWEN.CreateTextureBorder(384 + 64, 208, 15, 127, 4, 4, 4, 4) -SKIN.tex.Scroller.TrackH = GWEN.CreateTextureBorder( 384, 128, 127, 15, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonH_Normal = GWEN.CreateTextureBorder( 384, 128 + 16, 127, 15, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonH_Hover = GWEN.CreateTextureBorder( 384, 128 + 32, 127, 15, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonH_Down = GWEN.CreateTextureBorder( 384, 128 + 48, 127, 15, 4, 4, 4, 4 ) -SKIN.tex.Scroller.ButtonH_Disabled = GWEN.CreateTextureBorder( 384, 128 + 64, 127, 15, 4, 4, 4, 4 ) +SKIN.tex.Scroller.TrackH = GWEN.CreateTextureBorder(384, 128, 127, 15, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonH_Normal = GWEN.CreateTextureBorder(384, 128 + 16, 127, 15, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonH_Hover = GWEN.CreateTextureBorder(384, 128 + 32, 127, 15, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonH_Down = GWEN.CreateTextureBorder(384, 128 + 48, 127, 15, 4, 4, 4, 4) +SKIN.tex.Scroller.ButtonH_Disabled = GWEN.CreateTextureBorder(384, 128 + 64, 127, 15, 4, 4, 4, 4) -SKIN.tex.Scroller.LeftButton_Normal = GWEN.CreateTextureBorder( 464, 208, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.LeftButton_Hover = GWEN.CreateTextureBorder( 480, 208, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.LeftButton_Down = GWEN.CreateTextureBorder( 464, 272, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.LeftButton_Disabled = GWEN.CreateTextureBorder( 480 + 48, 272, 15, 15, 2, 2, 2, 2 ) +SKIN.tex.Scroller.LeftButton_Normal = GWEN.CreateTextureBorder(464, 208, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.LeftButton_Hover = GWEN.CreateTextureBorder(480, 208, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.LeftButton_Down = GWEN.CreateTextureBorder(464, 272, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.LeftButton_Disabled = GWEN.CreateTextureBorder(480 + 48, 272, 15, 15, 2, 2, 2, 2) -SKIN.tex.Scroller.UpButton_Normal = GWEN.CreateTextureBorder( 464, 208 + 16, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.UpButton_Hover = GWEN.CreateTextureBorder( 480, 208 + 16, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.UpButton_Down = GWEN.CreateTextureBorder( 464, 272 + 16, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.UpButton_Disabled = GWEN.CreateTextureBorder( 480 + 48, 272 + 16, 15, 15, 2, 2, 2, 2 ) +SKIN.tex.Scroller.UpButton_Normal = GWEN.CreateTextureBorder(464, 208 + 16, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.UpButton_Hover = GWEN.CreateTextureBorder(480, 208 + 16, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.UpButton_Down = GWEN.CreateTextureBorder(464, 272 + 16, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.UpButton_Disabled = GWEN.CreateTextureBorder(480 + 48, 272 + 16, 15, 15, 2, 2, 2, 2) -SKIN.tex.Scroller.RightButton_Normal = GWEN.CreateTextureBorder( 464, 208 + 32, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.RightButton_Hover = GWEN.CreateTextureBorder( 480, 208 + 32, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.RightButton_Down = GWEN.CreateTextureBorder( 464, 272 + 32, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.RightButton_Disabled = GWEN.CreateTextureBorder( 480 + 48, 272 + 32, 15, 15, 2, 2, 2, 2 ) +SKIN.tex.Scroller.RightButton_Normal = GWEN.CreateTextureBorder(464, 208 + 32, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.RightButton_Hover = GWEN.CreateTextureBorder(480, 208 + 32, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.RightButton_Down = GWEN.CreateTextureBorder(464, 272 + 32, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.RightButton_Disabled = GWEN.CreateTextureBorder(480 + 48, 272 + 32, 15, 15, 2, 2, 2, 2) -SKIN.tex.Scroller.DownButton_Normal = GWEN.CreateTextureBorder( 464, 208 + 48, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.DownButton_Hover = GWEN.CreateTextureBorder( 480, 208 + 48, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.DownButton_Down = GWEN.CreateTextureBorder( 464, 272 + 48, 15, 15, 2, 2, 2, 2 ) -SKIN.tex.Scroller.DownButton_Disabled = GWEN.CreateTextureBorder( 480 + 48, 272 + 48, 15, 15, 2, 2, 2, 2 ) +SKIN.tex.Scroller.DownButton_Normal = GWEN.CreateTextureBorder(464, 208 + 48, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.DownButton_Hover = GWEN.CreateTextureBorder(480, 208 + 48, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.DownButton_Down = GWEN.CreateTextureBorder(464, 272 + 48, 15, 15, 2, 2, 2, 2) +SKIN.tex.Scroller.DownButton_Disabled = GWEN.CreateTextureBorder(480 + 48, 272 + 48, 15, 15, 2, 2, 2, 2) SKIN.tex.Menu = {} -SKIN.tex.Menu.RightArrow = GWEN.CreateTextureNormal( 464, 112, 15, 15 ) +SKIN.tex.Menu.RightArrow = GWEN.CreateTextureNormal(464, 112, 15, 15) SKIN.tex.Input = {} SKIN.tex.Input.ComboBox = {} -SKIN.tex.Input.ComboBox.Normal = GWEN.CreateTextureBorder( 384, 336, 127, 31, 8, 8, 32, 8 ) -SKIN.tex.Input.ComboBox.Hover = GWEN.CreateTextureBorder( 384, 336+32, 127, 31, 8, 8, 32, 8 ) -SKIN.tex.Input.ComboBox.Down = GWEN.CreateTextureBorder( 384, 336+64, 127, 31, 8, 8, 32, 8 ) -SKIN.tex.Input.ComboBox.Disabled = GWEN.CreateTextureBorder( 384, 336+96, 127, 31, 8, 8, 32, 8 ) +SKIN.tex.Input.ComboBox.Normal = GWEN.CreateTextureBorder(384, 336, 127, 31, 8, 8, 32, 8) +SKIN.tex.Input.ComboBox.Hover = GWEN.CreateTextureBorder(384, 336+32, 127, 31, 8, 8, 32, 8) +SKIN.tex.Input.ComboBox.Down = GWEN.CreateTextureBorder(384, 336+64, 127, 31, 8, 8, 32, 8) +SKIN.tex.Input.ComboBox.Disabled = GWEN.CreateTextureBorder(384, 336+96, 127, 31, 8, 8, 32, 8) SKIN.tex.Input.ComboBox.Button = {} -SKIN.tex.Input.ComboBox.Button.Normal = GWEN.CreateTextureNormal( 496, 272, 15, 15 ) -SKIN.tex.Input.ComboBox.Button.Hover = GWEN.CreateTextureNormal( 496, 272+16, 15, 15 ) -SKIN.tex.Input.ComboBox.Button.Down = GWEN.CreateTextureNormal( 496, 272+32, 15, 15 ) -SKIN.tex.Input.ComboBox.Button.Disabled = GWEN.CreateTextureNormal( 496, 272+48, 15, 15 ) +SKIN.tex.Input.ComboBox.Button.Normal = GWEN.CreateTextureNormal(496, 272, 15, 15) +SKIN.tex.Input.ComboBox.Button.Hover = GWEN.CreateTextureNormal(496, 272+16, 15, 15) +SKIN.tex.Input.ComboBox.Button.Down = GWEN.CreateTextureNormal(496, 272+32, 15, 15) +SKIN.tex.Input.ComboBox.Button.Disabled = GWEN.CreateTextureNormal(496, 272+48, 15, 15) SKIN.tex.Input.UpDown = {} SKIN.tex.Input.UpDown.Up = {} -SKIN.tex.Input.UpDown.Up.Normal = GWEN.CreateTextureCentered( 384, 112, 7, 7 ) -SKIN.tex.Input.UpDown.Up.Hover = GWEN.CreateTextureCentered( 384+8, 112, 7, 7 ) -SKIN.tex.Input.UpDown.Up.Down = GWEN.CreateTextureCentered( 384+16, 112, 7, 7 ) -SKIN.tex.Input.UpDown.Up.Disabled = GWEN.CreateTextureCentered( 384+24, 112, 7, 7 ) +SKIN.tex.Input.UpDown.Up.Normal = GWEN.CreateTextureCentered(384, 112, 7, 7) +SKIN.tex.Input.UpDown.Up.Hover = GWEN.CreateTextureCentered(384+8, 112, 7, 7) +SKIN.tex.Input.UpDown.Up.Down = GWEN.CreateTextureCentered(384+16, 112, 7, 7) +SKIN.tex.Input.UpDown.Up.Disabled = GWEN.CreateTextureCentered(384+24, 112, 7, 7) SKIN.tex.Input.UpDown.Down = {} -SKIN.tex.Input.UpDown.Down.Normal = GWEN.CreateTextureCentered( 384, 120, 7, 7 ) -SKIN.tex.Input.UpDown.Down.Hover = GWEN.CreateTextureCentered( 384+8, 120, 7, 7 ) -SKIN.tex.Input.UpDown.Down.Down = GWEN.CreateTextureCentered( 384+16, 120, 7, 7 ) -SKIN.tex.Input.UpDown.Down.Disabled = GWEN.CreateTextureCentered( 384+24, 120, 7, 7 ) +SKIN.tex.Input.UpDown.Down.Normal = GWEN.CreateTextureCentered(384, 120, 7, 7) +SKIN.tex.Input.UpDown.Down.Hover = GWEN.CreateTextureCentered(384+8, 120, 7, 7) +SKIN.tex.Input.UpDown.Down.Down = GWEN.CreateTextureCentered(384+16, 120, 7, 7) +SKIN.tex.Input.UpDown.Down.Disabled = GWEN.CreateTextureCentered(384+24, 120, 7, 7) SKIN.tex.Input.Slider = {} SKIN.tex.Input.Slider.H = {} -SKIN.tex.Input.Slider.H.Normal = GWEN.CreateTextureNormal( 416, 32, 15, 15 ) -SKIN.tex.Input.Slider.H.Hover = GWEN.CreateTextureNormal( 416, 32+16, 15, 15 ) -SKIN.tex.Input.Slider.H.Down = GWEN.CreateTextureNormal( 416, 32+32, 15, 15 ) -SKIN.tex.Input.Slider.H.Disabled = GWEN.CreateTextureNormal( 416, 32+48, 15, 15 ) +SKIN.tex.Input.Slider.H.Normal = GWEN.CreateTextureNormal(416, 32, 15, 15) +SKIN.tex.Input.Slider.H.Hover = GWEN.CreateTextureNormal(416, 32+16, 15, 15) +SKIN.tex.Input.Slider.H.Down = GWEN.CreateTextureNormal(416, 32+32, 15, 15) +SKIN.tex.Input.Slider.H.Disabled = GWEN.CreateTextureNormal(416, 32+48, 15, 15) SKIN.tex.Input.Slider.V = {} -SKIN.tex.Input.Slider.V.Normal = GWEN.CreateTextureNormal( 416+16, 32, 15, 15 ) -SKIN.tex.Input.Slider.V.Hover = GWEN.CreateTextureNormal( 416+16, 32+16, 15, 15 ) -SKIN.tex.Input.Slider.V.Down = GWEN.CreateTextureNormal( 416+16, 32+32, 15, 15 ) -SKIN.tex.Input.Slider.V.Disabled = GWEN.CreateTextureNormal( 416+16, 32+48, 15, 15 ) +SKIN.tex.Input.Slider.V.Normal = GWEN.CreateTextureNormal(416+16, 32, 15, 15) +SKIN.tex.Input.Slider.V.Hover = GWEN.CreateTextureNormal(416+16, 32+16, 15, 15) +SKIN.tex.Input.Slider.V.Down = GWEN.CreateTextureNormal(416+16, 32+32, 15, 15) +SKIN.tex.Input.Slider.V.Disabled = GWEN.CreateTextureNormal(416+16, 32+48, 15, 15) SKIN.tex.Input.ListBox = {} -SKIN.tex.Input.ListBox.Background = GWEN.CreateTextureBorder( 256, 256, 63, 127, 8, 8, 8, 8 ) -SKIN.tex.Input.ListBox.Hovered = GWEN.CreateTextureBorder( 320, 320, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Input.ListBox.EvenLine = GWEN.CreateTextureBorder( 352, 256, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Input.ListBox.OddLine = GWEN.CreateTextureBorder( 352, 288, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Input.ListBox.EvenLineSelected = GWEN.CreateTextureBorder( 320, 256, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.Input.ListBox.OddLineSelected = GWEN.CreateTextureBorder( 320, 288, 31, 31, 8, 8, 8, 8 ) +SKIN.tex.Input.ListBox.Background = GWEN.CreateTextureBorder(256, 256, 63, 127, 8, 8, 8, 8) +SKIN.tex.Input.ListBox.Hovered = GWEN.CreateTextureBorder(320, 320, 31, 31, 8, 8, 8, 8) +SKIN.tex.Input.ListBox.EvenLine = GWEN.CreateTextureBorder(352, 256, 31, 31, 8, 8, 8, 8) +SKIN.tex.Input.ListBox.OddLine = GWEN.CreateTextureBorder(352, 288, 31, 31, 8, 8, 8, 8) +SKIN.tex.Input.ListBox.EvenLineSelected = GWEN.CreateTextureBorder(320, 256, 31, 31, 8, 8, 8, 8) +SKIN.tex.Input.ListBox.OddLineSelected = GWEN.CreateTextureBorder(320, 288, 31, 31, 8, 8, 8, 8) SKIN.tex.ProgressBar = {} -SKIN.tex.ProgressBar.Back = GWEN.CreateTextureBorder( 384, 0, 31, 31, 8, 8, 8, 8 ) -SKIN.tex.ProgressBar.Front = GWEN.CreateTextureBorder( 384+32, 0, 31, 31, 8, 8, 8, 8 ) +SKIN.tex.ProgressBar.Back = GWEN.CreateTextureBorder(384, 0, 31, 31, 8, 8, 8, 8) +SKIN.tex.ProgressBar.Front = GWEN.CreateTextureBorder(384+32, 0, 31, 31, 8, 8, 8, 8) SKIN.tex.CategoryList = {} -SKIN.tex.CategoryList.Outer = GWEN.CreateTextureBorder( 256, 384, 63, 63, 8, 8, 8, 8 ) -SKIN.tex.CategoryList.Inner = GWEN.CreateTextureBorder( 320, 384, 63, 63, 8, 21, 8, 8 ) -SKIN.tex.CategoryList.Header = GWEN.CreateTextureBorder( 320, 352, 63, 31, 8, 8, 8, 8 ) +SKIN.tex.CategoryList.Outer = GWEN.CreateTextureBorder(256, 384, 63, 63, 8, 8, 8, 8) +SKIN.tex.CategoryList.Inner = GWEN.CreateTextureBorder(320, 384, 63, 63, 8, 21, 8, 8) +SKIN.tex.CategoryList.Header = GWEN.CreateTextureBorder(320, 352, 63, 31, 8, 8, 8, 8) -SKIN.tex.Tooltip = GWEN.CreateTextureBorder( 384, 64, 31, 31, 8, 8, 8, 8 ) +SKIN.tex.Tooltip = GWEN.CreateTextureBorder(384, 64, 31, 31, 8, 8, 8, 8) SKIN.Colours = {} SKIN.Colours.Window = {} -SKIN.Colours.Window.TitleActive = GWEN.TextureColor( 4 + 8 * 0, 508 ) -SKIN.Colours.Window.TitleInactive = GWEN.TextureColor( 4 + 8 * 1, 508 ) +SKIN.Colours.Window.TitleActive = GWEN.TextureColor(4 + 8 * 0, 508) +SKIN.Colours.Window.TitleInactive = GWEN.TextureColor(4 + 8 * 1, 508) SKIN.Colours.Button = {} -SKIN.Colours.Button.Normal = GWEN.TextureColor( 4 + 8 * 2, 508 ) -SKIN.Colours.Button.Hover = GWEN.TextureColor( 4 + 8 * 3, 508 ) -SKIN.Colours.Button.Down = GWEN.TextureColor( 4 + 8 * 2, 500 ) -SKIN.Colours.Button.Disabled = GWEN.TextureColor( 4 + 8 * 3, 500 ) +SKIN.Colours.Button.Normal = GWEN.TextureColor(4 + 8 * 2, 508) +SKIN.Colours.Button.Hover = GWEN.TextureColor(4 + 8 * 3, 508) +SKIN.Colours.Button.Down = GWEN.TextureColor(4 + 8 * 2, 500) +SKIN.Colours.Button.Disabled = GWEN.TextureColor(4 + 8 * 3, 500) SKIN.Colours.Tab = {} SKIN.Colours.Tab.Active = {} -SKIN.Colours.Tab.Active.Normal = GWEN.TextureColor( 4 + 8 * 4, 508 ) -SKIN.Colours.Tab.Active.Hover = GWEN.TextureColor( 4 + 8 * 5, 508 ) -SKIN.Colours.Tab.Active.Down = GWEN.TextureColor( 4 + 8 * 4, 500 ) -SKIN.Colours.Tab.Active.Disabled = GWEN.TextureColor( 4 + 8 * 5, 500 ) +SKIN.Colours.Tab.Active.Normal = GWEN.TextureColor(4 + 8 * 4, 508) +SKIN.Colours.Tab.Active.Hover = GWEN.TextureColor(4 + 8 * 5, 508) +SKIN.Colours.Tab.Active.Down = GWEN.TextureColor(4 + 8 * 4, 500) +SKIN.Colours.Tab.Active.Disabled = GWEN.TextureColor(4 + 8 * 5, 500) SKIN.Colours.Tab.Inactive = {} -SKIN.Colours.Tab.Inactive.Normal = GWEN.TextureColor( 4 + 8 * 6, 508 ) -SKIN.Colours.Tab.Inactive.Hover = GWEN.TextureColor( 4 + 8 * 7, 508 ) -SKIN.Colours.Tab.Inactive.Down = GWEN.TextureColor( 4 + 8 * 6, 500 ) -SKIN.Colours.Tab.Inactive.Disabled = GWEN.TextureColor( 4 + 8 * 7, 500 ) +SKIN.Colours.Tab.Inactive.Normal = GWEN.TextureColor(4 + 8 * 6, 508) +SKIN.Colours.Tab.Inactive.Hover = GWEN.TextureColor(4 + 8 * 7, 508) +SKIN.Colours.Tab.Inactive.Down = GWEN.TextureColor(4 + 8 * 6, 500) +SKIN.Colours.Tab.Inactive.Disabled = GWEN.TextureColor(4 + 8 * 7, 500) SKIN.Colours.Label = {} -SKIN.Colours.Label.Default = GWEN.TextureColor( 4 + 8 * 8, 508 ) -SKIN.Colours.Label.Bright = GWEN.TextureColor( 4 + 8 * 9, 508 ) -SKIN.Colours.Label.Dark = GWEN.TextureColor( 4 + 8 * 8, 500 ) -SKIN.Colours.Label.Highlight = GWEN.TextureColor( 4 + 8 * 9, 500 ) +SKIN.Colours.Label.Default = GWEN.TextureColor(4 + 8 * 8, 508) +SKIN.Colours.Label.Bright = GWEN.TextureColor(4 + 8 * 9, 508) +SKIN.Colours.Label.Dark = GWEN.TextureColor(4 + 8 * 8, 500) +SKIN.Colours.Label.Highlight = GWEN.TextureColor(4 + 8 * 9, 500) SKIN.Colours.Tree = {} -SKIN.Colours.Tree.Lines = GWEN.TextureColor( 4 + 8 * 10, 508 ) ---- !!! -SKIN.Colours.Tree.Normal = GWEN.TextureColor( 4 + 8 * 11, 508 ) -SKIN.Colours.Tree.Hover = GWEN.TextureColor( 4 + 8 * 10, 500 ) -SKIN.Colours.Tree.Selected = GWEN.TextureColor( 4 + 8 * 11, 500 ) +SKIN.Colours.Tree.Lines = GWEN.TextureColor(4 + 8 * 10, 508) +SKIN.Colours.Tree.Normal = GWEN.TextureColor(4 + 8 * 11, 508) +SKIN.Colours.Tree.Hover = GWEN.TextureColor(4 + 8 * 10, 500) +SKIN.Colours.Tree.Selected = GWEN.TextureColor(4 + 8 * 11, 500) SKIN.Colours.Properties = {} -SKIN.Colours.Properties.Line_Normal = GWEN.TextureColor( 4 + 8 * 12, 508 ) -SKIN.Colours.Properties.Line_Selected = GWEN.TextureColor( 4 + 8 * 13, 508 ) -SKIN.Colours.Properties.Line_Hover = GWEN.TextureColor( 4 + 8 * 12, 500 ) -SKIN.Colours.Properties.Title = GWEN.TextureColor( 4 + 8 * 13, 500 ) -SKIN.Colours.Properties.Column_Normal = GWEN.TextureColor( 4 + 8 * 14, 508 ) -SKIN.Colours.Properties.Column_Selected = GWEN.TextureColor( 4 + 8 * 15, 508 ) -SKIN.Colours.Properties.Column_Hover = GWEN.TextureColor( 4 + 8 * 14, 500 ) -SKIN.Colours.Properties.Column_Disabled = Color( 240, 240, 240 ) -SKIN.Colours.Properties.Border = GWEN.TextureColor( 4 + 8 * 15, 500 ) -SKIN.Colours.Properties.Label_Normal = GWEN.TextureColor( 4 + 8 * 16, 508 ) -SKIN.Colours.Properties.Label_Selected = GWEN.TextureColor( 4 + 8 * 17, 508 ) -SKIN.Colours.Properties.Label_Hover = GWEN.TextureColor( 4 + 8 * 16, 500 ) -SKIN.Colours.Properties.Label_Disabled = GWEN.TextureColor( 4 + 8 * 16, 508 ) +SKIN.Colours.Properties.Line_Normal = GWEN.TextureColor(4 + 8 * 12, 508) +SKIN.Colours.Properties.Line_Selected = GWEN.TextureColor(4 + 8 * 13, 508) +SKIN.Colours.Properties.Line_Hover = GWEN.TextureColor(4 + 8 * 12, 500) +SKIN.Colours.Properties.Title = GWEN.TextureColor(4 + 8 * 13, 500) +SKIN.Colours.Properties.Column_Normal = GWEN.TextureColor(4 + 8 * 14, 508) +SKIN.Colours.Properties.Column_Selected = GWEN.TextureColor(4 + 8 * 15, 508) +SKIN.Colours.Properties.Column_Hover = GWEN.TextureColor(4 + 8 * 14, 500) +SKIN.Colours.Properties.Column_Disabled = Color(240, 240, 240) +SKIN.Colours.Properties.Border = GWEN.TextureColor(4 + 8 * 15, 500) +SKIN.Colours.Properties.Label_Normal = GWEN.TextureColor(4 + 8 * 16, 508) +SKIN.Colours.Properties.Label_Selected = GWEN.TextureColor(4 + 8 * 17, 508) +SKIN.Colours.Properties.Label_Hover = GWEN.TextureColor(4 + 8 * 16, 500) +SKIN.Colours.Properties.Label_Disabled = GWEN.TextureColor(4 + 8 * 16, 508) SKIN.Colours.Category = {} -SKIN.Colours.Category.Header = GWEN.TextureColor( 4 + 8 * 18, 500 ) -SKIN.Colours.Category.Header_Closed = GWEN.TextureColor( 4 + 8 * 19, 500 ) -SKIN.Colours.Category.Line = {} -SKIN.Colours.Category.Line.Text = GWEN.TextureColor( 4 + 8 * 20, 508 ) -SKIN.Colours.Category.Line.Text_Hover = GWEN.TextureColor( 4 + 8 * 21, 508 ) -SKIN.Colours.Category.Line.Text_Selected = GWEN.TextureColor( 4 + 8 * 20, 500 ) -SKIN.Colours.Category.Line.Button = GWEN.TextureColor( 4 + 8 * 21, 500 ) -SKIN.Colours.Category.Line.Button_Hover = GWEN.TextureColor( 4 + 8 * 22, 508 ) -SKIN.Colours.Category.Line.Button_Selected = GWEN.TextureColor( 4 + 8 * 23, 508 ) -SKIN.Colours.Category.LineAlt = {} -SKIN.Colours.Category.LineAlt.Text = GWEN.TextureColor( 4 + 8 * 22, 500 ) -SKIN.Colours.Category.LineAlt.Text_Hover = GWEN.TextureColor( 4 + 8 * 23, 500 ) -SKIN.Colours.Category.LineAlt.Text_Selected = GWEN.TextureColor( 4 + 8 * 24, 508 ) -SKIN.Colours.Category.LineAlt.Button = GWEN.TextureColor( 4 + 8 * 25, 508 ) -SKIN.Colours.Category.LineAlt.Button_Hover = GWEN.TextureColor( 4 + 8 * 24, 500 ) -SKIN.Colours.Category.LineAlt.Button_Selected = GWEN.TextureColor( 4 + 8 * 25, 500 ) +SKIN.Colours.Category.Header = GWEN.TextureColor(4 + 8 * 18, 500) +SKIN.Colours.Category.Header_Closed = GWEN.TextureColor(4 + 8 * 19, 500) -SKIN.Colours.TooltipText = GWEN.TextureColor( 4 + 8 * 26, 500 ) +SKIN.Colours.Category.Line = {} +SKIN.Colours.Category.Line.Text = GWEN.TextureColor(4 + 8 * 20, 508) +SKIN.Colours.Category.Line.Text_Hover = GWEN.TextureColor(4 + 8 * 21, 508) +SKIN.Colours.Category.Line.Text_Selected = GWEN.TextureColor(4 + 8 * 20, 500) +SKIN.Colours.Category.Line.Button = GWEN.TextureColor(4 + 8 * 21, 500) +SKIN.Colours.Category.Line.Button_Hover = GWEN.TextureColor(4 + 8 * 22, 508) +SKIN.Colours.Category.Line.Button_Selected = GWEN.TextureColor(4 + 8 * 23, 508) + +SKIN.Colours.Category.LineAlt = {} +SKIN.Colours.Category.LineAlt.Text = GWEN.TextureColor(4 + 8 * 22, 500) +SKIN.Colours.Category.LineAlt.Text_Hover = GWEN.TextureColor(4 + 8 * 23, 500) +SKIN.Colours.Category.LineAlt.Text_Selected = GWEN.TextureColor(4 + 8 * 24, 508) +SKIN.Colours.Category.LineAlt.Button = GWEN.TextureColor(4 + 8 * 25, 508) +SKIN.Colours.Category.LineAlt.Button_Hover = GWEN.TextureColor(4 + 8 * 24, 500) +SKIN.Colours.Category.LineAlt.Button_Selected = GWEN.TextureColor(4 + 8 * 25, 500) + +SKIN.Colours.TooltipText = GWEN.TextureColor(4 + 8 * 26, 500) --[[--------------------------------------------------------- Panel -----------------------------------------------------------]] -function SKIN:PaintPanel( panel, w, h ) - - if ( !panel.m_bBackground ) then return end - self.tex.Panels.Normal( 0, 0, w, h, panel.m_bgColor ) +function SKIN:PaintPanel(panel, w, h) + if not panel.m_bBackground then return end + self.tex.Panels.Normal(0, 0, w, h, panel.m_bgColor) end --[[--------------------------------------------------------- Panel -----------------------------------------------------------]] -function SKIN:PaintShadow( panel, w, h ) - - SKIN.tex.Shadow( 0, 0, w, h ) - +function SKIN:PaintShadow(panel, w, h) + SKIN.tex.Shadow(0, 0, w, h) end --[[--------------------------------------------------------- Frame -----------------------------------------------------------]] -function SKIN:PaintFrame( panel, w, h ) - - if ( panel.m_bPaintShadow ) then - - local wasEnabled = DisableClipping( true ) - SKIN.tex.Shadow( -4, -4, w+10, h+10 ) - DisableClipping( wasEnabled ) - +function SKIN:PaintFrame(panel, w, h) + if panel.m_bPaintShadow then + local wasEnabled = DisableClipping(true) + SKIN.tex.Shadow(-4, -4, w+10, h+10) + DisableClipping(wasEnabled) end - if ( panel:HasHierarchicalFocus() ) then - - self.tex.Window.Normal( 0, 0, w, h ) - + if panel:HasHierarchicalFocus() then + self.tex.Window.Normal(0, 0, w, h) else - - self.tex.Window.Inactive( 0, 0, w, h ) - + self.tex.Window.Inactive(0, 0, w, h) end - end --[[--------------------------------------------------------- Button -----------------------------------------------------------]] -function SKIN:PaintButton( panel, w, h ) +function SKIN:PaintButton(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel.Depressed || panel:IsSelected() || panel:GetToggle() ) then - return self.tex.Button_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() || panel:GetToggle() then + return self.tex.Button_Down(0, 0, w, h) end - if ( panel:GetDisabled() ) then - return self.tex.Button_Dead( 0, 0, w, h ) + if panel:GetDisabled() then + return self.tex.Button_Dead(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Button_Hovered( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Button_Hovered(0, 0, w, h) end - self.tex.Button( 0, 0, w, h ) - + self.tex.Button(0, 0, w, h) end --[[--------------------------------------------------------- Tree -----------------------------------------------------------]] -function SKIN:PaintTree( panel, w, h ) - - if ( !panel.m_bBackground ) then return end - - self.tex.Tree( 0, 0, w, h, panel.m_bgColor ) +function SKIN:PaintTree(panel, w, h) + if not panel.m_bBackground then return end + self.tex.Tree(0, 0, w, h, panel.m_bgColor) end --[[--------------------------------------------------------- CheckBox -----------------------------------------------------------]] -function SKIN:PaintCheckBox( panel, w, h ) - - if ( panel:GetChecked() ) then - - if ( panel:GetDisabled() ) then - self.tex.CheckboxD_Checked( 0, 0, w, h ) +function SKIN:PaintCheckBox(panel, w, h) + if panel:GetChecked() then + if panel:GetDisabled() then + self.tex.CheckboxD_Checked(0, 0, w, h) else - self.tex.Checkbox_Checked( 0, 0, w, h ) + self.tex.Checkbox_Checked(0, 0, w, h) end - else - - if ( panel:GetDisabled() ) then - self.tex.CheckboxD( 0, 0, w, h ) + if panel:GetDisabled() then + self.tex.CheckboxD(0, 0, w, h) else - self.tex.Checkbox( 0, 0, w, h ) + self.tex.Checkbox(0, 0, w, h) end - end - end --[[--------------------------------------------------------- RadioButton -----------------------------------------------------------]] -function SKIN:PaintRadioButton( panel, w, h ) - - if ( panel:GetChecked() ) then - - if ( panel:GetDisabled() ) then - self.tex.RadioButtonD_Checked( 0, 0, w, h ) +function SKIN:PaintRadioButton(panel, w, h) + if panel:GetChecked() then + if panel:GetDisabled() then + self.tex.RadioButtonD_Checked(0, 0, w, h) else - self.tex.RadioButton_Checked( 0, 0, w, h ) + self.tex.RadioButton_Checked(0, 0, w, h) end - else - - if ( panel:GetDisabled() ) then - self.tex.RadioButtonD( 0, 0, w, h ) + if panel:GetDisabled() then + self.tex.RadioButtonD(0, 0, w, h) else - self.tex.RadioButton( 0, 0, w, h ) + self.tex.RadioButton(0, 0, w, h) end - end - end --[[--------------------------------------------------------- ExpandButton -----------------------------------------------------------]] -function SKIN:PaintExpandButton( panel, w, h ) - - if ( !panel:GetExpanded() ) then - self.tex.TreePlus( 0, 0, w, h ) +function SKIN:PaintExpandButton(panel, w, h) + if not panel:GetExpanded() then + self.tex.TreePlus(0, 0, w, h) else - self.tex.TreeMinus( 0, 0, w, h ) + self.tex.TreeMinus(0, 0, w, h) end - end --[[--------------------------------------------------------- TextEntry -----------------------------------------------------------]] -function SKIN:PaintTextEntry( panel, w, h ) - - if ( panel.m_bBackground ) then - - if ( panel:GetDisabled() ) then - self.tex.TextBox_Disabled( 0, 0, w, h ) - elseif ( panel:HasFocus() ) then - self.tex.TextBox_Focus( 0, 0, w, h ) +function SKIN:PaintTextEntry(panel, w, h) + if panel.m_bBackground then + if panel:GetDisabled() then + self.tex.TextBox_Disabled(0, 0, w, h) + elseif panel:HasFocus() then + self.tex.TextBox_Focus(0, 0, w, h) else - self.tex.TextBox( 0, 0, w, h ) + self.tex.TextBox(0, 0, w, h) end - end - -- Hack on a hack, but this produces the most close appearance to what it will actually look if text was actually there - if ( panel.GetPlaceholderText && panel.GetPlaceholderColor && panel:GetPlaceholderText() && panel:GetPlaceholderText():Trim() != "" && panel:GetPlaceholderColor() && ( !panel:GetText() || panel:GetText() == "" ) ) then - + if panel.GetPlaceholderText and panel.GetPlaceholderColor and panel:GetPlaceholderText() + and panel:GetPlaceholderText():Trim() ~= "" and panel:GetPlaceholderColor() + and (not panel:GetText() or panel:GetText() == "") + then local oldText = panel:GetText() local str = panel:GetPlaceholderText() - if ( str:StartWith( "#" ) ) then str = str:sub( 2 ) end - str = language.GetPhrase( str ) + if str:StartWith("#") then str = str:sub(2) end + str = language.GetPhrase(str) - panel:SetText( str ) - panel:DrawTextEntryText( panel:GetPlaceholderColor(), panel:GetHighlightColor(), self.Colours.Label.Dark ) - panel:SetText( oldText ) + panel:SetText(str) + panel:DrawTextEntryText(panel:GetPlaceholderColor(), panel:GetHighlightColor(), self.Colours.Label.Dark) + panel:SetText(oldText) return end - panel:DrawTextEntryText( self.Colours.Label.Dark, panel:GetHighlightColor(), self.Colours.Label.Dark ) - + panel:DrawTextEntryText(self.Colours.Label.Dark, panel:GetHighlightColor(), self.Colours.Label.Dark) end --[[--------------------------------------------------------- Menu -----------------------------------------------------------]] -function SKIN:PaintMenu( panel, w, h ) - - if ( panel:GetDrawColumn() ) then - self.tex.MenuBG_Column( 0, 0, w, h ) +function SKIN:PaintMenu(panel, w, h) + if panel:GetDrawColumn() then + self.tex.MenuBG_Column(0, 0, w, h) else - self.tex.MenuBG( 0, 0, w, h ) + self.tex.MenuBG(0, 0, w, h) end - end --[[--------------------------------------------------------- Menu -----------------------------------------------------------]] -function SKIN:PaintMenuSpacer( panel, w, h ) - - surface.SetDrawColor( ColorAlpha(self.Colours.Label.Dark, 100) ) - surface.DrawRect( 0, 0, w, h ) - +function SKIN:PaintMenuSpacer(panel, w, h) + surface.SetDrawColor(ColorAlpha(self.Colours.Label.Dark, 100)) + surface.DrawRect(0, 0, w, h) end --[[--------------------------------------------------------- MenuOption -----------------------------------------------------------]] -function SKIN:PaintMenuOption( panel, w, h ) - - if ( panel.m_bBackground && !panel:IsEnabled() ) then - surface.SetDrawColor( ColorAlpha(self.Colours.Label.Dark, 50) ) - surface.DrawRect( 0, 0, w, h ) +function SKIN:PaintMenuOption(panel, w, h) + if panel.m_bBackground && not panel:IsEnabled() then + surface.SetDrawColor(ColorAlpha(self.Colours.Label.Dark, 50)) + surface.DrawRect(0, 0, w, h) end - if ( panel.m_bBackground && ( panel.Hovered || panel.Highlight) ) then - self.tex.MenuBG_Hover( 0, 0, w, h ) + if panel.m_bBackground && (panel.Hovered || panel.Highlight) then + self.tex.MenuBG_Hover(0, 0, w, h) end - if ( panel:GetChecked() ) then - self.tex.Menu_Check( 5, h / 2 - 7, 15, 15 ) + if panel:GetChecked() then + self.tex.Menu_Check(5, h / 2 - 7, 15, 15) end - end --[[--------------------------------------------------------- MenuRightArrow -----------------------------------------------------------]] -function SKIN:PaintMenuRightArrow( panel, w, h ) - - self.tex.Menu.RightArrow( 0, 0, w, h ) - +function SKIN:PaintMenuRightArrow(panel, w, h) + self.tex.Menu.RightArrow(0, 0, w, h) end --[[--------------------------------------------------------- PropertySheet -----------------------------------------------------------]] -function SKIN:PaintPropertySheet( panel, w, h ) - - -- TODO: Tabs at bottom, left, right - +function SKIN:PaintPropertySheet(panel, w, h) local ActiveTab = panel:GetActiveTab() local Offset = 0 - if ( ActiveTab ) then Offset = ActiveTab:GetTall() - 8 end - self.tex.Tab_Control( 0, Offset, w, h-Offset ) + if ActiveTab then + Offset = ActiveTab:GetTall() - 8 + end + self.tex.Tab_Control(0, Offset, w, h-Offset) end --[[--------------------------------------------------------- Tab -----------------------------------------------------------]] -function SKIN:PaintTab( panel, w, h ) - - if ( panel:IsActive() ) then - return self:PaintActiveTab( panel, w, h ) +function SKIN:PaintTab(panel, w, h) + if panel:IsActive() then + return self:PaintActiveTab(panel, w, h) end - self.tex.TabT_Inactive( 0, 0, w, h ) - + self.tex.TabT_Inactive(0, 0, w, h) end -function SKIN:PaintActiveTab( panel, w, h ) - - self.tex.TabT_Active( 0, 0, w, h ) - +function SKIN:PaintActiveTab(panel, w, h) + self.tex.TabT_Active(0, 0, w, h) end --[[--------------------------------------------------------- Button -----------------------------------------------------------]] -function SKIN:PaintWindowCloseButton( panel, w, h ) +function SKIN:PaintWindowCloseButton(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel:GetDisabled() ) then - return self.tex.Window.Close( 0, 0, w, h, Color( 255, 255, 255, 50 ) ) + if panel:GetDisabled() then + return self.tex.Window.Close(0, 0, w, h, Color(255, 255, 255, 50)) end - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Window.Close_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Window.Close_Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Window.Close_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Window.Close_Hover(0, 0, w, h) end - self.tex.Window.Close( 0, 0, w, h ) - + self.tex.Window.Close(0, 0, w, h) end -function SKIN:PaintWindowMinimizeButton( panel, w, h ) +function SKIN:PaintWindowMinimizeButton(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel:GetDisabled() ) then - return self.tex.Window.Mini( 0, 0, w, h, Color( 255, 255, 255, 50 ) ) + if panel:GetDisabled() then + return self.tex.Window.Mini(0, 0, w, h, Color(255, 255, 255, 50)) end - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Window.Mini_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Window.Mini_Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Window.Mini_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Window.Mini_Hover(0, 0, w, h) end - self.tex.Window.Mini( 0, 0, w, h ) - + self.tex.Window.Mini(0, 0, w, h) end -function SKIN:PaintWindowMaximizeButton( panel, w, h ) +function SKIN:PaintWindowMaximizeButton(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel:GetDisabled() ) then - return self.tex.Window.Maxi( 0, 0, w, h, Color( 255, 255, 255, 50 ) ) + if panel:GetDisabled() then + return self.tex.Window.Maxi(0, 0, w, h, Color(255, 255, 255, 50)) end - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Window.Maxi_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Window.Maxi_Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Window.Maxi_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Window.Maxi_Hover(0, 0, w, h) end - self.tex.Window.Maxi( 0, 0, w, h ) - + self.tex.Window.Maxi(0, 0, w, h) end --[[--------------------------------------------------------- VScrollBar -----------------------------------------------------------]] -function SKIN:PaintVScrollBar( panel, w, h ) - - self.tex.Scroller.TrackV( 0, 0, w, h ) - +function SKIN:PaintVScrollBar(panel, w, h) + self.tex.Scroller.TrackV(0, 0, w, h) end --[[--------------------------------------------------------- ScrollBarGrip -----------------------------------------------------------]] -function SKIN:PaintScrollBarGrip( panel, w, h ) - - if ( panel:GetDisabled() ) then - return self.tex.Scroller.ButtonV_Disabled( 0, 0, w, h ) +function SKIN:PaintScrollBarGrip(panel, w, h) + if panel:GetDisabled() then + return self.tex.Scroller.ButtonV_Disabled(0, 0, w, h) end - if ( panel.Depressed ) then - return self.tex.Scroller.ButtonV_Down( 0, 0, w, h ) + if panel.Depressed then + return self.tex.Scroller.ButtonV_Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Scroller.ButtonV_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Scroller.ButtonV_Hover(0, 0, w, h) end - return self.tex.Scroller.ButtonV_Normal( 0, 0, w, h ) - + return self.tex.Scroller.ButtonV_Normal(0, 0, w, h) end --[[--------------------------------------------------------- ButtonDown -----------------------------------------------------------]] -function SKIN:PaintButtonDown( panel, w, h ) +function SKIN:PaintButtonDown(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Scroller.DownButton_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Scroller.DownButton_Down(0, 0, w, h) end - if ( panel:GetDisabled() ) then - return self.tex.Scroller.DownButton_Dead( 0, 0, w, h ) + if panel:GetDisabled() then + return self.tex.Scroller.DownButton_Dead(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Scroller.DownButton_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Scroller.DownButton_Hover(0, 0, w, h) end - self.tex.Scroller.DownButton_Normal( 0, 0, w, h ) - + self.tex.Scroller.DownButton_Normal(0, 0, w, h) end --[[--------------------------------------------------------- ButtonUp -----------------------------------------------------------]] -function SKIN:PaintButtonUp( panel, w, h ) +function SKIN:PaintButtonUp(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Scroller.UpButton_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Scroller.UpButton_Down(0, 0, w, h) end - if ( panel:GetDisabled() ) then - return self.tex.Scroller.UpButton_Dead( 0, 0, w, h ) + if panel:GetDisabled() then + return self.tex.Scroller.UpButton_Dead(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Scroller.UpButton_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Scroller.UpButton_Hover(0, 0, w, h) end - self.tex.Scroller.UpButton_Normal( 0, 0, w, h ) - + self.tex.Scroller.UpButton_Normal(0, 0, w, h) end --[[--------------------------------------------------------- ButtonLeft -----------------------------------------------------------]] -function SKIN:PaintButtonLeft( panel, w, h ) +function SKIN:PaintButtonLeft(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Scroller.LeftButton_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Scroller.LeftButton_Down(0, 0, w, h) end - if ( panel:GetDisabled() ) then - return self.tex.Scroller.LeftButton_Dead( 0, 0, w, h ) + if panel:GetDisabled() then + return self.tex.Scroller.LeftButton_Dead(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Scroller.LeftButton_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Scroller.LeftButton_Hover(0, 0, w, h) end - self.tex.Scroller.LeftButton_Normal( 0, 0, w, h ) - + self.tex.Scroller.LeftButton_Normal(0, 0, w, h) end --[[--------------------------------------------------------- ButtonRight -----------------------------------------------------------]] -function SKIN:PaintButtonRight( panel, w, h ) +function SKIN:PaintButtonRight(panel, w, h) + if not panel.m_bBackground then return end - if ( !panel.m_bBackground ) then return end - - if ( panel.Depressed || panel:IsSelected() ) then - return self.tex.Scroller.RightButton_Down( 0, 0, w, h ) + if panel.Depressed || panel:IsSelected() then + return self.tex.Scroller.RightButton_Down(0, 0, w, h) end - if ( panel:GetDisabled() ) then - return self.tex.Scroller.RightButton_Dead( 0, 0, w, h ) + if panel:GetDisabled() then + return self.tex.Scroller.RightButton_Dead(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Scroller.RightButton_Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Scroller.RightButton_Hover(0, 0, w, h) end - self.tex.Scroller.RightButton_Normal( 0, 0, w, h ) - + self.tex.Scroller.RightButton_Normal(0, 0, w, h) end --[[--------------------------------------------------------- ComboDownArrow -----------------------------------------------------------]] -function SKIN:PaintComboDownArrow( panel, w, h ) - - if ( panel.ComboBox:GetDisabled() ) then - return self.tex.Input.ComboBox.Button.Disabled( 0, 0, w, h ) +function SKIN:PaintComboDownArrow(panel, w, h) + if panel.ComboBox:GetDisabled() then + return self.tex.Input.ComboBox.Button.Disabled(0, 0, w, h) end - if ( panel.ComboBox.Depressed || panel.ComboBox:IsMenuOpen() ) then - return self.tex.Input.ComboBox.Button.Down( 0, 0, w, h ) + if panel.ComboBox.Depressed || panel.ComboBox:IsMenuOpen() then + return self.tex.Input.ComboBox.Button.Down(0, 0, w, h) end - if ( panel.ComboBox.Hovered ) then - return self.tex.Input.ComboBox.Button.Hover( 0, 0, w, h ) + if panel.ComboBox.Hovered then + return self.tex.Input.ComboBox.Button.Hover(0, 0, w, h) end - self.tex.Input.ComboBox.Button.Normal( 0, 0, w, h ) - + self.tex.Input.ComboBox.Button.Normal(0, 0, w, h) end --[[--------------------------------------------------------- ComboBox -----------------------------------------------------------]] -function SKIN:PaintComboBox( panel, w, h ) - - if ( panel:GetDisabled() ) then - return self.tex.Input.ComboBox.Disabled( 0, 0, w, h ) +function SKIN:PaintComboBox(panel, w, h) + if panel:GetDisabled() then + return self.tex.Input.ComboBox.Disabled(0, 0, w, h) end - if ( panel.Depressed || panel:IsMenuOpen() ) then - return self.tex.Input.ComboBox.Down( 0, 0, w, h ) + if panel.Depressed || panel:IsMenuOpen() then + return self.tex.Input.ComboBox.Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Input.ComboBox.Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Input.ComboBox.Hover(0, 0, w, h) end - self.tex.Input.ComboBox.Normal( 0, 0, w, h ) - + self.tex.Input.ComboBox.Normal(0, 0, w, h) end --[[--------------------------------------------------------- ComboBox -----------------------------------------------------------]] -function SKIN:PaintListBox( panel, w, h ) - - self.tex.Input.ListBox.Background( 0, 0, w, h ) - +function SKIN:PaintListBox(panel, w, h) + self.tex.Input.ListBox.Background(0, 0, w, h) end --[[--------------------------------------------------------- NumberUp -----------------------------------------------------------]] -function SKIN:PaintNumberUp( panel, w, h ) - - if ( panel:GetDisabled() ) then - return self.tex.Input.UpDown.Up.Disabled( 0, 0, w, h ) +function SKIN:PaintNumberUp(panel, w, h) + if panel:GetDisabled() then + return self.tex.Input.UpDown.Up.Disabled(0, 0, w, h) end - if ( panel.Depressed ) then - return self.tex.Input.UpDown.Up.Down( 0, 0, w, h ) + if panel.Depressed then + return self.tex.Input.UpDown.Up.Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Input.UpDown.Up.Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Input.UpDown.Up.Hover(0, 0, w, h) end - self.tex.Input.UpDown.Up.Normal( 0, 0, w, h ) - + self.tex.Input.UpDown.Up.Normal(0, 0, w, h) end --[[--------------------------------------------------------- NumberDown -----------------------------------------------------------]] -function SKIN:PaintNumberDown( panel, w, h ) - - if ( panel:GetDisabled() ) then - return self.tex.Input.UpDown.Down.Disabled( 0, 0, w, h ) +function SKIN:PaintNumberDown(panel, w, h) + if panel:GetDisabled() then + return self.tex.Input.UpDown.Down.Disabled(0, 0, w, h) end - if ( panel.Depressed ) then - return self.tex.Input.UpDown.Down.Down( 0, 0, w, h ) + if panel.Depressed then + return self.tex.Input.UpDown.Down.Down(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Input.UpDown.Down.Hover( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Input.UpDown.Down.Hover(0, 0, w, h) end - self.tex.Input.UpDown.Down.Normal( 0, 0, w, h ) - + self.tex.Input.UpDown.Down.Normal(0, 0, w, h) end -function SKIN:PaintTreeNode( panel, w, h ) +function SKIN:PaintTreeNode(panel, w, h) + if not panel.m_bDrawLines then return end - if ( !panel.m_bDrawLines ) then return end - - surface.SetDrawColor( self.Colours.Tree.Lines ) - - if ( panel.m_bLastChild ) then - - surface.DrawRect( 9, 0, 1, 7 ) - surface.DrawRect( 9, 7, 9, 1 ) + surface.SetDrawColor(self.Colours.Tree.Lines) + if panel.m_bLastChild then + surface.DrawRect(9, 0, 1, 7) + surface.DrawRect(9, 7, 9, 1) else - surface.DrawRect( 9, 0, 1, h ) - surface.DrawRect( 9, 7, 9, 1 ) + surface.DrawRect(9, 0, 1, h) + surface.DrawRect(9, 7, 9, 1) end - end -function SKIN:PaintTreeNodeButton( panel, w, h ) - - if ( !panel.m_bSelected ) then return end - +function SKIN:PaintTreeNodeButton(panel, w, h) + if not panel.m_bSelected then return end -- Don't worry this isn't working out the size every render -- it just gets the cached value from inside the Label local w, _ = panel:GetTextSize() - - self.tex.Selection( 38, 0, w + 6, h ) - + self.tex.Selection(38, 0, w + 6, h) end -function SKIN:PaintSelection( panel, w, h ) - - self.tex.Selection( 0, 0, w, h ) - +function SKIN:PaintSelection(panel, w, h) + self.tex.Selection(0, 0, w, h) end -function SKIN:PaintSliderKnob( panel, w, h ) - - if ( panel:GetDisabled() ) then return self.tex.Input.Slider.H.Disabled( 0, 0, w, h ) end - - if ( panel.Depressed ) then - return self.tex.Input.Slider.H.Down( 0, 0, w, h ) +function SKIN:PaintSliderKnob(panel, w, h) + if panel:GetDisabled() then + return self.tex.Input.Slider.H.Disabled(0, 0, w, h) end - if ( panel.Hovered ) then - return self.tex.Input.Slider.H.Hover( 0, 0, w, h ) + if panel.Depressed then + return self.tex.Input.Slider.H.Down(0, 0, w, h) end - self.tex.Input.Slider.H.Normal( 0, 0, w, h ) + if panel.Hovered then + return self.tex.Input.Slider.H.Hover(0, 0, w, h) + end + self.tex.Input.Slider.H.Normal(0, 0, w, h) end -local function PaintNotches( x, y, w, h, num ) - - if ( !num ) then return end +local function PaintNotches(x, y, w, h, num) + if not num then return end local space = w / num - for i=0, num do + surface.DrawRect(x + i * space, y + 4, 1, 5) + end +end - surface.DrawRect( x + i * space, y + 4, 1, 5 ) +function SKIN:PaintNumSlider(panel, w, h) + surface.SetDrawColor(ColorAlpha(self.Colours.Label.Dark, 100)) + surface.DrawRect(8, h / 2 - 1, w - 15, 1) + PaintNotches(8, h / 2 - 1, w - 16, 1, panel.m_iNotches) +end + +function SKIN:PaintProgress(panel, w, h) + self.tex.ProgressBar.Back(0, 0, w, h) + self.tex.ProgressBar.Front(0, 0, w * panel:GetFraction(), h) +end + +function SKIN:PaintCollapsibleCategory(panel, w, h) + if h < 21 then + return self.tex.CategoryList.Header(0, 0, w, h) end + self.tex.CategoryList.Inner(0, 0, w, 63) end -function SKIN:PaintNumSlider( panel, w, h ) - - surface.SetDrawColor( ColorAlpha(self.Colours.Label.Dark, 100) ) - surface.DrawRect( 8, h / 2 - 1, w - 15, 1 ) - - PaintNotches( 8, h / 2 - 1, w - 16, 1, panel.m_iNotches ) - +function SKIN:PaintCategoryList(panel, w, h) + self.tex.CategoryList.Outer(0, 0, w, h, panel:GetBackgroundColor()) end -function SKIN:PaintProgress( panel, w, h ) - - self.tex.ProgressBar.Back( 0, 0, w, h ) - self.tex.ProgressBar.Front( 0, 0, w * panel:GetFraction(), h ) - -end - -function SKIN:PaintCollapsibleCategory( panel, w, h ) - - if ( h < 21 ) then - return self.tex.CategoryList.Header( 0, 0, w, h ) - end - - self.tex.CategoryList.Inner( 0, 0, w, 63 ) - -end - -function SKIN:PaintCategoryList( panel, w, h ) - - self.tex.CategoryList.Outer( 0, 0, w, h, panel:GetBackgroundColor() ) - -end - -function SKIN:PaintCategoryButton( panel, w, h ) - - if ( panel.AltLine ) then - - if ( panel.Depressed || panel.m_bSelected ) then surface.SetDrawColor( self.Colours.Category.LineAlt.Button_Selected ) - elseif ( panel.Hovered ) then surface.SetDrawColor( self.Colours.Category.LineAlt.Button_Hover ) - else surface.SetDrawColor( self.Colours.Category.LineAlt.Button ) end - +function SKIN:PaintCategoryButton(panel, w, h) + if panel.AltLine then + if panel.Depressed || panel.m_bSelected then + surface.SetDrawColor(self.Colours.Category.LineAlt.Button_Selected) + elseif panel.Hovered then + surface.SetDrawColor(self.Colours.Category.LineAlt.Button_Hover) + else + surface.SetDrawColor(self.Colours.Category.LineAlt.Button) + end else - - if ( panel.Depressed || panel.m_bSelected ) then surface.SetDrawColor( self.Colours.Category.Line.Button_Selected ) - elseif ( panel.Hovered ) then surface.SetDrawColor( self.Colours.Category.Line.Button_Hover ) - else surface.SetDrawColor( self.Colours.Category.Line.Button ) end - + if panel.Depressed || panel.m_bSelected then + surface.SetDrawColor(self.Colours.Category.Line.Button_Selected) + elseif panel.Hovered then + surface.SetDrawColor(self.Colours.Category.Line.Button_Hover) + else + surface.SetDrawColor(self.Colours.Category.Line.Button) + end end - surface.DrawRect( 0, 0, w, h ) - + surface.DrawRect(0, 0, w, h) end -function SKIN:PaintListViewLine( panel, w, h ) - - if ( panel:IsSelected() ) then - - self.tex.Input.ListBox.EvenLineSelected( 0, 0, w, h ) - - elseif ( panel.Hovered ) then - - self.tex.Input.ListBox.Hovered( 0, 0, w, h ) - - elseif ( panel.m_bAlt ) then - - self.tex.Input.ListBox.EvenLine( 0, 0, w, h ) - +function SKIN:PaintListViewLine(panel, w, h) + if panel:IsSelected() then + self.tex.Input.ListBox.EvenLineSelected(0, 0, w, h) + elseif panel.Hovered then + self.tex.Input.ListBox.Hovered(0, 0, w, h) + elseif panel.m_bAlt then + self.tex.Input.ListBox.EvenLine(0, 0, w, h) end - end -function SKIN:PaintListView( panel, w, h ) - - if ( !panel.m_bBackground ) then return end - - self.tex.Input.ListBox.Background( 0, 0, w, h ) +function SKIN:PaintListView(panel, w, h) + if not panel.m_bBackground then return end + self.tex.Input.ListBox.Background(0, 0, w, h) end -function SKIN:PaintTooltip( panel, w, h ) - - self.tex.Tooltip( 0, 0, w, h ) - +function SKIN:PaintTooltip(panel, w, h) + self.tex.Tooltip(0, 0, w, h) end -function SKIN:PaintMenuBar( panel, w, h ) - - self.tex.Menu_Strip( 0, 0, w, h ) - +function SKIN:PaintMenuBar(panel, w, h) + self.tex.Menu_Strip(0, 0, w, h) end -derma.DefineSkin( "themer", "Themer Skin - User Choice", SKIN ) +derma.DefineSkin("themer", "Themer Skin - User Choice", SKIN) diff --git a/lua/themer/iconbrowser.lua b/lua/themer/iconbrowser.lua index 51c87db..efe0c8d 100644 --- a/lua/themer/iconbrowser.lua +++ b/lua/themer/iconbrowser.lua @@ -1,32 +1,43 @@ -local function iconbrowser() - local frame = vgui.Create("DFrame") - frame:SetSize(400,300) - frame:SetPos(5,ScrH()-305) - frame:SetTitle("Icon Browser") - frame:MakePopup() - frame:SetIcon("icon16/folder_picture.png") - local path_pnl = vgui.Create("EditablePanel",frame) - path_pnl:Dock(TOP) - path_pnl:DockMargin(4,0,4,4) - path_pnl:SetTall(24) - local path = vgui.Create("DTextEntry",path_pnl) - path:SetText("") - path:Dock(FILL) - path:SetEditable(false) - local copy = vgui.Create("DButton",path_pnl) - copy:Dock(RIGHT) - copy:SetWide(24) - copy:SetImage("icon16/page_copy.png") - copy:SetText("") - function copy:DoClick() - SetClipboardText(path:GetText()) - end - local browser = vgui.Create("DIconBrowser",frame) - browser:Dock(FILL) - browser:DockMargin(4,0,4,4) - function browser:OnChange() - path:SetText(self:GetSelectedIcon()) - end -end - -concommand.Add("themer_iconbrowser",iconbrowser) \ No newline at end of file +local function iconbrowser() + local frame = vgui.Create("DFrame") do + frame:SetSize(400, 300) + frame:SetPos(5, ScrH() - 305) + frame:SetTitle("Icon Browser") + frame:MakePopup() + frame:SetIcon("icon16/folder_picture.png") + end + + local top_wrapper = vgui.Create("EditablePanel", frame) do + top_wrapper:Dock(TOP) + top_wrapper:DockMargin(4, 0, 4, 4) + top_wrapper:SetTall(24) + end + + local path = vgui.Create("DTextEntry", top_wrapper) do + path:SetText("") + path:Dock(FILL) + path:SetEditable(false) + end + + local copy = vgui.Create("DButton", top_wrapper) do + copy:Dock(RIGHT) + copy:SetWide(24) + copy:SetImage("icon16/page_copy.png") + copy:SetText("") + + function copy:DoClick() + SetClipboardText(path:GetText()) + end + end + + local browser = vgui.Create("DIconBrowser", frame) do + browser:Dock(FILL) + browser:DockMargin(4,0,4,4) + + function browser:OnChange() + path:SetText(self:GetSelectedIcon()) + end + end +end + +concommand.Add("themer_iconbrowser", iconbrowser) diff --git a/lua/themer/main.lua b/lua/themer/main.lua index cff453a..549b95c 100644 --- a/lua/themer/main.lua +++ b/lua/themer/main.lua @@ -1,211 +1,249 @@ -include("themer/iconbrowser.lua") -include("themer/spawnmenu.lua") - ---[[ -File: themer/main.lua -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_options_gear = CreateClientConVar("themer_options_gear", "0", true) -local themer_spawnlist_icons = CreateClientConVar("themer_spawnlist_icons", "0", true) - -local themer_icon_spawnlists = CreateClientConVar("themer_icon_spawnlists", "icon16/application_view_tile.png", true) -local themer_icon_weapons = CreateClientConVar("themer_icon_weapons", "icon16/gun.png", true) -local themer_icon_ents = CreateClientConVar("themer_icon_ents", "icon16/bricks.png", true) -local themer_icon_npcs = CreateClientConVar("themer_icon_npcs", "icon16/group.png", true) -local themer_icon_cars = CreateClientConVar("themer_icon_cars", "icon16/car.png", true) -local themer_icon_pp = CreateClientConVar("themer_icon_pp", "icon16/image.png", true) -local themer_icon_dupes = CreateClientConVar("themer_icon_dupes", "icon16/brick_link.png", true) -local themer_icon_saves = CreateClientConVar("themer_icon_saves", "icon16/disk.png", true) - --- helpers -local function getupvalues(f) - local i, t = 0, {} - - while true do - i = i + 1 - local key, val = debug.getupvalue(f, i) - if not key then break end - t[key] = val - end - - return t -end - ---Main loading -local function ColorHack() - local DMenuOption = table.Copy(vgui.GetControlTable("DMenuOption")) - local DComboBox = table.Copy(vgui.GetControlTable("DComboBox")) - DMenuOption.Init = function(self) - self:SetContentAlignment(4) - self:SetTextInset(30,0) - self:SetTextColor(self:GetSkin().Colours.Label.Dark) - 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) - local cat = self.Categories[name] - if IsValid(cat) then return cat end - - if not bCreate then return end - - cat = self:GetCanvas():Add(tblCategory) - cat.Label:SetText(name) - - cat.Container.Paint = function(pnl, w, h) - self:GetSkin():PaintListBox(pnl, w, h) - end - - self.Categories[name] = cat - - return cat - 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() - if themer_enabled:GetBool() then return themer_skin:GetString() or "themer" end -end) -concommand.Add("themer_refresh_derma",function() - include("skins/themer.lua") - derma.RefreshSkins() - ColorHack() - - for k,v in pairs(hook.GetTable()["ForceDermaSkin"]) do - if k ~= "Themer" then - hook.Remove("ForceDermaSkin", k) - end - end -end) - -hook.Add("SpawnMenuOpen","Themer.IconHack",function() - local ToolMenu = g_SpawnMenu.ToolMenu - for k,v in pairs(ToolMenu.Items) do - 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 - for k,v in pairs(SpawnTabs) do - if v.Name == "#spawnmenu.content_tab" then - v.Tab.Image:SetImage(Material(themer_icon_spawnlists:GetString()):IsError() and "icon16/application_view_tile.png" or themer_icon_spawnlists:GetString()) - - --While we're here - local spawnlists = v.Panel:GetChildren()[1].ContentNavBar.Tree.RootNode.ChildNodes:GetChildren() - for _,n in pairs(spawnlists) do - if n:GetText() == "Your Spawnlists" then - n:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_page.png" or "icon16/folder.png") - end - if n:GetText() == "Browse" then - n:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_brick.png" or "icon16/cog.png") - end - if n:GetText() == "Browse Materials" then - n:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_image.png" or "icon16/picture_empty.png") - end - if n:GetText() == "Browse Sounds" then - n:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_bell.png" or "icon16/sound.png") - end - end - end - - if v.Name == "#spawnmenu.category.weapons" then - v.Tab.Image:SetImage(Material(themer_icon_weapons:GetString()):IsError() and "icon16/gun.png" or themer_icon_weapons:GetString()) - end - - if v.Name == "#spawnmenu.category.entities" then - v.Tab.Image:SetImage(Material(themer_icon_ents:GetString()):IsError() and "icon16/bricks.png" or themer_icon_ents:GetString()) - end - - if v.Name == "#spawnmenu.category.npcs" then - v.Tab.Image:SetImage(Material(themer_icon_npcs:GetString()):IsError() and "icon16/group.png" or themer_icon_npcs:GetString()) - end - - if v.Name == "#spawnmenu.category.vehicles" then - v.Tab.Image:SetImage(Material(themer_icon_cars:GetString()):IsError() and "icon16/car.png" or themer_icon_cars:GetString()) - end - - if v.Name == "#spawnmenu.category.postprocess" then - v.Tab.Image:SetImage(Material(themer_icon_pp:GetString()):IsError() and "icon16/image.png" or themer_icon_pp:GetString()) - end - - if v.Name == "#spawnmenu.category.dupes" then - v.Tab.Image:SetImage(Material(themer_icon_dupes:GetString()):IsError() and "icon16/brick_link.png" or themer_icon_dupes:GetString()) - end - - if v.Name == "#spawnmenu.category.saves" then - v.Tab.Image:SetImage(Material(themer_icon_saves:GetString()):IsError() and "icon16/disk.png" or themer_icon_saves:GetString()) - end - end -end) - -hook.Add("Initialize","Themer",function() - timer.Simple(0,function() - ColorHack() - for k,v in pairs(hook.GetTable()["ForceDermaSkin"]) do - if k ~= "Themer" then - hook.Remove("ForceDermaSkin", k) - end - end - end) -end) - -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) +-- {{ 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_options_gear = CreateClientConVar("themer_options_gear", "0", true) +local themer_spawnlist_icons = CreateClientConVar("themer_spawnlist_icons", "0", true) + +local themer_icon_spawnlists = CreateClientConVar("themer_icon_spawnlists", "icon16/application_view_tile.png", true) +local themer_icon_weapons = CreateClientConVar("themer_icon_weapons", "icon16/gun.png", true) +local themer_icon_ents = CreateClientConVar("themer_icon_ents", "icon16/bricks.png", true) +local themer_icon_npcs = CreateClientConVar("themer_icon_npcs", "icon16/group.png", true) +local themer_icon_cars = CreateClientConVar("themer_icon_cars", "icon16/car.png", true) +local themer_icon_pp = CreateClientConVar("themer_icon_pp", "icon16/image.png", true) +local themer_icon_dupes = CreateClientConVar("themer_icon_dupes", "icon16/brick_link.png", true) +local themer_icon_saves = CreateClientConVar("themer_icon_saves", "icon16/disk.png", true) +-- }}} + +include("themer/iconbrowser.lua") +include("themer/spawnmenu.lua") + +-- {{{ helpers +local function getupvalues(f) + local i, t = 0, {} + + while true do + i = i + 1 + local key, val = debug.getupvalue(f, i) + if not key then break end + t[key] = val + end + + return t +end +-- }}} + +local function ColorHack() + local DMenuOption = table.Copy(vgui.GetControlTable("DMenuOption")) + local DComboBox = table.Copy(vgui.GetControlTable("DComboBox")) + + DMenuOption.Init = function(self) + self:SetContentAlignment(4) + self:SetTextInset(30,0) + self:SetTextColor(self:GetSkin().Colours.Label.Dark) + 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) + local cat = self.Categories[name] + if IsValid(cat) then return cat end + + if not bCreate then return end + + cat = self:GetCanvas():Add(tblCategory) + cat.Label:SetText(name) + + cat.Container.Paint = function(pnl, w, h) + self:GetSkin():PaintListBox(pnl, w, h) + end + + self.Categories[name] = cat + + return cat + 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() + if themer_enabled:GetBool() then + return themer_skin:GetString() or "themer" + end +end) + +concommand.Add("themer_refresh_derma",function() + include("skins/themer.lua") + derma.RefreshSkins() + ColorHack() + + local hooks = hook.GetTable() + for name in pairs(hooks.ForceDermaSkin) do + if name == "Themer" then continue end + + hook.Remove("ForceDermaSkin", name) + end + + if IsValid(g_SpawnMenu) then + for _, tab in ipairs(g_SpawnMenu.ToolMenu.Items) do + local tool_panel = tab.Panel + if IsValid(tool_panel) and IsValid(tool_panel.Content) then + tool_panel = tool_panel.Content:GetCanvas() + end + + if IsValid(tool_panel) then + for _, panel in ipairs(tool_panel:GetChildren()) do + local function recurse(c) + if #c == 0 then return end + + for _, panel in ipairs(c) do + panel:InvalidateLayout() + + recurse(panel:GetChildren()) + end + end + + for _, item in ipairs(panel.Items) do + recurse(item:GetChildren()) + end + end + end + end + end +end) + +hook.Add("SpawnMenuOpen", "Themer.IconHack", function() + local ToolMenuItems = g_SpawnMenu.ToolMenu.Items + for _, item in ipairs(ToolMenuItems) do + if item.Name == "Options" then + item.Tab.Image:SetImage(themer_options_gear:GetBool() and "icon16/cog.png" or "icon16/wrench.png") + end + if item.Name == "Utilities" then + item.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 + for _, tab in ipairs(SpawnTabs) do + if tab.Name == "#spawnmenu.content_tab" then + tab.Tab.Image:SetImage(Material(themer_icon_spawnlists:GetString()):IsError() and "icon16/application_view_tile.png" or themer_icon_spawnlists:GetString()) + + local spawnlists = tab.Panel:GetChildren()[1].ContentNavBar.Tree.RootNode.ChildNodes:GetChildren() + for _, list in pairs(spawnlists) do + if list:GetText() == "Your Spawnlists" then + list:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_page.png" or "icon16/folder.png") + end + if list:GetText() == "Browse" then + list:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_brick.png" or "icon16/cog.png") + end + if list:GetText() == "Browse Materials" then + list:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_image.png" or "icon16/picture_empty.png") + end + if list:GetText() == "Browse Sounds" then + list:SetIcon(themer_spawnlist_icons:GetBool() and "icon16/folder_bell.png" or "icon16/sound.png") + end + end + end + + if tab.Name == "#spawnmenu.category.weapons" then + tab.Tab.Image:SetImage(Material(themer_icon_weapons:GetString()):IsError() and "icon16/gun.png" or themer_icon_weapons:GetString()) + end + + if tab.Name == "#spawnmenu.category.entities" then + tab.Tab.Image:SetImage(Material(themer_icon_ents:GetString()):IsError() and "icon16/bricks.png" or themer_icon_ents:GetString()) + end + + if tab.Name == "#spawnmenu.category.npcs" then + tab.Tab.Image:SetImage(Material(themer_icon_npcs:GetString()):IsError() and "icon16/group.png" or themer_icon_npcs:GetString()) + end + + if tab.Name == "#spawnmenu.category.vehicles" then + tab.Tab.Image:SetImage(Material(themer_icon_cars:GetString()):IsError() and "icon16/car.png" or themer_icon_cars:GetString()) + end + + if tab.Name == "#spawnmenu.category.postprocess" then + tab.Tab.Image:SetImage(Material(themer_icon_pp:GetString()):IsError() and "icon16/image.png" or themer_icon_pp:GetString()) + end + + if tab.Name == "#spawnmenu.category.dupes" then + tab.Tab.Image:SetImage(Material(themer_icon_dupes:GetString()):IsError() and "icon16/brick_link.png" or themer_icon_dupes:GetString()) + end + + if tab.Name == "#spawnmenu.category.saves" then + tab.Tab.Image:SetImage(Material(themer_icon_saves:GetString()):IsError() and "icon16/disk.png" or themer_icon_saves:GetString()) + end + end +end) + +hook.Add("Initialize", "Themer", function() + timer.Simple(0, function() + ColorHack() + + local hooks = hook.GetTable() + for name in pairs(hooks.ForceDermaSkin) do + if name == "Themer" then continue end + + hook.Remove("ForceDermaSkin", name) + end + end) +end) + +do + local hooks = hook.GetTable() + for name in pairs(hooks.ForceDermaSkin) do + if name == "Themer" then continue end + + hook.Remove("ForceDermaSkin", name) + end + + if hooks.OnGamemodeLoaded and hooks.OnGamemodeLoaded.CreateMenuBar then + _G.__themer_oldCreateMenuBar = _G.__themer_oldCreateMenuBar or hooks.OnGamemodeLoaded.CreateMenuBar + local oldCreateMenuBar = _G.__themer_oldCreateMenuBar + hook.Add("OnGamemodeLoaded", "CreateMenuBar", function() + ColorHack() + oldCreateMenuBar() + end) + end end \ No newline at end of file diff --git a/lua/themer/spawnmenu.lua b/lua/themer/spawnmenu.lua index b5b17d0..d984888 100644 --- a/lua/themer/spawnmenu.lua +++ b/lua/themer/spawnmenu.lua @@ -1,199 +1,215 @@ -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") -local themer_merge_options = GetConVar("themer_merge_options") -local themer_spawnlist_icons = GetConVar("themer_spawnlist_icons") - -local themer_icon_spawnlists = GetConVar("themer_icon_spawnlists") -local themer_icon_weapons = GetConVar("themer_icon_weapons") -local themer_icon_ents = GetConVar("themer_icon_ents") -local themer_icon_npcs = GetConVar("themer_icon_npcs") -local themer_icon_cars = GetConVar("themer_icon_cars") -local themer_icon_pp = GetConVar("themer_icon_pp") -local themer_icon_dupes = GetConVar("themer_icon_dupes") -local themer_icon_saves = GetConVar("themer_icon_saves") - -local function MakeMenu(panel) - panel:Help([[This menu lets you select a custom skin for most elements. The spawnmenu is most noticable. -All skins will be from any addons or server downloads, or any custom ones you've made/downloaded manually. - -If you're working on a skin and colors aren't updating, reapply changes. - -All changes require applying changes.]]) - - panel:CheckBox("Use Custom Skin","themer_enabled") - - local files = {} - - for _,f in pairs(file.Find("materials/gwenskin/*.png","GAME")) do - f = f:gsub(".png","") - files[f] = true - end - for _,f in pairs(file.Find("materials/gwenskin/*.png","THIRDPARTY")) do - f = f:gsub(".png","") - files[f] = true - end - - local filelist = panel:ComboBox("Skin Image:","derma_skinname") - for f,_ in pairs(files) do - filelist:AddChoice(f) - end - - 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 refresh = panel:Button("Refresh Lists") - refresh.DoClick = function(s) - filelist:Clear() - skinlist:Clear() - files = {} - - for _,f in pairs(file.Find("materials/gwenskin/*.png","GAME")) do - f = f:gsub(".png","") - files[f] = true - end - for _,f in pairs(file.Find("materials/gwenskin/*.png","THIRDPARTY")) do - f = f:gsub(".png","") - files[f] = true - end - - for f,_ in pairs(files) do - filelist:AddChoice(f) - end - - for f,_ in pairs(derma.SkinList) do - skinlist:AddChoice(f) - end - end - 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.") - reload:SetIcon("icon16/application_view_tile.png") - - local apply = panel:Button("Apply Changes","themer_refresh_derma") - apply:SetIcon("icon16/tick.png") -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. - -Note: Spawnmenu tabs for addons (Pill Pack, simfphys vehicles, SCars, etc) will not be changable. - -All of these require reopening (not reloading) of the spawnmenu to apply changes.]]) - - panel:CheckBox("Use Gear icon for Options tab","themer_options_gear") - - panel:CheckBox("Better Spawnlist Icons","themer_spawnlist_icons") - panel:ControlHelp("Changes \"Your Spawnlists\" and \"Browse\" icons to more suitable icons.") - - local ib = panel:Button("Popout Icon Browser","themer_iconbrowser") - ib:SetIcon("icon16/folder_picture.png") - - local cat_ib = vgui.Create("DCollapsibleCategory",panel) - cat_ib:Dock(TOP) - cat_ib:DockMargin(4,4,4,4) - cat_ib:SetExpanded(false) - cat_ib:SetLabel("Icon Browser") - cat_ib.Header:SetIcon("icon16/folder_picture.png") - cat_ib.AddItem = function(cat,ctrl) ctrl:SetParent(cat) ctrl:Dock(TOP) end - - local path_pnl = vgui.Create("EditablePanel",panel) - path_pnl:DockMargin(0,0,0,4) - path_pnl:SetTall(24) - cat_ib:AddItem(path_pnl) - local path = vgui.Create("DTextEntry",path_pnl) - path:SetText("") - path:Dock(FILL) - path:SetEditable(false) - local copy = vgui.Create("DButton",path_pnl) - copy:Dock(RIGHT) - copy:SetWide(24) - copy:SetImage("icon16/page_copy.png") - copy:SetText("") - function copy:DoClick() - SetClipboardText(path:GetText()) - end - local browser = vgui.Create("DIconBrowser",panel) - browser:SetTall(250) - browser:DockMargin(0,0,0,4) - function browser:OnChange() - path:SetText(self:GetSelectedIcon()) - end - cat_ib:AddItem(browser) - - panel:TextEntry("#spawnmenu.content_tab", "themer_icon_spawnlists") - panel:TextEntry("#spawnmenu.category.weapons", "themer_icon_weapons") - panel:TextEntry("#spawnmenu.category.entities", "themer_icon_ents") - panel:TextEntry("#spawnmenu.category.npcs", "themer_icon_npcs") - panel:TextEntry("#spawnmenu.category.vehicles", "themer_icon_cars") - panel:TextEntry("#spawnmenu.category.postprocess", "themer_icon_pp") - panel:TextEntry("#spawnmenu.category.dupes", "themer_icon_dupes") - panel:TextEntry("#spawnmenu.category.saves", "themer_icon_saves") -end - -local function About(panel) - local title = vgui.Create("DLabel",panel) - title:Dock(TOP) - title:SetFont("Themer.Title") - title:SetText("Themer") - title:SizeToContents() - title:DockMargin(8,8,8,8) - title:SetDark() - - local github = panel:Button("GitHub") - github:SetIcon("icon16/world_link.png") - github.DoClick = function(s) gui.OpenURL("https://github.com/wrldspawn/Themer") end -end - -hook.Add("PopulateToolMenu","Themer.ToolMenu",function() - spawnmenu.AddToolMenuOption("Theming","Theming","\1Theme Options","Theme Options","","",MakeMenu) - spawnmenu.AddToolMenuOption("Theming","Configuration","Icons","Icons","","",IconSettings) - spawnmenu.AddToolMenuOption("Theming","Misc","About","About","","",About) - - for k,v in pairs(spawnmenu.GetTools()) do - if v.Name == "Theming" then - v.Icon = "icon16/palette.png" - end - end -end) - ---External Settings Menu -local function ExtSettings() - local frame = vgui.Create("DFrame") - frame:SetSize(384,768) - frame:SetPos(ScrW()-432,ScrH()/2-256) - frame:SetTitle("Themer Settings") - frame:SetIcon("icon16/palette.png") - frame:MakePopup() - - local tabs = vgui.Create("DPropertySheet",frame) - tabs:Dock(FILL) - - -- Main Area -- - local main = vgui.Create("DForm",tabs) - MakeMenu(main) - main:SetName("Theme Options") - tabs:AddSheet("Theme Options",main,"icon16/palette.png") - - --Icons-- - local icons = vgui.Create("DForm",tabs) - IconSettings(icons) - icons:SetName("Icons") - tabs:AddSheet("Icons",icons,"icon16/pictures.png") - - --About-- - local about = vgui.Create("DForm",tabs) - About(about) - about:SetName("About") - tabs:AddSheet("About",about,"icon16/information.png") -end - -concommand.Add("themer_settings",ExtSettings) \ No newline at end of file +local themer_enabled = GetConVar("themer_enabled") +local derma_skinname = GetConVar("derma_skinname") +local themer_skin = GetConVar("themer_skin") + +local themer_options_gear = GetConVar("themer_options_gear") +local themer_spawnlist_icons = GetConVar("themer_spawnlist_icons") + +local themer_icon_spawnlists = GetConVar("themer_icon_spawnlists") +local themer_icon_weapons = GetConVar("themer_icon_weapons") +local themer_icon_ents = GetConVar("themer_icon_ents") +local themer_icon_npcs = GetConVar("themer_icon_npcs") +local themer_icon_cars = GetConVar("themer_icon_cars") +local themer_icon_pp = GetConVar("themer_icon_pp") +local themer_icon_dupes = GetConVar("themer_icon_dupes") +local themer_icon_saves = GetConVar("themer_icon_saves") + +local function MakeMenu(panel) + local info = panel:Help([[This menu lets you select a custom skin for most elements. The spawnmenu is most noticable. +All skins will be from any addons or server downloads, or any custom ones you've made/downloaded manually. + +If you're working on a skin and colors aren't updating, reapply changes. + +All changes require applying changes.]]) + + local enabled = panel:CheckBox("Use Custom Skin", "themer_enabled") + + local files = {} + + for _, filename in ipairs(file.Find("materials/gwenskin/*.png", "GAME")) do + filename = filename:gsub(".png", "") + files[filename] = true + end + for _, filename in ipairs(file.Find("materials/gwenskin/*.png", "THIRDPARTY")) do + filename = filename:gsub(".png", "") + files[filename] = true + end + + local filelist = panel:ComboBox("Skin Image:", "derma_skinname") + for filename in next, files do + filelist:AddChoice(filename) + end + + local skin_help = panel:Help("Alternatively, you can select a typical skin, which may have other features or better compatibiliy.") + + local skinlist = panel:ComboBox("Skin:", "themer_skin") + for name in next, derma.SkinList do + skinlist:AddChoice(name) + end + + local refresh = panel:Button("Refresh Lists") + refresh.DoClick = function() + filelist:Clear() + skinlist:Clear() + files = {} + + for _, filename in ipairs(file.Find("materials/gwenskin/*.png", "GAME")) do + filename = filename:gsub(".png", "") + files[filename] = true + end + for _, filename in ipairs(file.Find("materials/gwenskin/*.png", "THIRDPARTY")) do + filename = filename:gsub(".png", "") + files[filename] = true + end + + for filename in next, files do + filelist:AddChoice(filename) + end + + for name in next, derma.SkinList do + skinlist:AddChoice(name) + end + end + refresh:SetIcon("icon16/arrow_refresh.png") + + if GAMEMODE.IsSandboxDerived then + local reload = panel:Button("Reload Spawnmenu", "spawnmenu_reload") + reload:SetTooltip("Only do this if you really have to, such as if things aren't updating.") + reload:SetIcon("icon16/application_view_tile.png") + end + + local apply = panel:Button("Apply Changes", "themer_refresh_derma") + apply:SetIcon("icon16/tick.png") +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. + +Note: Spawnmenu tabs for addons (Pill Pack, SCars, etc) will not be changable. + +All of these require reopening (not reloading) of the spawnmenu to apply changes.]]) + + panel:CheckBox("Use Gear icon for Options tab", "themer_options_gear") + + panel:CheckBox("Better Spawnlist Icons", "themer_spawnlist_icons") + panel:ControlHelp('Changes "Your Spawnlists" and "Browse" icons to more suitable icons.') + + local open_iconbrowser = panel:Button("Popout Icon Browser", "themer_iconbrowser") + open_iconbrowser:SetIcon("icon16/folder_picture.png") + + local iconbrowser = vgui.Create("DCollapsibleCategory", panel) do + iconbrowser:Dock(TOP) + iconbrowser:DockMargin(4, 4, 4, 4) + iconbrowser:SetExpanded(false) + iconbrowser:SetLabel("Icon Browser") + iconbrowser.Header:SetIcon("icon16/folder_picture.png") + iconbrowser.AddItem = function(self, ctrl) + ctrl:SetParent(self) + ctrl:Dock(TOP) + end + end + + local top_wrapper = vgui.Create("EditablePanel", iconbrowser) do + top_wrapper:DockMargin(0, 0, 0, 4) + top_wrapper:SetTall(24) + iconbrowser:AddItem(top_wrapper) + end + + local path = vgui.Create("DTextEntry", top_wrapper) do + path:SetText("") + path:Dock(FILL) + path:SetEditable(false) + end + + local copy = vgui.Create("DButton", top_wrapper) do + copy:Dock(RIGHT) + copy:SetWide(24) + copy:SetImage("icon16/page_copy.png") + copy:SetText("") + function copy:DoClick() + SetClipboardText(path:GetText()) + end + end + + local browser = vgui.Create("DIconBrowser", iconbrowser) do + browser:SetTall(250) + browser:DockMargin(0, 0, 0, 4) + function browser:OnChange() + path:SetText(self:GetSelectedIcon()) + end + iconbrowser:AddItem(browser) + end + + panel:TextEntry("#spawnmenu.content_tab", "themer_icon_spawnlists") + panel:TextEntry("#spawnmenu.category.weapons", "themer_icon_weapons") + panel:TextEntry("#spawnmenu.category.entities", "themer_icon_ents") + panel:TextEntry("#spawnmenu.category.npcs", "themer_icon_npcs") + panel:TextEntry("#spawnmenu.category.vehicles", "themer_icon_cars") + panel:TextEntry("#spawnmenu.category.postprocess", "themer_icon_pp") + panel:TextEntry("#spawnmenu.category.dupes", "themer_icon_dupes") + panel:TextEntry("#spawnmenu.category.saves", "themer_icon_saves") +end + +local function About(panel) + local title = vgui.Create("DLabel", panel) do + title:Dock(TOP) + title:SetFont("Themer.Title") + title:SetText("Themer") + title:SizeToContents() + title:DockMargin(8, 8, 8, 8) + title:SetDark() + end + + local github = panel:Button("GitHub") do + github:SetIcon("icon16/world_link.png") + github.DoClick = function() + gui.OpenURL("https://github.com/wrldspawn/Themer") + end + end +end + +hook.Add("PopulateToolMenu", "Themer.ToolMenu", function() + spawnmenu.AddToolMenuOption("Theming", "Theming", "Theme Options", "Theme Options", "", "", MakeMenu) + spawnmenu.AddToolMenuOption("Theming", "Theming", "\xe2\x80\x8bIcons", "\xe2\x80\x8bIcons", "", "", IconSettings) + spawnmenu.AddToolMenuOption("Theming", "Theming", "\xe2\x80\x8b\xe2\x80\x8bAbout", "\xe2\x80\x8b\xe2\x80\x8bAbout", "", "", About) + + for _, tab in ipairs(spawnmenu.GetTools()) do + if tab.Name == "Theming" then + tab.Icon = "icon16/palette.png" + elseif tab.Name == "Utilities" and themer_options_gear:GetBool() then + tab.Icon = "icon16/cog.png" + end + end +end) + +-- External Settings Menu +local function ExtSettings() + local frame = vgui.Create("DFrame") do + frame:SetSize(384, 768) + frame:SetPos(ScrW() - 432, (ScrH() / 2) - 256) + frame:SetTitle("Themer Settings") + frame:SetIcon("icon16/palette.png") + frame:MakePopup() + end + + local tabs = vgui.Create("DPropertySheet", frame) + tabs:Dock(FILL) + + local main = vgui.Create("DForm", tabs) + MakeMenu(main) + main:SetName("Theme Options") + tabs:AddSheet("Theme Options", main, "icon16/palette.png") + + local icons = vgui.Create("DForm", tabs) + IconSettings(icons) + icons:SetName("Icons") + tabs:AddSheet("Icons", icons, "icon16/pictures.png") + + local about = vgui.Create("DForm", tabs) do + About(about) + about:SetName("About") + tabs:AddSheet("About", about, "icon16/information.png") + end +end + +concommand.Add("themer_settings", ExtSettings)