From a5c00915b9af6ab664a4d6b423305de3eba33b37 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Fri, 15 Jun 2018 13:52:12 -0400 Subject: [PATCH] Merge pull request #38482 from DaxDupont/syndicatemess Add syndicate headset messages, squashes both together. --- code/modules/admin/admin.dm | 2 +- code/modules/admin/admin_verbs.dm | 4 ++-- code/modules/admin/topic.dm | 24 +++++++++------------- code/modules/admin/verbs/randomverbs.dm | 27 ++++++++++++++++--------- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 6865e36ac6e4..987502d1b932 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -63,7 +63,7 @@ body += "PM - " body += "SM - " if (ishuman(M) && M.mind) - body += "CM - " + body += "HM - " body += "FLW - " //Default to client logs if available var/source = LOGSRC_MOB diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 391e60761dc0..bb3b50f62e88 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -41,7 +41,7 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin()) /client/proc/getserverlogs, /*for accessing server logs*/ /client/proc/getcurrentlogs, /*for accessing server logs for the current round*/ /client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/ - /datum/admins/proc/cmd_admin_centcom_message, /*send an message to somebody through their headset as CentCom*/ + /client/proc/cmd_admin_headset_message, /*send an message to somebody through their headset as CentCom*/ /client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/ /client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/ /client/proc/check_antagonists, /*shows all antags*/ @@ -186,7 +186,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list( /client/proc/admin_ghost, /client/proc/toggle_view_range, /client/proc/cmd_admin_subtle_message, - /datum/admins/proc/cmd_admin_centcom_message, + /client/proc/cmd_admin_headset_message, /client/proc/cmd_admin_check_contents, /datum/admins/proc/access_news_network, /client/proc/admin_call_shuttle, diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 6c959e13dc89..3866ddf21715 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1817,27 +1817,21 @@ return var/mob/M = locate(href_list["CentComReply"]) - cmd_admin_centcom_message(M) + usr.client.admin_headset_message(M, "CentCom") else if(href_list["SyndicateReply"]) - var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"]) - if(!istype(H)) - to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human.") - return - if(!istype(H.ears, /obj/item/radio/headset)) - to_chat(usr, "The person you are trying to contact is not wearing a headset.") + if(!check_rights(R_ADMIN)) return - message_admins("[src.owner] has started answering [key_name(H)]'s syndicate request.") - var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from The Syndicate", "") - if(!input) - message_admins("[src.owner] decided not to answer [key_name(H)]'s syndicate request.") + var/mob/M = locate(href_list["SyndicateReply"]) + usr.client.admin_headset_message(M, "Syndicate") + + else if(href_list["HeadsetMessage"]) + if(!check_rights(R_ADMIN)) return - to_chat(src.owner, "You sent [input] to [H] via a secure channel.") - log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].") - message_admins("[src.owner] replied to [key_name(H)]'s Syndicate message with: \"[input]\"") - to_chat(H, "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"") + var/mob/M = locate(href_list["HeadsetMessage"]) + usr.client.admin_headset_message(M) else if(href_list["reject_custom_name"]) if(!check_rights(R_ADMIN)) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 481bf1d7e578..56c84bbf8f72 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -45,9 +45,13 @@ admin_ticket_log(M, msg) SSblackbox.record_feedback("tally", "admin_verb", 1, "Subtle Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/cmd_admin_centcom_message(mob/M in GLOB.mob_list) +/client/proc/cmd_admin_headset_message(mob/M in GLOB.mob_list) set category = "Special Verbs" - set name = "CentCom Message" + set name = "Headset Message" + + admin_headset_message(M) + +/client/proc/admin_headset_message(mob/M in GLOB.mob_list, sender = null) var/mob/living/carbon/human/H = M if(!check_rights(R_ADMIN)) @@ -60,17 +64,22 @@ to_chat(usr, "The person you are trying to contact is not wearing a headset.") return - message_admins("[key_name_admin(src)] has started answering [key_name_admin(H)]'s CentCom request.") - var/input = input("Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from CentCom", "") as text|null + if (!sender) + sender = input("Who is the message from?", "Sender") as null|anything in list("CentCom","Syndicate") + if(!sender) + return + + message_admins("[key_name_admin(src)] has started answering [key_name_admin(H)]'s [sender] request.") + var/input = input("Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from [sender]", "") as text|null if(!input) - message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(H)]'s CentCom request.") + message_admins("[key_name_admin(src)] decided not to answer [key_name_admin(H)]'s [sender] request.") return - log_admin("[key_name(src)] replied to [key_name(H)]'s CentCom message with the message [input].") - message_admins("[key_name_admin(src)] replied to [key_name_admin(H)]'s CentCom message with: \"[input]\"") - to_chat(H, "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows: [input]. Message ends.\"") + log_admin("[key_name(src)] replied to [key_name(H)]'s [sender] message with the message [input].") + message_admins("[key_name_admin(src)] replied to [key_name_admin(H)]'s [sender] message with: \"[input]\"") + to_chat(H, "You hear something crackle in your ears for a moment before a voice speaks. \"Please stand by for a message from [sender == "Syndicate" ? "your benefactor" : "Central Command"]. Message as follows[sender == "Syndicate" ? ", agent." : ":"] [input]. Message ends.\"") - SSblackbox.record_feedback("tally", "admin_verb", 1, "CentCom Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("tally", "admin_verb", 1, "Headset Message") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_mod_antag_rep(client/C in GLOB.clients, var/operation) set category = "Special Verbs"