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鈥檒l 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 3 commits
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/__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
6 changes: 4 additions & 2 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -637,24 +637,26 @@
* 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))
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