diff --git a/code/_globalvars/admin.dm b/code/_globalvars/admin.dm index 363b84b923d..96f07e3cca8 100644 --- a/code/_globalvars/admin.dm +++ b/code/_globalvars/admin.dm @@ -28,3 +28,123 @@ GLOBAL_LIST_INIT(vv_special_lists, init_special_list_names()) if(isnull(locate(REF(value)))) output += varname return output + +///A giant associative list of span names, and the associated key to create the text span. Used for narrate verbs. +GLOBAL_LIST_INIT(spanname_to_formatting, list( + "Abductor" = "abductor", + "Admin" = "admin", + "Adminhelp" = "adminhelp", + "Admin Notice" = "adminnotice", + "Admin Observer OOC" = "adminobserverooc", + "Admin OOC" = "adminooc", + "Adminsay" = "adminsay", + "AI Private Radio" = "aiprivradio", + "Alert" = "alert", + "Alien Alert" = "alertalien", + "Syndie Alert" = "alertsyndie", + "Alert Warning" = "alertwarning", + "Alien" = "alien", + "Average" = "average", + "Bad" = "bad", + "Big" = "big", + "Binary Say" = "binarysay", + "Blob" = "blob", + "Blob Announce" = "blobannounce", + "Blue" = "blue", + "Blue Team Radio" = "blueteamradio", + "Bold" = "bold", + "Bold Announce" = "boldannounce", + "Bold Danger" = "bolddanger", + "Bold Italic" = "bolditalic", + "Bold Nice Green" = "boldnicegreen", + "Bold Notice" = "boldnotice", + "Bold Warning" = "boldwarning", + "Big Bold" = "big bold", + "Centcom Radio" = "centcomradio", + "Changeling" = "changeling", + "Clown" = "clown", + "Colossus" = "colossus", + "Command Headset" = "command_headset", + "Cult" = "cult", + "Cult Bold" = "cult_bold", + "Cult Bold Italic" = "cult_bold_italic", + "Cult Italic" = "cult_italic", + "Cult Large" = "cult_large", + "Danger" = "danger", + "Deadchat" = "deadsay", + "Deconversion Message" = "deconversion_message", + "Drone Radio" = "drone", + "Engineering Radio" = "engradio", + "Extremely Big" = "extremelybig", + "Game Say" = "game say", + "Ghost Alert" = "ghostalert", + "Green" = "green", + "Green Announce" = "greenannounce", + "Green Team Radio" = "greenteamradio", + "Greentext" = "greentext", + "Grey" = "grey", + "Hierophant" = "hierophant", + "Hierophant Warning" = "hierophant_warning", + "Highlight" = "highlight", + "His Grace" = "his_grace", + "Holoparasite" = "holoparasite", + "Holoparasite Bold" = "holoparasite bold", + "Hypnosis" = "hypnophrase", + "Icon" = "icon", + "Info" = "info", + "Info Plain" = "infoplain", + "Interface" = "interface", + "Looc" = "looc", + "Medal" = "medal", + "Medradio" = "medradio", + "Message" = "message", + "Mind Control" = "mind_control", + "Monkey" = "monkey", + "Narsie" = "narsie", + "Narsie Small" = "narsiesmall", + "Nice Green" = "nicegreen", + "Notice" = "notice", + "Notice Alien" = "noticealien", + "OOC" = "ooc", + "Papyrus" = "papyrus", + "Phobia" = "phobia", + "Prefix" = "prefix", + "Purple" = "purple", + "Radio" = "radio", + "Really Big" = "reallybig", + "Red" = "red", + "Red Team Radio" = "redteamradio", + "Red Text" = "redtext", + "Golem Resonate" = "resonate", + "Revenant Big Notice" = "revenbignotice", + "Revenant Bold Notice" = "revenboldnotice", + "Revenant Danger" = "revendanger", + "Revenant Minor" = "revenminor", + "Revenant Notice" = "revennotice", + "Revenant Warning" = "revenwarning", + "Robot" = "robot", + "Rose" = "rose", + "Comic Sans" = "sans", + "Science Radio" = "sciradio", + "Security Radio" = "secradio", + "Service Radio" = "servradio", + "Singing" = "singing", + "Slime" = "slime", + "Small" = "small", + "Small Notice" = "smallnotice", + "Small Notice Italic" = "smallnoticeital", + "Spider Broodmother" = "spiderbroodmother", + "Spider Scout" = "spiderscout", + "Spider Breacher" = "spiderbreacher", + "Suicide" = "suicide", + "Supply Radio" = "suppradio", + "Syndicate Radio" = "syndradio", + "Tape Recorder" = "tape_recorder", + "Tiny Notice" = "tinynotice", + "Tiny Notice Italic" = "tinynoticeital", + "Unconcious" = "unconscious", + "User Danger" = "userdanger", + "Warning" = "warning", + "Yelling" = "yell", + "Yellow Team Radio" = "yellowteamradio", + )) diff --git a/code/modules/admin/verbs/adminevents.dm b/code/modules/admin/verbs/adminevents.dm index d6120962fd1..a9d285815ad 100644 --- a/code/modules/admin/verbs/adminevents.dm +++ b/code/modules/admin/verbs/adminevents.dm @@ -8,6 +8,8 @@ ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_subtle_message, R_ADMIN, "Subtle Message", message_admins("[key_name_admin(user)] decided not to answer [ADMIN_LOOKUPFLW(target)]'s prayer") return + msg = user.reformat_narration(msg) + target.balloon_alert(target, "you hear a voice") to_chat(target, "You hear a voice in your head... [msg]", confidential = TRUE) @@ -53,6 +55,8 @@ ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_headset_message, R_ADMIN, "Headset Message message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(target)]'s [sender] request.") return + input = reformat_narration(input) + log_directed_talk(mob, target, input, LOG_ADMIN, "reply") message_admins("[key_name_admin(src)] replied to [key_name_admin(target)]'s [sender] message with: \"[input]\"") target.balloon_alert(target, "you hear a voice") @@ -64,6 +68,7 @@ ADMIN_VERB(cmd_admin_world_narrate, R_ADMIN, "Global Narrate", "Send a direct na var/msg = input(user, "Message:", "Enter the text you wish to appear to everyone:") as text|null if (!msg) return + msg = user.reformat_narration(msg) to_chat(world, "[msg]", confidential = TRUE) log_admin("GlobalNarrate: [key_name(user)] : [msg]") message_admins(span_adminnotice("[key_name_admin(user)] Sent a global narrate")) @@ -76,6 +81,7 @@ ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_local_narrate, R_ADMIN, "Local Narrate", A var/msg = input(user, "Message:", "Enter the text you wish to appear to everyone within view:") as text|null if (!msg) return + msg = user.reformat_narration(msg) for(var/mob/M in view(range, locale)) to_chat(M, msg, confidential = TRUE) @@ -89,6 +95,8 @@ ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_direct_narrate, R_ADMIN, "Direct Narrate", if( !msg ) return + msg = user.reformat_narration(msg) + to_chat(target, msg, confidential = TRUE) log_admin("DirectNarrate: [key_name(user)] to ([key_name(target)]): [msg]") msg = span_adminnotice(" DirectNarrate: [key_name_admin(user)] to ([key_name_admin(target)]): [msg]
") @@ -278,3 +286,14 @@ ADMIN_VERB(command_report_footnote, R_ADMIN, "Command Report Footnote", "Adds a ADMIN_VERB(delay_command_report, R_FUN, "Delay Command Report", "Prevents the roundstart command report from being sent; or forces it to send it delayed.", ADMIN_CATEGORY_EVENTS) GLOB.communications_controller.block_command_report = !GLOB.communications_controller.block_command_report message_admins("[key_name_admin(user)] has [(GLOB.communications_controller.block_command_report ? "delayed" : "sent")] the roundstart command report.") + +///Reformats a narration message. First provides a prompt asking if the user wants to reformat their message, then allows them to pick from a list of spans to use. +/client/proc/reformat_narration(input) + if(tgui_alert(mob, "Set a custom text format?", "Make it snazzy!", list("Yes", "No")) == "Yes") + var/text_span = tgui_input_list(mob, "Select a span!", "Immersion! Yeah!", GLOB.spanname_to_formatting) + if(isnull(text_span)) //In case the user just quit the prompt. + return text_span + text_span = GLOB.spanname_to_formatting[text_span] + input = "" + input + "" + + return input