Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examine Blocks #67937

Merged
merged 8 commits into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@
text = "DEBUG: [msg]")
/// Used for debug messages to the server
#define debug_world_log(msg) if (GLOB.Debug2) log_world("DEBUG: [msg]")
/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define examine_block(str) ("<div class='examine_block'>" + str + "</div>")
2 changes: 1 addition & 1 deletion code/datums/components/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
msg += span_boldnicegreen(event.description + "\n")
else
msg += "[span_grey("I don't have much of a reaction to anything right now.")]\n"
to_chat(user, msg)
to_chat(user, examine_block(msg))

///Called after moodevent/s have been added/removed.
/datum/component/mood/proc/update_mood()
Expand Down
4 changes: 3 additions & 1 deletion code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -637,18 +637,20 @@
* Produces a signal [COMSIG_PARENT_EXAMINE]
*/
/atom/proc/examine(mob/user)
. = list("[get_examine_string(user, TRUE)].")
. = list("[get_examine_string(user, TRUE)].<hr>")

. += get_name_chaser(user)
if(desc)
. += desc

if(custom_materials)
. += "<hr>"
var/list/materials_list = list()
for(var/datum/material/current_material as anything in custom_materials)
materials_list += "[current_material.name]"
. += "<u>It is made out of [english_list(materials_list)]</u>."
if(reagents)
. += "<hr>"
if(reagents.flags & TRANSPARENT)
. += "It contains:"
if(length(reagents.reagent_list))
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/scanners/gas_analyzer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@
message += span_notice("Volume: [volume] L") // don't want to change the order volume appears in, suck it

// we let the join apply newlines so we do need handholding
to_chat(user, jointext(message, "\n"), type = MESSAGE_TYPE_INFO)
to_chat(user, examine_block(jointext(message, "\n")), type = MESSAGE_TYPE_INFO)
return TRUE
6 changes: 3 additions & 3 deletions code/game/objects/items/devices/scanners/health_analyzer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
// we handled the last <br> so we don't need handholding

if(tochat)
to_chat(user, jointext(render_list, ""), trailing_newline = FALSE, type = MESSAGE_TYPE_INFO)
to_chat(user, examine_block(jointext(render_list, "")), trailing_newline = FALSE, type = MESSAGE_TYPE_INFO)
else
return(jointext(render_list, ""))

Expand Down Expand Up @@ -436,7 +436,7 @@
render_list += "<span class='alert ml-2'>[allergies]</span>\n"

// we handled the last <br> so we don't need handholding
to_chat(user, jointext(render_list, ""), trailing_newline = FALSE, type = MESSAGE_TYPE_INFO)
to_chat(user, examine_block(jointext(render_list, "")), trailing_newline = FALSE, type = MESSAGE_TYPE_INFO)

/obj/item/healthanalyzer/AltClick(mob/user)
..()
Expand Down Expand Up @@ -475,7 +475,7 @@
else
to_chat(user, "<span class='notice ml-1'>No wounds detected in subject.</span>")
else
to_chat(user, jointext(render_list, ""), type = MESSAGE_TYPE_INFO)
to_chat(user, examine_block(jointext(render_list, "")), type = MESSAGE_TYPE_INFO)

