From d6eb8ec1fe2f6dbac836cc47c60ad18e0370efb4 Mon Sep 17 00:00:00 2001 From: Miauw Date: Tue, 3 Mar 2015 13:26:45 +0100 Subject: [PATCH] Adds a toggle so ghosts can hear radio chatter more easily. --- code/__DEFINES/preferences.dm | 3 ++- code/game/machinery/telecomms/broadcaster.dm | 4 ++++ code/modules/client/preferences_toggles.dm | 9 +++++++++ html/changelogs/Miauw1.yml | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/Miauw1.yml diff --git a/code/__DEFINES/preferences.dm b/code/__DEFINES/preferences.dm index c21cb6c999f..1a859052578 100644 --- a/code/__DEFINES/preferences.dm +++ b/code/__DEFINES/preferences.dm @@ -16,8 +16,9 @@ #define CHAT_GHOSTWHISPER 8192 #define MIDROUND_ANTAG 16384 #define CHAT_GHOSTPDA 32768 +#define CHAT_GHOSTRADIO 65536 -#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|MEMBER_PUBLIC|CHAT_PULLR|INTENT_STYLE|CHAT_GHOSTWHISPER|MIDROUND_ANTAG|CHAT_GHOSTPDA) +#define TOGGLES_DEFAULT (SOUND_ADMINHELP|SOUND_MIDI|SOUND_AMBIENCE|SOUND_LOBBY|CHAT_OOC|CHAT_DEAD|CHAT_GHOSTEARS|CHAT_GHOSTSIGHT|CHAT_PRAYER|CHAT_RADIO|MEMBER_PUBLIC|CHAT_PULLR|INTENT_STYLE|CHAT_GHOSTWHISPER|MIDROUND_ANTAG|CHAT_GHOSTPDA|CHAT_GHOSTRADIO) #define BE_TRAITOR 1 #define BE_OPERATIVE 2 diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm index add0390729f..085ab861d26 100644 --- a/code/game/machinery/telecomms/broadcaster.dm +++ b/code/game/machinery/telecomms/broadcaster.dm @@ -261,6 +261,10 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept if (R.client && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios. receive -= R + for(var/mob/M in player_list) + if(isobserver(M) && M.client && (M.client.prefs.toggles & CHAT_GHOSTRADIO)) + receive |= M + var/rendered = virt.compose_message(virt, virt.languages, message, freq) //Always call this on the virtualspeaker to advoid issues. for(var/atom/movable/hearer in receive) hearer.Hear(rendered, virt, AM.languages, message, freq) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 3f41b53cdfd..98445fcb02c 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -26,6 +26,15 @@ prefs.save_preferences() feedback_add_details("admin_verb","TGW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! +/client/verb/toggle_ghost_radio() + set name = "Show/Hide GhostRadio" + set category = "Preferences" + set desc = ".Enable or disable hearing radio chatter as a ghost" + prefs.toggles ^= CHAT_GHOSTRADIO + src << "As a ghost, you will now [(prefs.toggles & CHAT_GHOSTWHISPER) ? "see radio chatter" : "not see radio chatter"]." + prefs.save_preferences() + feedback_add_details("admin_verb","TGR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //social experiment, increase the generation whenever you copypaste this shamelessly GENERATION 1 + /client/verb/toggle_ghost_pda() set name = "Show/Hide GhostPDA" set category = "Preferences" diff --git a/html/changelogs/Miauw1.yml b/html/changelogs/Miauw1.yml new file mode 100644 index 00000000000..eb63d342d4e --- /dev/null +++ b/html/changelogs/Miauw1.yml @@ -0,0 +1,7 @@ +#ayy lmao +author: Miauw + +delete-after: True + +changes: + - rscadd: "Added a toggle for ghosts that allows them to hear radio chatter without having to hover near intercoms/over people with headsets."