From 53f646fc91850bb7d65247603e02faeb33b76690 Mon Sep 17 00:00:00 2001 From: Runa Dacino Date: Sat, 5 Aug 2023 13:28:12 +0200 Subject: [PATCH] tweak(examine tab): Makes description colours follow darkmode Adds a check to mobs' stat() proc's description/examine handling, checking if our statpanel's background-color is "none" (basically white). This decision was made for reasons stated in the comment. I also puta comment in vchat.js asking people tampering with it to please keep these two things in sync --- code/modules/examine/examine.dm | 27 +++++++++++++++++++++++---- code/modules/vchat/js/vchat.js | 8 ++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm index c33ecae6b9d..c38b746d5e0 100644 --- a/code/modules/examine/examine.dm +++ b/code/modules/examine/examine.dm @@ -65,15 +65,34 @@ var/description_holders = client.description_holders stat(null,"[description_holders["icon"]] [description_holders["name"]]") //The name, written in big letters. stat(null,"[description_holders["desc"]]") //the default examine text. + + + var/color_i = "#084B8A" + var/color_f = "#298A08" + var/color_a = "#8A0808" +/* + The infowindow colours are set in code\modules\vchat\js\vchat.js file + Unfortunately, I cannot think of a way to do this elegantly where there's this central define that we can easily track. + As of 2023/08/05 13:10, the lightmode colour for vchat tabBackgroundColor is "none", this is also defined in interface\skin.dmf . + The darkmode colour for vchat tabBackgroundColor is "#272727". + Since it's possible that one day we'll have option to modify the user's preferred tabBackgroundColor + I will assume the lightmode colour will be left untouched - therefore, we are checking for none. +*/ + if(!(winget(src, "infowindow", "background-color") == "none")) + color_i = "#709ec9d8" + color_f = "#76d357" + color_a = "#c94d4d" + + if(description_holders["info"]) - stat(null,"[description_holders["info"]]") //Blue, informative text. + stat(null,"[description_holders["info"]]") //Blue, informative text. if(description_holders["interactions"]) for(var/line in description_holders["interactions"]) - stat(null, "[line]") + stat(null, "[line]") if(description_holders["fluff"]) - stat(null,"[description_holders["fluff"]]") //Yellow, fluff-related text. + stat(null,"[description_holders["fluff"]]") //Yellow, fluff-related text. if(description_holders["antag"]) - stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text + stat(null,"[description_holders["antag"]]") //Red, malicious antag-related text //override examinate verb to update description holders when things are examined //mob verbs are faster than object verbs. See http://www.byond.com/forum/?post=1326139&page=2#comment8198716 for why this isn't atom/verb/examine() diff --git a/code/modules/vchat/js/vchat.js b/code/modules/vchat/js/vchat.js index 8450fe31113..ba11e24ee5c 100644 --- a/code/modules/vchat/js/vchat.js +++ b/code/modules/vchat/js/vchat.js @@ -30,6 +30,14 @@ var vchat_opts = { vchatTabsVer: 1.0 //Version of vchat tabs save 'file' }; +/*********** +* If you are changing either tabBackgroundColor in dark or lightmode, +* lease keep this synchronized with code\modules\examine\examine.dm +* I cannot think of a elegant way to ensure it tracks these settings properly. +* As long as LIGHTMODE stays as "none", stuff should not break. +* Thank you! +************/ + var DARKMODE_COLORS = { buttonBgColor: "#40628a", buttonTextColor: "#FFFFFF",