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

More chat style updates - new announcement colors, admin announcement changes, and more #16087

Merged
merged 15 commits into from
Jun 29, 2024
Merged
2 changes: 2 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@
#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>")

#define EXAMINE_SECTION_BREAK "<hr>"
10 changes: 5 additions & 5 deletions code/__DEFINES/span.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
#define span_alert(str) ("<span class='alert'>" + str + "</span>")
#define span_alertalien(str) ("<span class='alertalien'>" + str + "</span>")
#define span_alien(str) ("<span class='alien'>" + str + "</span>")
#define span_announce_body(str) ("<span class='announce_body'>" + str + "</span>")
#define span_announce_header(str) ("<span class='announce_header'>" + str + "</span>")
#define span_attack(str) ("<span class='attack'>" + str + "</span>")
#define span_avoidharm(str) ("<span class='avoidharms'>" + str + "</span>")
#define span_bad(str) ("<span class='bad'>" + str + "</span>")
#define span_big(str) ("<span class='big'>" + str + "</span>")
#define span_bigdeadsay(str) ("<span class='bigdeadsay'>" + str + "</span>")
#define span_binarysay(str) ("<span class='binarysay'>" + str + "</span>")
#define span_bold(str) ("<span class='bold'>" + str + "</span>")
#define span_boldannounce(str) ("<span class='boldannounce'>" + str + "</span>")
Expand All @@ -18,14 +21,12 @@
#define span_center(str) ("<span class='center'>" + str + "</span>")
#define span_centerbold(str) ("<span class='centerbold'>" + str + "</span>")
#define span_danger(str) ("<span class='danger'>" + str + "</span>")
#define span_bigdeadsay(str) ("<span class='bigdeadsay'>" + str + "</span>")
#define span_deadsay(str) ("<span class='deadsay'>" + str + "</span>")
#define span_tinydeadsay(str) ("<span class='tinydeadsay'>" + str + "</span>")
#define span_disarm(str) ("<span class='disarm'>" + str + "</span>")
#define span_debuginfo(str) ("<span class='debuginfo'>" + str + "</span>")
#define span_event_announcement(str) ("<span class='event_announcement'>" + str + "</span>")
#define span_game(str) ("<span class='game'>" + str + "</span>")
#define span_good(str) ("<span class='good'>" + str + "</span>")
#define span_green(str) ("<span class='green'>" + str + "</span>")
#define span_greenteamradio(str) ("<span class='greenteamradio'>" + str + "</span>")
#define span_greentext(str) ("<span class='greentext'>" + str + "</span>")
#define span_grippy(str) ("<span class='grippy'>" + str + "</span>")
Expand All @@ -51,6 +52,7 @@
#define span_nopositions(str) ("<span class='nopositions'>" + str + "</span>")
#define span_nicegreen(str) ("<span class='nicegreen'>" + str + "</span>")
#define span_notice(str) ("<span class='notice'>" + str + "</span>")
#define span_tinydeadsay(str) ("<span class='tinydeadsay'>" + str + "</span>")
#define span_tinynotice(str) ("<span class='tinynotice'>" + str + "</span>")
#define span_ooc(str) ("<span class='ooc'>" + str + "</span>")
#define span_ordercic(str) ("<span class='ordercic'>" + str + "</span>")
Expand All @@ -68,8 +70,6 @@
#define span_scannerburn(str) ("<span class='scannerburn'>" + str + "</span>")
#define span_scannerburnb(str) ("<span class='scannerburnb'>" + str + "</span>")
#define span_season_additional_info(str) ("<span class='season_additional_info'>" + str + "</span>")
#define span_announce_header(str) ("<span class='announce_header'>" + str + "</span>")
#define span_announce_body(str) ("<span class='announce_body'>" + str + "</span>")
#define span_seasons_announce(str) ("<span class='seasons_announce'>" + str + "</span>")
#define span_suicide(str) ("<span class='suicide'>" + str + "</span>")
#define span_tip(str) ("<span class='tip'>" + str + "</span>")
Expand Down
16 changes: 13 additions & 3 deletions code/__HELPERS/announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#define ANNOUNCEMENT_PRIORITY 2
#define ANNOUNCEMENT_COMMAND 3