/obj/item/healthanalyzer/wound
name = "first aid analyzer"
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/scanners/slime_scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@
if(T.effectmod)
to_render += "\n[span_notice("Core mutation in progress: [T.effectmod]")]\
\n[span_notice("Progress in core mutation: [T.applied] / [SLIME_EXTRACT_CROSSING_REQUIRED]")]"
to_chat(user, to_render + "\n========================")
to_chat(user, examine_block(to_render + "\n========================"))
13spacemen marked this conversation as resolved.
Show resolved Hide resolved
18 changes: 9 additions & 9 deletions code/modules/hydroponics/hydroitemdefines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@
*/
/obj/item/plant_analyzer/proc/do_plant_stats_scan(atom/scan_target, mob/user)
if(istype(scan_target, /obj/machinery/hydroponics))
to_chat(user, scan_tray_stats(scan_target))
to_chat(user, examine_block(scan_tray_stats(scan_target)))
return TRUE
if(istype(scan_target, /obj/structure/glowshroom))
var/obj/structure/glowshroom/shroom_plant = scan_target
to_chat(user, scan_plant_stats(shroom_plant.myseed))
to_chat(user, examine_block(scan_plant_stats(shroom_plant.myseed)))
return TRUE
if(istype(scan_target, /obj/item/graft))
to_chat(user, get_graft_text(scan_target))
to_chat(user, examine_block(get_graft_text(scan_target)))
return TRUE
if(isitem(scan_target))
var/obj/item/scanned_object = scan_target
if(scanned_object.get_plant_seed() || istype(scanned_object, /obj/item/seeds))
to_chat(user, scan_plant_stats(scanned_object))
to_chat(user, examine_block(scan_plant_stats(scanned_object)))
return TRUE
if(isliving(scan_target))
var/mob/living/L = scan_target
Expand All @@ -107,19 +107,19 @@
*/
/obj/item/plant_analyzer/proc/do_plant_chem_scan(atom/scan_target, mob/user)
if(istype(scan_target, /obj/machinery/hydroponics))
to_chat(user, scan_tray_chems(scan_target))
to_chat(user, examine_block(scan_tray_chems(scan_target)))
return TRUE
if(istype(scan_target, /obj/structure/glowshroom))
var/obj/structure/glowshroom/shroom_plant = scan_target
to_chat(user, scan_plant_chems(shroom_plant.myseed))
to_chat(user, examine_block(scan_plant_chems(shroom_plant.myseed)))
return TRUE
if(istype(scan_target, /obj/item/graft))
to_chat(user, get_graft_text(scan_target))
to_chat(user, examine_block(get_graft_text(scan_target)))
return TRUE
if(isitem(scan_target))
var/obj/item/scanned_object = scan_target
if(scanned_object.get_plant_seed() || istype(scanned_object, /obj/item/seeds))
to_chat(user, scan_plant_chems(scanned_object))
to_chat(user, examine_block(scan_plant_chems(scanned_object)))
return TRUE
if(isliving(scan_target))
var/mob/living/L = scan_target
Expand Down Expand Up @@ -223,7 +223,7 @@
* Returns the formatted output as text.
*/
/obj/item/plant_analyzer/proc/scan_plant_stats(obj/item/scanned_object)
var/returned_message = "*---------*\nThis is [span_name("\a [scanned_object]")].\n"
var/returned_message = "This is [span_name("\a [scanned_object]")].\n"
var/obj/item/seeds/our_seed = scanned_object
if(!istype(our_seed)) //if we weren't passed a seed, we were passed a plant with a seed
our_seed = scanned_object.get_plant_seed()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var/t_has = p_have()
var/t_is = p_are()

. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] \a <EM>[src]</EM>!")
. = list("<span class='info'>This is [icon2html(src, user)] \a <EM>[src]</EM>!<hr>")
var/obscured = check_obscured_slots()

if (handcuffed)
Expand Down Expand Up @@ -150,7 +150,7 @@
. += "[t_He] look[p_s()] very happy."
if(MOOD_LEVEL_HAPPY4 to INFINITY)
. += "[t_He] look[p_s()] ecstatic."
. += "*---------*</span>"
. += "</span>"

SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if(HAS_TRAIT(L, TRAIT_PROSOPAGNOSIA) || HAS_TRAIT(L, TRAIT_INVISIBLE_MAN))
obscure_name = TRUE

. = list("<span class='info'>*---------*\nThis is <EM>[!obscure_name ? name : "Unknown"]</EM>!")
. = list("<span class='info'>This is <EM>[!obscure_name ? name : "Unknown"]</EM>!<hr>")

var/obscured = check_obscured_slots()

Expand Down Expand Up @@ -399,7 +399,7 @@
"<a href='?src=[REF(src)];hud=s;add_comment=1;examine_time=[world.time]'>\[Add comment\]</a>"), "")
else if(isobserver(user))
. += span_info("<b>Traits:</b> [get_quirk_string(FALSE, CAT_QUIRK_ALL)]")
. += "*---------*</span>"
. += "</span>"

SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .)

Expand Down
7 changes: 4 additions & 3 deletions code/modules/mob/living/carbon/human/human_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -707,10 +707,11 @@
/mob/living/carbon/human/check_self_for_injuries()
if(stat >= UNCONSCIOUS)
return
var/list/combined_msg = list()
var/list/combined_msg = list("<div class='examine_block'>")

visible_message(span_notice("[src] examines [p_them()]self."), \
span_notice("You check yourself for injuries."))
visible_message(span_notice("[src] examines [p_them()]self."))

combined_msg += span_boldnotice("You check yourself for injuries.<hr>")

var/list/missing = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/silicon/ai/examine.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/mob/living/silicon/ai/examine(mob/user)
. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] <EM>[src]</EM>!")
. = list("<span class='info'>This is [icon2html(src, user)] <EM>[src]</EM>!<hr>")
if (stat == DEAD)
. += span_deadsay("It appears to be powered-down.")
else
Expand All @@ -17,6 +17,6 @@
. += "The wireless networking light is blinking.\n"
else if (!shunted && !client)
. += "[src]Core.exe has stopped responding! NTOS is searching for a solution to the problem...\n"
. += "*---------*</span>"
. += "</span>"

. += ..()
4 changes: 2 additions & 2 deletions code/modules/mob/living/silicon/robot/examine.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/mob/living/silicon/robot/examine(mob/user)
. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] \a <EM>[src]</EM>!")
. = list("<span class='info'>This is [icon2html(src, user)] \a <EM>[src]</EM>!<hr>")
if(desc)
. += "[desc]"

Expand Down Expand Up @@ -43,6 +43,6 @@
. += span_warning("It doesn't seem to be responding.")
if(DEAD)
. += span_deadsay("It looks like its system is corrupted and requires a reset.")
. += "*---------*</span>"
. += "</span>"

