From aada68392aa18219fd69fcd66f8e5b082bbdaca2 Mon Sep 17 00:00:00 2001 From: lessthanthree <83487515+lessthnthree@users.noreply.github.com> Date: Thu, 4 Jan 2024 01:01:20 +0000 Subject: [PATCH] Make server announcement OOC [NO GBP] (#80741) ## About The Pull Request Makes the server admin announcement use tgchat's OOC colors and stops using announcement.ogg, so players don't mistake it for a Centcom announcement. ![image](https://github.com/tgstation/tgstation/assets/83487515/32b965a3-58df-45d5-9238-fdb954c8448e) ![image](https://github.com/tgstation/tgstation/assets/83487515/3174d8c9-4194-4a96-844b-d92a6723dce2) ## Why It's Good For The Game Melbert was right. ## Changelog :cl: LT3 fix: OOC announcements will now be in shown in OOC colors /:cl: --- code/__DEFINES/span.dm | 3 +++ code/__HELPERS/announcements.dm | 18 ++++++++++-------- code/modules/admin/verbs/admin.dm | 2 +- .../tgui-panel/styles/tgchat/chat-dark.scss | 18 ++++++++++++++++++ .../tgui-panel/styles/tgchat/chat-light.scss | 18 ++++++++++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-) diff --git a/code/__DEFINES/span.dm b/code/__DEFINES/span.dm index a30e980770b..bf918b55efc 100644 --- a/code/__DEFINES/span.dm +++ b/code/__DEFINES/span.dm @@ -72,6 +72,7 @@ #define span_linkify(str) ("" + str + "") #define span_looc(str) ("" + str + "") #define span_major_announcement_text(str) ("" + str + "") +#define span_major_announcement_title(str) ("" + str + "") #define span_medal(str) ("" + str + "") #define span_medradio(str) ("" + str + "") #define span_memo(str) ("" + str + "") @@ -88,6 +89,7 @@ #define span_notice(str) ("" + str + "") #define span_noticealien(str) ("" + str + "") #define span_ooc(str) ("" + str + "") +#define span_ooc_announcement_text(str) ("" + str + "") #define span_papyrus(str) ("" + str + "") #define span_phobia(str) ("" + str + "") #define span_prefix(str) ("" + str + "") @@ -121,6 +123,7 @@ #define span_spiderbroodmother(str) ("" + str + "") #define span_spiderscout(str) ("" + str + "") #define span_spiderbreacher(str) ("" + str + "") +#define span_subheader_announcement_text(str) ("" + str + "") #define span_suicide(str) ("" + str + "") #define span_suppradio(str) ("" + str + "") #define span_syndradio(str) ("" + str + "") diff --git a/code/__HELPERS/announcements.dm b/code/__HELPERS/announcements.dm index d0deab12e99..5d7d0f65408 100644 --- a/code/__HELPERS/announcements.dm +++ b/code/__HELPERS/announcements.dm @@ -21,16 +21,15 @@ * * color_override - optional, set a color for the announcement box */ -/proc/send_formatted_announcement( +/proc/send_ooc_announcement( text, title = "", players, play_sound = TRUE, - sound_override = 'sound/ai/default/attention.ogg', + sound_override = 'sound/misc/bloop.ogg', sender_override = "Server Admin Announcement", encode_title = TRUE, encode_text = TRUE, - color_override = "grey", ) if(isnull(text)) return @@ -44,9 +43,10 @@ if(!length(text)) return - announcement_strings += span_announcement_header(generate_unique_announcement_header(title, sender_override)) - announcement_strings += span_major_announcement_text(text) - var/finalized_announcement = create_announcement_div(jointext(announcement_strings, ""), color_override) + announcement_strings += span_major_announcement_title(sender_override) + announcement_strings += span_subheader_announcement_text(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) @@ -72,5 +72,7 @@ * * color - optional, set a div color other than default */ /proc/create_announcement_div(message, color = "default") - var/processed_message = "
[message]
" - return processed_message + return "
[message]
" + +/proc/create_ooc_announcement_div(message) + return "
[message]
" diff --git a/code/modules/admin/verbs/admin.dm b/code/modules/admin/verbs/admin.dm index ebba2ed5728..88c183ab507 100644 --- a/code/modules/admin/verbs/admin.dm +++ b/code/modules/admin/verbs/admin.dm @@ -37,7 +37,7 @@ if(message) if(!check_rights(R_SERVER,0)) message = adminscrub(message,500) - send_formatted_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]") + send_ooc_announcement(message, "From [usr.client.holder.fakekey ? "Administrator" : usr.key]") log_admin("Announce: [key_name(usr)] : [message]") BLACKBOX_LOG_ADMIN_VERB("Announce") diff --git a/tgui/packages/tgui-panel/styles/tgchat/chat-dark.scss b/tgui/packages/tgui-panel/styles/tgchat/chat-dark.scss index 0d62901c17a..ab90a0de6bb 100644 --- a/tgui/packages/tgui-panel/styles/tgchat/chat-dark.scss +++ b/tgui/packages/tgui-panel/styles/tgchat/chat-dark.scss @@ -1064,6 +1064,24 @@ $border-width-px: $border-width * 1px; flex-direction: column; } +.ooc_alert { + background: #4d4100; + border: 1px solid #cca300; + margin: 0.5em; + padding: 0.5em 0.5em 0.5em 0.2em; + color: #ffffff; + font-weight: bold; + display: flex; + flex-direction: column; +} + +.ooc_announcement_text { + color: #cca300; + padding: 0.5em 0 0 0.35em; + display: flex; + flex-direction: column; +} + @each $color-name, $color-value in $alert-stripe-colors { .chat_alert_#{$color-name} { color: #ffffff; diff --git a/tgui/packages/tgui-panel/styles/tgchat/chat-light.scss b/tgui/packages/tgui-panel/styles/tgchat/chat-light.scss index 759b07cfbd8..ee79b2298bd 100644 --- a/tgui/packages/tgui-panel/styles/tgchat/chat-light.scss +++ b/tgui/packages/tgui-panel/styles/tgchat/chat-light.scss @@ -1091,6 +1091,24 @@ $border-width-px: $border-width * 1px; flex-direction: column; } +.ooc_alert { + background: #bdc8ff; + border: 1px solid #002eb8; + margin: 0.5em; + padding: 0.5em 0.5em 0.5em 0.2em; + color: #00283a; + font-weight: bold; + display: flex; + flex-direction: column; +} + +.ooc_announcement_text { + color: #002eb8; + padding: 0.5em 0 0 0.35em; + display: flex; + flex-direction: column; +} + @each $color-name, $color-value in $alert-stripe-colors { .chat_alert_#{$color-name} { color: #ffffff;