Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 5 additions & 3 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
/// 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>")
/// Makes a fieldset with a name in the middle top part. Can apply additional classes
#define fieldset_block(title, content, classes) ("<fieldset class='" + classes + "'><legend align='center' style='max-width: 95%; text-align: center;'><div style='margin: 0em 0.2em -0.4em 0.2em;' >" + title + "</div></legend>" + content + "</fieldset>")
#define boxed_message(str) ("<div class='boxed_message'>" + str + "</div>")
/// Adds a box around whatever message you're sending in chat. Can apply color and/or additional classes. Available colors: red, green, blue, purple. Use it like red_box
#define custom_boxed_message(classes, str) ("<div class='boxed_message " + classes + "'>" + str + "</div>")
/// Makes a fieldset with a neaty styled name. Can apply additional classes.
#define fieldset_block(title, content, classes) ("<fieldset class='fieldset " + classes + "'><legend class='fieldset_legend'>" + title + "</legend>" + content + "</fieldset>")
/// Makes a horizontal line with text in the middle
#define separator_hr(str) ("<div class='separator'>" + str + "</div>")
#define separator_hr_danger(str) ("<div class='separator danger'>" + str + "</div>")
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#define COMSIG_ATOM_EXAMINE "atom_examine"
///from base of atom/examine_tags(): (/mob, list/examine_tags)
#define COMSIG_ATOM_EXAMINE_TAGS "atom_examine_tags"
///from base of atom/examine_post_descriptor(): (/mob, list/examine_text, list/materials)
#define COMSIG_ATOM_EXAMINE_POST_DESCRIPTOR "atom_examine_post_descriptor"
///from base of atom/get_examine_name(): (/mob, list/overrides)
#define COMSIG_ATOM_GET_EXAMINE_NAME "atom_examine_name"
//Positions for overrides list
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -326,4 +326,4 @@
message = html_encode(message)
else
message = copytext(message, 2)
to_chat(target, span_purple(examine_block("<b>Tip of the round: </b>[message]")))
to_chat(target, custom_boxed_message("purple_box", span_purple("<b>Tip of the round: </b>[message]")))
2 changes: 1 addition & 1 deletion code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
return FALSE
var/list/modifiers = params2list(params)
if(LAZYACCESS(modifiers, SHIFT_CLICK)) // screen objects don't do the normal Click() stuff so we'll cheat
to_chat(usr, examine_block(jointext(examine(usr), "\n")))
to_chat(usr, boxed_message(jointext(examine(usr), "\n")))
return FALSE
var/datum/our_master = master_ref?.resolve()
if(our_master && click_master)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/polling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ SUBSYSTEM_DEF(polling)
else
surrounding_image = image(chat_text_border_icon)
surrounding_icon = icon2html(surrounding_image, candidate_mob, extra_classes = "bigicon")
var/final_message = examine_block("<span style='text-align:center;display:block'>[surrounding_icon] <span style='font-size:1.2em'>[span_ooc(question)]</span> [surrounding_icon]\n[act_jump] [act_signup] [act_never]</span>")
var/final_message = boxed_message("<span style='text-align:center;display:block'>[surrounding_icon] <span style='font-size:1.2em'>[span_ooc(question)]</span> [surrounding_icon]\n[act_jump] [act_signup] [act_never]</span>")
to_chat(candidate_mob, final_message)

// Start processing it so it updates visually the timer
Expand Down
5 changes: 3 additions & 2 deletions code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ SUBSYSTEM_DEF(vote)
"final_winner" = final_winner_string,
)
log_vote("vote finalized", vote_log_data)
to_chat(world, examine_block(span_infoplain(vote_font("[to_display]"))))
if(to_display)
to_chat(world, span_infoplain(vote_font(to_display)))

// Finally, doing any effects on vote completion
if (final_winner) // if no one voted, or the vote cannot be won, final_winner will be null
Expand Down Expand Up @@ -224,7 +225,7 @@ SUBSYSTEM_DEF(vote)
var/to_display = current_vote.initiate_vote(vote_initiator_name, duration)