. += ..()
4 changes: 2 additions & 2 deletions code/modules/mob/living/simple_animal/constructs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@
text_span = "purple"
if(THEME_HOLY)
text_span = "blue"
. = list("<span class='[text_span]'>*---------*\nThis is [icon2html(src, user)] \a <b>[src]</b>!\n[desc]")
. = list("<span class='[text_span]'>This is [icon2html(src, user)] \a <b>[src]</b>!\n[desc]<hr>")
if(health < maxHealth)
if(health >= maxHealth/2)
. += span_warning("[t_He] look[t_s] slightly dented.")
else
. += span_warning("<b>[t_He] look[t_s] severely dented!</b>")
. += "*---------*</span>"
. += "</span>"

/mob/living/simple_animal/hostile/construct/attack_animal(mob/living/simple_animal/user, list/modifiers)
if(isconstruct(user)) //is it a construct?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@
dust()

/mob/living/simple_animal/drone/examine(mob/user)
. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] \a <b>[src]</b>!")
. = list("<span class='info'>This is [icon2html(src, user)] \a <b>[src]</b>!<hr>")

//Hands
for(var/obj/item/I in held_items)
Expand Down Expand Up @@ -286,7 +286,7 @@
. += span_deadsay("A message repeatedly flashes on its display: \"REBOOT -- REQUIRED\".")
else
. += span_deadsay("A message repeatedly flashes on its display: \"ERROR -- OFFLINE\".")
. += "*---------*</span>"
. += "</span>"


/mob/living/simple_animal/drone/assess_threat(judgement_criteria, lasercolor = "", datum/callback/weaponcheck=null) //Secbots won't hunt maintenance drones.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

/mob/living/simple_animal/hostile/guardian/dextrous/examine(mob/user)
if(dextrous)
. = list("<span class='info'>*---------*\nThis is [icon2html(src)] \a <b>[src]</b>!\n[desc]")
. = list("<span class='info'>This is [icon2html(src)] \a <b>[src]</b>!\n[desc]<hr>")
for(var/obj/item/I in held_items)
if(!(I.item_flags & ABSTRACT))
. += "It has [I.get_examine_string(user)] in its [get_held_index_name(get_held_index_of_item(I))]."
if(internal_storage && !(internal_storage.item_flags & ABSTRACT))
. += "It is holding [internal_storage.get_examine_string(user)] in its internal storage."
. += "*---------*</span>"
. += "</span>"
else
return ..()

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/simple_animal/slime/slime.dm
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
return

/mob/living/simple_animal/slime/examine(mob/user)
. = list("<span class='info'>*---------*\nThis is [icon2html(src, user)] \a <EM>[src]</EM>!")
. = list("<span class='info'>This is [icon2html(src, user)] \a <EM>[src]</EM>!<hr>")
if (stat == DEAD)
. += span_deadsay("It is limp and unresponsive.")
else
Expand All @@ -465,7 +465,7 @@
if(10)
. += span_warning("<B>It is radiating with massive levels of electrical activity!</B>")

. += "*---------*</span>"
. += "</span>"

/mob/living/simple_animal/slime/proc/discipline_slime(mob/user)
if(stat)
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,12 @@
else
result = examinify.examine(src) // if a tree is examined but no client is there to see it, did the tree ever really exist?

to_chat(src, "<span class='infoplain'>[result.Join("\n")]</span>")
if(result.len)
for(var/i = 1, i <= result.len, i++)
if(!findtext(result[i], "<hr>"))
result[i] += "\n"

to_chat(src, "<div class='examine_block'><span class='infoplain'>[result.Join()]</span></div>")
13spacemen marked this conversation as resolved.
Show resolved Hide resolved
SEND_SIGNAL(src, COMSIG_MOB_EXAMINATE, examinify)


Expand Down
15 changes: 15 additions & 0 deletions tgui/packages/tgui-panel/styles/goon/chat-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,21 @@ em {
margin-left: 3em;
}

.examine_block {
background: rgba(0, 0, 0, 0.2);
border: 1px solid rgba(55, 55, 55, 0.33);
margin: 7px 4px;
padding: 8px 12px;
max-width: 550px;
}

.examine_block hr {
border: none;
background: #222;
height: 1px;
margin: 8px 16px 8px 16px;
}

.tooltip {
font-style: italic;
border-bottom: 1px dashed #fff;
Expand Down
15 changes: 15 additions & 0 deletions tgui/packages/tgui-panel/styles/goon/chat-light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,21 @@ h1.alert, h2.alert {
margin-left: 3em;
}

.examine_block {
background: rgba(0, 0, 0, 0.1);
border: 1px solid #111a27;
margin: 2px 8px;
padding: 8px 12px;
max-width: 550px;
}

.examine_block hr {
border: none;
background: #333;
height: 1px;
margin: 8px 16px 8px 16px;
}

.tooltip {
font-style: italic;
border-bottom: 1px dashed #000;
Expand Down