Skip to content

Commit

Permalink
Examine Blocks (tgstation#67937)
Browse files Browse the repository at this point in the history
* adds examine_block class and a define for it
made some outputs in chat use examine_block

* add examine block to tip of the round
clean up some ------ and ***** seperators
added <hr> tags to divide sections
cleaned up botany plant analyzer text outputs

* bullet points for reagents

* removes <hr> from mobs examines
fixes AIs and borgs having a double "That's Default Cyborg!"
removed some \n newlines
minor code edits

* removes all <hr>
bold names in get_examine_name()
cleaned up plant analyzer output formatting
adjust colors and margins of examine_block class
remove \a from borg examine()

* remove max-width from css

* changed margin and padding units from px to em

* minor edit
  • Loading branch information
13spacemen authored and Jacquerel committed Jun 27, 2022
1 parent 9a85a3a commit ce5225c
Show file tree
Hide file tree
Showing 24 changed files with 149 additions and 126 deletions.
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/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,4 @@
message = html_encode(message)
else
message = copytext(message, 2)
to_chat(target, span_purple("<span class='oocplain'><b>Tip of the round: </b>[message]</span>"))
to_chat(target, span_purple(examine_block("<span class='oocplain'><b>Tip of the round: </b>[message]</span>")))
4 changes: 2 additions & 2 deletions code/datums/components/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
RegisterSignal(parent, COMSIG_ADD_MOOD_EVENT_RND, .proc/add_event) //Mood events that are only for RnD members

/datum/component/mood/proc/print_mood(mob/user)
var/msg = "[span_info("*---------*\n<EM>My current mental status:</EM>")]\n"
var/msg = "[span_info("<EM>My current mental status:</EM>")]\n"
msg += span_notice("My current sanity: ") //Long term
switch(sanity)
if(SANITY_GREAT to INFINITY)
Expand Down 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
2 changes: 1 addition & 1 deletion code/datums/elements/weapon_description.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
SIGNAL_HANDLER

if(href_list["examine"])
to_chat(user, span_notice("[build_label_text(source)]"))
to_chat(user, span_notice(examine_block("[build_label_text(source)]")))

/**
*
Expand Down
4 changes: 2 additions & 2 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@
if(!length(shown_skills))
to_chat(user, span_notice("You don't seem to have any particularly outstanding skills."))
return
var/msg = "[span_info("*---------*\n<EM>Your skills</EM>")]\n<span class='notice'>"
var/msg = "[span_info("<EM>Your skills</EM>")]\n<span class='notice'>"
for(var/i in shown_skills)
var/datum/skill/the_skill = i
msg += "[initial(the_skill.name)] - [get_skill_level_name(the_skill)]\n"
msg += "</span>"
to_chat(user, msg)
to_chat(user, examine_block(msg))

/datum/mind/proc/set_death_time()
SIGNAL_HANDLER
Expand Down
12 changes: 8 additions & 4 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@
* [COMSIG_ATOM_GET_EXAMINE_NAME] signal
*/
/atom/proc/get_examine_name(mob/user)
. = "\a [src]"
. = "\a <b>[src]</b>"
var/list/override = list(gender == PLURAL ? "some" : "a", " ", "[name]")
if(article)
. = "[article] [src]"
. = "[article] <b>[src]</b>"
override[EXAMINE_POSITION_ARTICLE] = article
if(SEND_SIGNAL(src, COMSIG_ATOM_GET_EXAMINE_NAME, user, override) & COMPONENT_EXNAME_CHANGED)
. = override.Join("")
Expand Down Expand Up @@ -637,7 +637,11 @@
* Produces a signal [COMSIG_PARENT_EXAMINE]
*/
/atom/proc/examine(mob/user)
. = list("[get_examine_string(user, TRUE)].")
var/examine_string = get_examine_string(user, thats = TRUE)
if(examine_string)
. = list("[examine_string].")
else
. = list()

. += get_name_chaser(user)
if(desc)
Expand All @@ -654,7 +658,7 @@
if(length(reagents.reagent_list))
if(user.can_see_reagents()) //Show each individual reagent
for(var/datum/reagent/current_reagent as anything in reagents.reagent_list)
. += "[round(current_reagent.volume, 0.01)] units of [current_reagent.name]"
. += "&bull; [round(current_reagent.volume, 0.01)] units of [current_reagent.name]"
if(reagents.is_reacting)
. += span_warning("It is currently reacting!")
. += span_notice("The solution's pH is [round(reagents.ph, 0.01)] and has a temperature of [reagents.chem_temp]K.")
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
5 changes: 2 additions & 3 deletions code/game/objects/items/devices/scanners/slime_scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
slime_scan(T, user)

/proc/slime_scan(mob/living/simple_animal/slime/T, mob/living/user)
var/to_render = "========================\
\n<b>Slime scan results:</b>\
var/to_render = "<b>Slime scan results:</b>\
\n[span_notice("[T.colour] [T.is_adult ? "adult" : "baby"] slime")]\
\nNutrition: [T.nutrition]/[T.get_max_nutrition()]"
if (T.nutrition < T.get_starve_nutrition())
Expand All @@ -51,4 +50,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))
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown/weeds/kudzu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
var/output_message = ""
for(var/datum/spacevine_mutation/SM in mutations)
kudzu_mutations += "[(kudzu_mutations == "") ? "" : ", "][SM.name]"
output_message += "- Plant Mutations: [(kudzu_mutations == "") ? "None." : "[kudzu_mutations]."]"
output_message += "Plant Mutations: [(kudzu_mutations == "") ? "None." : "[kudzu_mutations]."]"
return output_message

/obj/item/seeds/kudzu/on_chem_reaction(datum/reagents/reagents)
Expand Down
Loading

0 comments on commit ce5225c

Please sign in to comment.