// don't use any of these macros outside of here to keep the appearance of alerts consistent (unless you need to make them global for some reason)
// if you want to design a faction alert to use in a message or something, use assemble_alert()
// Do not use these macros outside of here (unless you absolutely have to or something), this is mainly to make sure they appear consistent
// The best way to use these for to_chats or something would be assemble_alert()

// a style for extra padding on alert titles
#define span_alert_header(str) ("<span class='alert_header'>" + str + "</span>")
Expand Down Expand Up @@ -68,7 +68,17 @@
* * receivers - a list of all players to send the message to. defaults to all humans, AIs and ghosts
* * playing_sound - optional, is this playing sound?
*/
/proc/priority_announce(message, title = "Announcement", subtitle = "", type = ANNOUNCEMENT_REGULAR, sound = 'sound/misc/notice2.ogg', channel_override = CHANNEL_ANNOUNCEMENTS, color_override, list/receivers = (GLOB.alive_human_list + GLOB.ai_list + GLOB.observer_list), playing_sound = TRUE)
/proc/priority_announce(
message,
title = "Announcement",
subtitle = "",
type = ANNOUNCEMENT_REGULAR,
sound = 'sound/misc/notice2.ogg',
channel_override = CHANNEL_ANNOUNCEMENTS,
color_override,
list/receivers = (GLOB.alive_human_list + GLOB.ai_list + GLOB.observer_list),
playing_sound = TRUE
)
if(!message)
return

Expand Down
80 changes: 80 additions & 0 deletions code/__HELPERS/ooc_announcement.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// These are local since they don't really need to be used anywhere else
#define span_ooc_announcement_text(str) ("<span class='ooc_announcement_text'>" + str + "</span>")
#define span_ooc_alert_subtitle(str) ("<span class='faction_alert_subtitle'>" + str + "</span>")
#define span_major_announcement_title(str) ("<span class='faction_alert_title'>" + str + "</span>")
/**
* Sends a div formatted chat box announcement
*
* Formatted like:
*
* " Server Announcement " (or sender_override)
*
* " Title "
*
* " Text "
*
* Arguments
* * text - required, the text to announce
* * title - optional, the title of the announcement.
* * players - optional, a list of all players to send the message to. defaults to the entire world
* * play_sound - if TRUE, play a sound with the announcement (based on player option)
* * sound_override - optional, override the default announcement sound
* * sender_override - optional, modifies the sender of the announcement
* * encode_title - if TRUE, the title will be HTML encoded (escaped)
* * encode_text - if TRUE, the text will be HTML encoded (escaped)
*/

/proc/send_ooc_announcement(
text,
title = "",
players,
play_sound = TRUE,
sound_override = 'sound/misc/bloop.ogg',
sender_override = "Server Admin Announcement",
encode_title = TRUE,
encode_text = FALSE,
)
if(isnull(text))
return

var/list/announcement_strings = list()

if(encode_title && title && length(title) > 0)
title = html_encode(title)
if(encode_text)
text = html_encode(text)
if(!length(text))
return

announcement_strings += span_major_announcement_title(sender_override)
announcement_strings += span_ooc_alert_subtitle(title)
announcement_strings += span_ooc_announcement_text(text)
var/finalized_announcement = create_ooc_announcement_div(jointext(announcement_strings, ""))

if(islist(players))
for(var/mob/target in players)
to_chat(target, finalized_announcement)
if(play_sound)
SEND_SOUND(target, sound(sound_override))
else
to_chat(world, finalized_announcement)

if(!play_sound)
return

for(var/mob/player in GLOB.player_list)
SEND_SOUND(player, sound(sound_override))