log_vote(to_display)
to_chat(world, examine_block(span_infoplain(vote_font("[span_bold(to_display)]<br>\
to_chat(world, custom_boxed_message("purple_box center", span_infoplain(vote_font("[span_bold(to_display)]<br>\
Type <b>vote</b> or click <a href='byond://winset?command=vote'>here</a> to place your votes.<br>\
You have [DisplayTimeText(duration)] to vote."))))

Expand Down
2 changes: 1 addition & 1 deletion code/datums/ai_laws/ai_laws.dm
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ GLOBAL_VAR(round_default_lawset)

/datum/ai_laws/proc/show_laws(mob/to_who)
var/list/printable_laws = get_law_list(include_zeroth = TRUE)
to_chat(to_who, examine_block(jointext(printable_laws, "\n")))
to_chat(to_who, boxed_message(jointext(printable_laws, "\n")))

/datum/ai_laws/proc/associate(mob/living/silicon/M)
if(!owner)
Expand Down
11 changes: 7 additions & 4 deletions code/datums/components/food/edible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Behavior that's still missing from this component that original food items had t

/datum/component/edible/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATOM_EXAMINE, PROC_REF(examine))
RegisterSignal(parent, COMSIG_ATOM_EXAMINE_TAGS, PROC_REF(examine_tags))
RegisterSignal(parent, COMSIG_ATOM_EXAMINE_POST_DESCRIPTOR, PROC_REF(post_examine_tags))
RegisterSignal(parent, COMSIG_ATOM_ATTACK_ANIMAL, PROC_REF(UseByAnimal))
RegisterSignal(parent, COMSIG_ATOM_CHECKPARTS, PROC_REF(OnCraft))
RegisterSignal(parent, COMSIG_OOZE_EAT_ATOM, PROC_REF(on_ooze_eat))
Expand Down Expand Up @@ -111,7 +111,7 @@ Behavior that's still missing from this component that original food items had t
COMSIG_ITEM_USED_AS_INGREDIENT,
COMSIG_OOZE_EAT_ATOM,
COMSIG_ATOM_EXAMINE,
COMSIG_ATOM_EXAMINE_TAGS,
COMSIG_ATOM_EXAMINE_POST_DESCRIPTOR,
))

qdel(GetComponent(/datum/component/connect_loc_behalf))
Expand Down Expand Up @@ -281,13 +281,16 @@ Behavior that's still missing from this component that original food items had t
var/mob/living/living_user = user
living_user.taste(owner.reagents)

/datum/component/edible/proc/examine_tags(datum/source, mob/user, list/examine_tags)
/datum/component/edible/proc/post_examine_tags(datum/source, mob/user, list/examine_tags, list/materials_list)
SIGNAL_HANDLER

if(food_flags & FOOD_NO_EXAMINE)
return
for(var/foodtype in bitfield_to_list(foodtypes, FOOD_FLAGS))
examine_tags[LOWER_TEXT(foodtype)] = "It's \a [LOWER_TEXT(foodtype)] food."
var/foodtype_string = LOWER_TEXT(foodtype)
if(materials_list[foodtype_string])
continue // meat material and meat foodtype, primarily
materials_list[foodtype_string] = "It's \a [foodtype_string] food."

/datum/component/edible/proc/UseFromHand(obj/item/source, mob/living/M, mob/living/user)
SIGNAL_HANDLER
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/trader/trader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Can accept both a type path, and an instance of a datum. Type path has priority.
else
buy_info += span_notice("&bull; [initial(thing.name)] for [product_info[TRADER_PRODUCT_INFO_PRICE]] [trader_data.currency_name][product_info[TRADER_PRODUCT_INFO_PRICE_MOD_DESCRIPTION]]; willing to buy [span_green("[tern_op_result]")]")

to_chat(customer, examine_block(buy_info.Join("\n")))
to_chat(customer, boxed_message(buy_info.Join("\n")))

///Displays to the customer what the trader is selling and how much is in stock
/datum/component/trader/proc/trader_sells_what(mob/customer)
Expand All @@ -413,7 +413,7 @@ Can accept both a type path, and an instance of a datum. Type path has priority.
sell_info += span_notice("&bull; [span_red("(OUT OF STOCK)")] [initial(thing.name)] for [product_info[TRADER_PRODUCT_INFO_PRICE]] [trader_data.currency_name]; [span_red("[tern_op_result]")] left in stock")
else
sell_info += span_notice("&bull; [initial(thing.name)] for [product_info[TRADER_PRODUCT_INFO_PRICE]] [trader_data.currency_name]; [span_green("[tern_op_result]")] left in stock")
to_chat(customer, examine_block(sell_info.Join("\n")))
to_chat(customer, boxed_message(sell_info.Join("\n")))

///Sets quantity of all products to initial(quanity); this proc is currently called during initialize
/datum/component/trader/proc/restock_products()
Expand Down
4 changes: 2 additions & 2 deletions code/datums/elements/slapcrafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
// If we did find ingredients then add them onto the list.
if(length(string_ingredient_list))
to_chat(user, span_boldnotice("Extra Ingredients:"))
to_chat(user, examine_block(span_notice(string_ingredient_list)))
to_chat(user, boxed_message(span_notice(string_ingredient_list)))

var/list/tool_list = ""

Expand All @@ -194,6 +194,6 @@

if(length(tool_list))
to_chat(user, span_boldnotice("Required Tools:"))
to_chat(user, examine_block(span_notice(tool_list)))
to_chat(user, boxed_message(span_notice(tool_list)))

qdel(cur_recipe)
124 changes: 0 additions & 124 deletions code/datums/elements/weapon_description.dm

This file was deleted.

4 changes: 2 additions & 2 deletions code/datums/mind/skills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
untrained_skills += known_skill

if(!length(shown_skills))
to_chat(user, examine_block(span_notice("You don't have any particularly outstanding skills.")))
to_chat(user, boxed_message(span_notice("You don't have any particularly outstanding skills.")))
return

var/list/skill_strings = list()
Expand All @@ -145,4 +145,4 @@
skill_strings += span_smallnoticeital("&bull; [initial(shown_skill.name)] - [get_skill_level_name(shown_skill)]")

sortTim(skill_strings, GLOBAL_PROC_REF(cmp_text_asc))
to_chat(user, examine_block("[span_info("<em>Your skills:</em>")]<br>[jointext(skill_strings, "<br>")]"))
to_chat(user, boxed_message("[span_info("<em>Your skills:</em>")]<br>[jointext(skill_strings, "<br>")]"))
2 changes: 1 addition & 1 deletion code/datums/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@
if(LAZYLEN(mob_parent.quirks))
msg += span_notice("You have these quirks: [mob_parent.get_quirk_string(FALSE, CAT_QUIRK_ALL)].")

to_chat(user, examine_block(msg))
to_chat(user, boxed_message(msg))

/// Updates the mob's moodies, if the area provides a mood bonus
/datum/mood/proc/check_area_mood(datum/source, area/new_area)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/mutations/antenna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
to_chat(cast_on, span_danger("You feel something foreign enter your mind."))
log_info += "Target alerted!"

to_chat(owner, examine_block(span_notice(jointext(discovered_info, "<br>"))))
to_chat(owner, boxed_message(span_notice(jointext(discovered_info, "<br>"))))
log_combat(owner, cast_on, "mind read (cast intentionally)", null, "info: [english_list(log_info, and_text = ", ")]")

/datum/action/cooldown/spell/pointed/mindread/proc/on_examining(mob/examiner, atom/examining)
Expand All @@ -156,12 +156,12 @@
if(QDELETED(examiner))
return
if(antimagic)
to_chat(examiner, examine_block(span_warning("You attempt to analyze [examined]'s current thoughts, but fail to penetrate [examined.p_their()] mind - It seems you've been foiled.")))
to_chat(examiner, boxed_message(span_warning("You attempt to analyze [examined]'s current thoughts, but fail to penetrate [examined.p_their()] mind - It seems you've been foiled.")))
return

var/list/log_info = list()

to_chat(examiner, examine_block(span_notice("<i>You analyze [examined]'s current thoughts...</i><br>&emsp;\"[read_text]\"...")))
to_chat(examiner, boxed_message(span_notice("<i>You analyze [examined]'s current thoughts...</i><br>&emsp;\"[read_text]\"...")))
log_info += "Current thought: \"[read_text]\""

if(prob(10))
Expand Down
4 changes: 2 additions & 2 deletions code/datums/quirks/_quirk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
* * Category- Which types of quirks we want to print out. Defaults to everything
* * from_scan- If the source of this call is like a health analyzer or HUD, in which case QUIRK_HIDE_FROM_MEDICAL hides the quirk.
*/
/mob/living/proc/get_quirk_string(medical = FALSE, category = CAT_QUIRK_ALL, from_scan = FALSE)
/mob/living/proc/get_quirk_string(medical = FALSE, category = CAT_QUIRK_ALL, from_scan = FALSE, none_text)
var/list/dat = list()
for(var/datum/quirk/candidate as anything in quirks)
if(from_scan && (candidate.quirk_flags & QUIRK_HIDE_FROM_SCAN))
Expand All @@ -227,7 +227,7 @@
dat += medical ? candidate.medical_record_text : candidate.name

if(!dat.len)
return medical ? "No issues have been declared." : "None"
return isnull(none_text) ? (medical ? "No issues have been declared." : "None") : none_text
return medical ? dat.Join("<br>") : dat.Join(", ")

/mob/living/proc/cleanse_quirk_datums() //removes all trait datums
Expand Down
9 changes: 5 additions & 4 deletions code/datums/votes/_vote_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@
* Return a formatted string of text to be displayed to everyone.
*/
/datum/vote/proc/get_result_text(list/all_winners, real_winner, list/non_voters)
var/title_text = ""
var/returned_text = ""
if(override_question)
returned_text += span_bold(override_question)
title_text += span_bold(override_question)
else
returned_text += span_bold("[capitalize(name)] Vote")
title_text += span_bold("[capitalize(name)] Vote")

returned_text += "<br>Winner Selection: "
returned_text += "Winner Selection: "
switch(winner_method)
if(VOTE_WINNER_METHOD_NONE)
returned_text += "None"
Expand Down Expand Up @@ -233,7 +234,7 @@
returned_text += "<br>"
returned_text += get_winner_text(all_winners, real_winner, non_voters)

return returned_text
return fieldset_block(title_text, returned_text, "boxed_message purple_box")

/**
* Gets the text that displays the winning options within the result text.
Expand Down
Loading
Loading