diff --git a/code/__DEFINES/chat.dm b/code/__DEFINES/chat.dm index 5cc40e39c08e..82799f056d87 100644 --- a/code/__DEFINES/chat.dm +++ b/code/__DEFINES/chat.dm @@ -27,3 +27,7 @@ // Role Display #define role_header(str) ("

" + str + "

") #define role_body(str) ("

" + str + "

") + +// Global Narrate +#define narrate_head(str) ("
" + str + "
") +#define narrate_body(str) ("
" + str + "
") \ No newline at end of file diff --git a/code/modules/admin/tabs/event_tab.dm b/code/modules/admin/tabs/event_tab.dm index 7a6359ccf090..47916de28e2b 100644 --- a/code/modules/admin/tabs/event_tab.dm +++ b/code/modules/admin/tabs/event_tab.dm @@ -651,14 +651,29 @@ if (!admin_holder || !(admin_holder.rights & R_MOD)) to_chat(src, "Only administrators may use this command.") return + var/narrate_body_text + var/narrate_header_text + var/narrate_output - var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text + if(tgui_alert(src, "Do you want your narration to include a header paragraph?", "Global Narrate", list("Yes", "No"), timeout = 0) == "Yes") + narrate_header_text = tgui_input_text(src, "Please type the header paragraph below. One or two sentences or a title work best. HTML style tags are available. Paragraphs are not recommended.", "Global Narrate Header", max_length = MAX_BOOK_MESSAGE_LEN, multiline = TRUE, encode = FALSE, timeout = 0) + if(!narrate_header_text) + return + narrate_body_text = tgui_input_text(src, "Please enter the text for your narration. Paragraphs without line breaks produce the best visual results, but HTML tags in general are respected. A preview will be available.", "Global Narrate Text", max_length = MAX_BOOK_MESSAGE_LEN, multiline = TRUE, encode = FALSE, timeout = 0) + if(!narrate_body_text) + return + + if(!narrate_header_text) + narrate_output = "[narrate_body("[narrate_body_text]")]" + else + narrate_output = "[narrate_head("[narrate_header_text]")]" + "[narrate_body("[narrate_body_text]")]" - if(!msg) + to_chat(usr,"[narrate_output]") + if(tgui_alert(src, "Text preview is available. Send narration?", "Confirmation", list("Yes","No"), timeout = 0) != "Yes") return - to_chat_spaced(world, html = SPAN_ANNOUNCEMENT_HEADER_BLUE(msg)) - message_admins("\bold GlobalNarrate: [key_name_admin(usr)] : [msg]") + to_chat(world, "[narrate_output]") + message_admins("[SPAN_BOLD("[key_name_admin(usr)] has sent a Global Narrate message!")]") /client diff --git a/code/stylesheet.dm b/code/stylesheet.dm index b7aa89ad3b5e..8da0df01ab03 100644 --- a/code/stylesheet.dm +++ b/code/stylesheet.dm @@ -155,4 +155,7 @@ h1.alert, h2.alert {color: #000000;} .retro_translator {font-weight: bold;} .yautja_translator {color: #aa0000; font-weight: bold;} +.narrate_head {font-size: 3; text-align: center; color: #ffccff;padding: 0em 1em;} +.narrate_body {font-size: 2; text-align: justify; color: #ff99ff;padding: 0em 1em;} + "} diff --git a/tgui/packages/tgui-panel/chat/constants.js b/tgui/packages/tgui-panel/chat/constants.js index ac9346d8d5f0..d3de3bb5fd81 100644 --- a/tgui/packages/tgui-panel/chat/constants.js +++ b/tgui/packages/tgui-panel/chat/constants.js @@ -69,7 +69,7 @@ export const MESSAGE_TYPES = [ name: 'Info', description: 'Non-urgent messages from the game and items', selector: - '.notice:not(.pm), .adminnotice, .info, .role_body, .role_header, .event_announcement, .announce_header, .announce_header_blue, .announce_body, .sinister, .cult, .xenonotice, .xenoannounce, .yautjabold, .yautjaboldbig', + '.notice:not(.pm), .adminnotice, .info, .role_body, .role_header, .event_announcement, .announce_header, .announce_header_blue, .announce_body, .sinister, .cult, .xenonotice, .xenoannounce, .yautjabold, .yautjaboldbig, .narrate_head, .narrate_body', }, { type: MESSAGE_TYPE_WARNING, diff --git a/tgui/packages/tgui-panel/styles/goon/chat-dark.scss b/tgui/packages/tgui-panel/styles/goon/chat-dark.scss index 7de86558bb57..455abb5177f0 100644 --- a/tgui/packages/tgui-panel/styles/goon/chat-dark.scss +++ b/tgui/packages/tgui-panel/styles/goon/chat-dark.scss @@ -1446,3 +1446,17 @@ em { font-style: italic; border-bottom: 1px dashed #fff; } + +.narrate_head { + font-size: 140%; + color: #ffccff; + text-align: center; + padding: 0em 1em; +} + +.narrate_body { + font-size: 110%; + color: #ff99ff; + text-align: justify; + padding: 0em 1em; +} diff --git a/tgui/packages/tgui-panel/styles/goon/chat-light.scss b/tgui/packages/tgui-panel/styles/goon/chat-light.scss index 5520e5d980b3..8cd8d1720930 100644 --- a/tgui/packages/tgui-panel/styles/goon/chat-light.scss +++ b/tgui/packages/tgui-panel/styles/goon/chat-light.scss @@ -1468,3 +1468,17 @@ h2.alert { font-style: italic; border-bottom: 1px dashed #000; } + +.narrate_head { + font-size: 140%; + color: #3d103d; + text-align: center; + padding: 0em 1em; +} + +.narrate_body { + font-size: 110%; + color: #020002; + text-align: justify; + padding: 0em 1em; +}