/**
* Inserts a span styled message into an OOC alert style div
*
*
* Arguments
* * message - required, the message contents
*/
/proc/create_ooc_announcement_div(message)
return "<div class='ooc_alert'>[message]</div>"

#undef span_ooc_announcement_text
#undef span_ooc_alert_subtitle
#undef span_major_announcement_title
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ SUBSYSTEM_DEF(ticker)
tip = pick(SSstrings.get_list_from_file("tips/meme"))

if(tip)
to_chat(world, "<br>[span_tip(examine_block("[html_encode(tip)]"))]<br>")
to_chat(world, examine_block("[span_tip("<big>Tip of the round:</big>")][EXAMINE_SECTION_BREAK][html_encode(tip)]"))


/datum/controller/subsystem/ticker/proc/check_queue()
Expand Down
6 changes: 3 additions & 3 deletions code/datums/elements/shrapnel_removal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
span_notice("You fumble around figuring out how to use [removaltool]."))
if(!do_after(user, fumble_duration * (SKILL_MEDICAL_PRACTICED - skill), NONE, target, BUSY_ICON_UNSKILLED))
return
user.visible_message(span_notice("[user] starts searching for shrapnel in [target] with the [removaltool]."), span_notice("You start searching for shrapnel in [target] with the [removaltool]."))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_MEDICAL))
user.visible_message(span_green("[user] starts searching for shrapnel in [target] with the [removaltool]."), span_green("You start searching for shrapnel in [target] with the [removaltool]."))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_FRIENDLY, BUSY_ICON_MEDICAL))
to_chat(user, span_notice("You stop searching for shrapnel in [target]"))
return
remove_shrapnel(user, target, targetlimb, skill)
//iterates over the rest of the patient's limbs, attempting to remove shrapnel
for(targetlimb AS in target.limbs)
while(has_shrapnel(targetlimb))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_MEDICAL))
if(!do_after(user, do_after_time, NONE, target, BUSY_ICON_FRIENDLY, BUSY_ICON_MEDICAL))
to_chat(user, span_notice("You stop searching for shrapnel in [target]"))
return
remove_shrapnel(user, target, targetlimb, skill)
Expand Down
9 changes: 6 additions & 3 deletions code/datums/gamemodes/hvh.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,12 @@ Sensors indicate [num_som_delta || "no"] unknown lifeform signature[num_som_delt

for(var/i in GLOB.observer_list)
var/mob/M = i
to_chat(M, "<span class='announce_header'>Detailed Information</span>")
to_chat(M, {"<span class='announce_body'>[num_som] SOM alive.
[num_tgmc] Marine\s alive."})
to_chat(M, assemble_alert(
title = "Detailed Bioscan",
message = {"[num_som] SOM alive.
[num_tgmc] Marine\s alive."},
color_override = "orange"
))

message_admins("Bioscan - Marines: [num_tgmc] active TGMC personnel[tgmc_location ? " .Location:[tgmc_location]":""]")
message_admins("Bioscan - SOM: [num_som] active SOM personnel[som_location ? " .Location:[som_location]":""]")
Expand Down
3 changes: 1 addition & 2 deletions code/datums/gamemodes/infestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@
[numHostsPlanet] human\s on the planet.
[numHostsShip] human\s on the ship.
[numHostsTransit] human\s in transit."},
color_override = "purple",
minor = TRUE
color_override = "purple"
))

message_admins("Bioscan - Humans: [numHostsPlanet] on the planet[hostLocationP ? ". Location:[hostLocationP]":""]. [numHostsShipr] on the ship.[hostLocationS ? " Location: [hostLocationS].":""]. [numHostsTransitr] in transit.")
Expand Down
12 changes: 10 additions & 2 deletions code/game/atoms/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,13 @@ directive is properly returned.

if(length(result))
for(var/i in 1 to (length(result) - 1))
result[i] += "\n"
if(result[i] != EXAMINE_SECTION_BREAK)
result[i] += "\n"
else
// remove repeated <hr's> and ones on the ends.
if((i == 1) || (i == length(result)) || (result[i - 1] == EXAMINE_SECTION_BREAK))
result.Cut(i, i + 1)
i--

to_chat(src, examine_block(span_infoplain(result.Join())))
SEND_SIGNAL(src, COMSIG_MOB_EXAMINATE, examinify)
Expand Down Expand Up @@ -349,16 +355,18 @@ directive is properly returned.
SHOULD_CALL_PARENT(TRUE)
var/examine_string = get_examine_string(user, thats = TRUE)
if(examine_string)
. = list("[examine_string].")
. = list("[examine_string].", EXAMINE_SECTION_BREAK)
else
. = list()

if(desc)
. += desc
if(user.can_use_codex() && SScodex.get_codex_entry(get_codex_value()))
. += EXAMINE_SECTION_BREAK
. += span_notice("The codex has <a href='?_src_=codex;show_examined_info=[REF(src)];show_to=[REF(user)]'>relevant information</a> available.")

if((get_dist(user,src) <= 2) && reagents)
. += EXAMINE_SECTION_BREAK
if(reagents.reagent_flags & TRANSPARENT)
. += "It contains:"
if(length(reagents.reagent_list)) // TODO: Implement scan_reagent and can_see_reagents() to show each individual reagent
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ GLOBAL_DATUM_INIT(welding_sparks_prepdoor, /mutable_appearance, mutable_appearan

/obj/item/examine(mob/user)
. = ..()
. += EXAMINE_SECTION_BREAK
. += "[gender == PLURAL ? "They are" : "It is"] a [weight_class_to_text(w_class)] item."

/obj/item/attack_ghost(mob/dead/observer/user)
Expand Down
20 changes: 10 additions & 10 deletions code/game/objects/items/stacks/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
if(!success)
to_chat(user, span_warning("The wounds on [patient]'s [target_limb.display_name] have already been treated."))
return
user.visible_message(span_notice("[user] treats the wounds on [patient]'s [target_limb.display_name] with [src]."),
span_notice("You treat the wounds on [patient]'s [target_limb.display_name] with [src].") )
user.visible_message(span_green("[user] treats the wounds on [patient]'s [target_limb.display_name] with [src]."),
span_green("You treat the wounds on [patient]'s [target_limb.display_name] with [src].") )

/obj/item/stack/medical/heal_pack/gauze
name = "roll of gauze"
Expand All @@ -145,8 +145,8 @@
if(!success)
to_chat(user, span_warning("The wounds on [patient]'s [target_limb.display_name] have already been treated."))
return
user.visible_message(span_notice("[user] bandages [patient]'s [target_limb.display_name]."),
span_notice("You bandage [patient]'s [target_limb.display_name].") )
user.visible_message(span_green("[user] bandages [patient]'s [target_limb.display_name]."),
span_green("You bandage [patient]'s [target_limb.display_name].") )

/obj/item/stack/medical/heal_pack/ointment
name = "ointment"
Expand All @@ -161,8 +161,8 @@
if(!success)
to_chat(user, span_warning("The wounds on [patient]'s [target_limb.display_name] have already been treated."))
return
user.visible_message(span_notice("[user] salves wounds on [patient]'s [target_limb.display_name]."),
span_notice("You salve wounds on [patient]'s [target_limb.display_name]."))
user.visible_message(span_green("[user] salves wounds on [patient]'s [target_limb.display_name]."),
span_green("You salve wounds on [patient]'s [target_limb.display_name]."))

/obj/item/stack/medical/heal_pack/gauze/sectoid
name = "\improper healing resin pack"
Expand Down Expand Up @@ -193,8 +193,8 @@
if(!success)
to_chat(user, span_warning("The wounds on [patient]'s [target_limb.display_name] have already been treated."))
return
user.visible_message(span_notice("[user] cleans [patient]'s [target_limb.display_name] and seals its wounds with bioglue."),
span_notice("You clean and seal all the wounds on [patient]'s [target_limb.display_name]."))
user.visible_message(span_green("[user] cleans [patient]'s [target_limb.display_name] and seals its wounds with bioglue."),
span_green("You clean and seal all the wounds on [patient]'s [target_limb.display_name]."))

/obj/item/stack/medical/heal_pack/advanced/burn_pack
name = "advanced burn kit"
Expand All @@ -208,8 +208,8 @@
if(!success)
to_chat(user, span_warning("The wounds on [patient]'s [target_limb.display_name] have already been treated."))
return
user.visible_message(span_notice("[user] covers the wounds on [patient]'s [target_limb.display_name] with regenerative membrane."),
span_notice("You cover the wounds on [patient]'s [target_limb.display_name] with regenerative membrane."))
user.visible_message(span_green("[user] covers the wounds on [patient]'s [target_limb.display_name] with regenerative membrane."),
span_green("You cover the wounds on [patient]'s [target_limb.display_name] with regenerative membrane."))

/obj/item/stack/medical/splint
name = "medical splints"
Expand Down
8 changes: 5 additions & 3 deletions code/modules/admin/fun_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@

to_chat(world, assemble_alert(
title = "Custom Information",
subtitle = "The following custom information has been set for this round.",
subtitle = "An admin set custom information for this round.",
message = GLOB.custom_info,
color_override = "red"
))
SEND_SOUND(src, sound('sound/misc/bloop.ogg'))

log_admin("[key_name(usr)] has changed the custom event text: [GLOB.custom_info]")
message_admins("[ADMIN_TPMONTY(usr)] has changed the custom event text.")
Expand All @@ -310,10 +311,11 @@

to_chat(src, assemble_alert(
title = "Custom Information",
subtitle = "The following custom information has been set for this round.",
subtitle = "An admin set custom information for this round.",
message = GLOB.custom_info,
color_override = "red"
))
SEND_SOUND(src, sound('sound/misc/bloop.ogg'))


/datum/admins/proc/sound_file(S as sound)
Expand Down Expand Up @@ -487,7 +489,7 @@

log_admin("Announce: [key_name(usr)] : [message]")
message_admins("[ADMIN_TPMONTY(usr)] Announces:")
to_chat(world, span_event_announcement("<b>[usr.client.holder.fakekey ? "Administrator" : "[usr.client.key] ([usr.client.holder.rank])"] Announces:</b>\n [message]"))
send_ooc_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]")


/datum/admins/proc/force_distress()
Expand Down
7 changes: 1 addition & 6 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,7 @@
return

if(GLOB.custom_info)
to_chat(src, assemble_alert(
title = "Custom Information",
subtitle = "The following custom information has been set for this round.",
message = GLOB.custom_info,
color_override = "red"
))
custom_info()

connection_time = world.time
connection_realtime = world.realtime
Expand Down
2 changes: 1 addition & 1 deletion code/modules/instruments/songs/editor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
modetext = "<a href='?src=[REF(src)];setexpfalloff=1'>Exponential Falloff Factor</a>: [sustain_exponential_dropoff]% per decisecond<br>"
. += "<a href='?src=[REF(src)];setsustainmode=1'>Sustain Mode</a>: [smt]<br>"
. += modetext
. += using_instrument?.ready()? "Status: [span_good("Ready")]<br>" : "Status: [span_bad("!Instrument Definition Error!")]<br>"
. += using_instrument?.ready()? "Status: [span_green("Ready")]<br>" : "Status: [span_bad("!Instrument Definition Error!")]<br>"
. += "Instrument Type: [legacy? "Legacy" : "Synthesized"]<br>"
. += "<a href='?src=[REF(src)];setvolume=1'>Volume</a>: [volume]<br>"
. += "<a href='?src=[REF(src)];setdropoffvolume=1'>Volume Dropoff Threshold</a>: [sustain_dropoff_volume]<br>"
Expand Down
Loading
Loading