[MIRROR] Makes the examine panel present more readable colours when using darkmode (#6728)

Co-authored-by: Casey <a.roaming.shadow@gmail.com>
Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
CHOMPStation2
2023-08-05 16:08:39 -07:00
committed by GitHub
parent f56c2dc1e7
commit eeeea1468a
4 changed files with 107 additions and 79 deletions

View File

@@ -65,15 +65,34 @@
var/description_holders = client.description_holders
stat(null,"[description_holders["icon"]] <font size='5'>[description_holders["name"]]</font>") //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,"<font color='#6F6FE2'><b>[description_holders["info"]]</b></font>") //Blue, informative text.
stat(null,"<font color=[color_i]><b>[description_holders["info"]]</b></font>") //Blue, informative text.
if(description_holders["interactions"])
for(var/line in description_holders["interactions"])
stat(null, "<font color='#084B8A'><b>[line]</b></font>")
stat(null, "<font color=[color_i]><b>[line]</b></font>")
if(description_holders["fluff"])
stat(null,"<font color='#298A08'><b>[description_holders["fluff"]]</b></font>") //Yellow, fluff-related text.
stat(null,"<font color=[color_f]><b>[description_holders["fluff"]]</b></font>") //Yellow, fluff-related text.
if(description_holders["antag"])
stat(null,"<font color='#8A0808'><b>[description_holders["antag"]]</b></font>") //Red, malicious antag-related text
stat(null,"<font color=[color_a]><b>[description_holders["antag"]]</b></font>") //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()
@@ -100,3 +119,79 @@
if(client)
var/is_antag = ((mind && mind.special_role) || isobserver(src)) //ghosts don't have minds
client.update_description_holders(A, is_antag)
/mob/verb/mob_examine()
set name = "Mob Examine"
set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects."
set category = "IC"
set popup_menu = FALSE
if((is_blind(src) || src.stat) && !isobserver(src))
to_chat(src, "<span class='notice'>Something is there but you can't see it.</span>")
return 1
var/list/E = list()
if(isAI(src))
var/mob/living/silicon/ai/my_ai = src
for(var/e in my_ai.all_eyes)
var/turf/my_turf = get_turf(e)
var/foundcam = FALSE
for(var/obj/cam in view(world.view, my_turf))
if(istype(cam, /obj/machinery/camera))
var/obj/machinery/camera/mycam = cam
if(!mycam.stat)
foundcam = TRUE
if(!foundcam)
continue
for(var/atom/M in view(world.view, my_turf))
if(M == src || istype(M, /mob/observer))
continue
if(ismob(M) && !M.invisibility)
if(src && src == M)
var/list/results = src.examine(src)
if(!results || !results.len)
results = list("You were unable to examine that. Tell a developer!")
to_chat(src, jointext(results, "<br>"))
update_examine_panel(src)
return
else
E |= M
if(E.len == 0)
return
else
var/my_turf = get_turf(src)
for(var/atom/M in view(world.view, my_turf))
if(ismob(M) && M != src && !istype(M, /mob/observer) && !M.invisibility)
E |= M
for(var/turf/T in view(world.view, my_turf))
if(!isopenspace(T))
continue
var/turf/checked = T
var/keepgoing = TRUE
while(keepgoing)
var/checking = GetBelow(checked)
for(var/atom/m in checking)
if(ismob(m) && !istype(m, /mob/observer) && !m.invisibility)
E |= m
checked = checking
if(!isopenspace(checked))
keepgoing = FALSE
if(E.len == 0)
to_chat(src, SPAN_NOTICE("There are no mobs to examine."))
return
var/atom/B = null
if(E.len == 1)
B = pick(E)
else
B = tgui_input_list(src, "What would you like to examine?", "Examine", E)
if(!B)
return
if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder) && !isAI(src))
if(B.z == src.z)
face_atom(B)
var/list/results = B.examine(src)
if(!results || !results.len)
results = list("You were unable to examine that. Tell a developer!")
to_chat(src, jointext(results, "<br>"))
update_examine_panel(B)

View File

@@ -1,74 +0,0 @@
/mob/verb/mob_examine()
set name = "Mob Examine"
set desc = "Allows one to examine mobs they can see, even from inside of bellies and objects."
set category = "IC"
set popup_menu = FALSE
if((is_blind(src) || src.stat) && !isobserver(src))
to_chat(src, "<span class='notice'>Something is there but you can't see it.</span>")
return 1
var/list/E = list()
if(isAI(src))
var/mob/living/silicon/ai/my_ai = src
for(var/e in my_ai.all_eyes)
var/turf/my_turf = get_turf(e)
var/foundcam = FALSE
for(var/obj/cam in view(world.view, my_turf))
if(istype(cam, /obj/machinery/camera))
var/obj/machinery/camera/mycam = cam
if(!mycam.stat)
foundcam = TRUE
if(!foundcam)
continue
for(var/atom/M in view(world.view, my_turf))
if(M == src || istype(M, /mob/observer))
continue
if(ismob(M) && !M.invisibility)
if(src && src == M)
var/list/results = src.examine(src)
if(!results || !results.len)
results = list("You were unable to examine that. Tell a developer!")
to_chat(src, jointext(results, "<br>"))
update_examine_panel(src)
return
else
E |= M
if(E.len == 0)
return
else
var/my_turf = get_turf(src)
for(var/atom/M in view(world.view, my_turf))
if(ismob(M) && M != src && !istype(M, /mob/observer) && !M.invisibility)
E |= M
for(var/turf/T in view(world.view, my_turf))
if(!isopenspace(T))
continue
var/turf/checked = T
var/keepgoing = TRUE
while(keepgoing)
var/checking = GetBelow(checked)
for(var/atom/m in checking)
if(ismob(m) && !istype(m, /mob/observer) && !m.invisibility)
E |= m
checked = checking
if(!isopenspace(checked))
keepgoing = FALSE
if(E.len == 0)
to_chat(src, SPAN_NOTICE("There are no mobs to examine."))
return
var/atom/B = null
if(E.len == 1)
B = pick(E)
else
B = tgui_input_list(src, "What would you like to examine?", "Examine", E)
if(!B)
return
if(!isbelly(loc) && !istype(loc, /obj/item/weapon/holder) && !isAI(src))
if(B.z == src.z)
face_atom(B)
var/list/results = B.examine(src)
if(!results || !results.len)
results = list("You were unable to examine that. Tell a developer!")
to_chat(src, jointext(results, "<br>"))
update_examine_panel(B)

View File

@@ -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",

View File

@@ -2430,7 +2430,6 @@
#include "code\modules\events\viral_infection.dm"
#include "code\modules\events\wallrot.dm"
#include "code\modules\examine\examine.dm"
#include "code\modules\examine\examine_vr.dm"
#include "code\modules\examine\stat_icons.dm"
#include "code\modules\examine\descriptions\armor.dm"
#include "code\modules\examine\descriptions\atmospherics.dm"