From 4b45dab114403715c3e4053d676f1e798e4dc5c6 Mon Sep 17 00:00:00 2001
From: QuoteFox <49098813+quotefox@users.noreply.github.com>
Date: Mon, 28 Sep 2020 16:48:32 +0100
Subject: [PATCH] Radio sounds
When you hear a message over the radio, it plays a non-intrusive radio sound, this can be toggled in preferences. Heavily inspired by goon station.
---
code/modules/client/preferences.dm | 13 ++++++++-----
code/modules/client/preferences_savefile.dm | 3 +++
code/modules/mob/living/say.dm | 2 ++
sound/voice/radio.ogg | Bin 0 -> 4388 bytes
tgstation.dme | 2 +-
5 files changed, 14 insertions(+), 6 deletions(-)
create mode 100644 sound/voice/radio.ogg
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 28ae3ea7..8e0ec157 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -46,6 +46,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/buttons_locked = FALSE
var/hotkeys = FALSE
var/chat_on_map = TRUE
+ var/radiosounds = TRUE
var/max_chat_length = CHAT_MESSAGE_MAX_LENGTH
var/see_chat_non_mob = TRUE
var/tgui_fancy = TRUE
@@ -861,9 +862,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "UI Style: [UI_style]
"
dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
"
dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
"
- dat += "Show Runechat Chat Bubbles: [chat_on_map ? "Enabled" : "Disabled"]
"
- dat += "Runechat message char limit: [max_chat_length]
"
- dat += "See Runechat for non-mobs: [see_chat_non_mob ? "Enabled" : "Disabled"]
"
+ dat += "Chat Bubbles: [chat_on_map ? "Enabled" : "Disabled"]
"
+ dat += "Chat Bubbles message char limit: [max_chat_length]
"
+ dat += "Chat Bubbles for non-mobs: [see_chat_non_mob ? "Enabled" : "Disabled"]
"
+ dat += "
"
+ dat += "Radio Sounds: [radiosounds ? "Enabled" : "Disabled"]
"
dat += "
"
dat += "Action Buttons: [(buttons_locked) ? "Locked In Place" : "Unlocked"]
"
dat += "Keybindings: [(hotkeys) ? "Hotkeys" : "Default"]
"
@@ -938,8 +941,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "Be [capitalize(i)]: \[IN [days_remaining] DAYS]
"
else
dat += "Be [capitalize(i)]: [(i in be_special) ? "Enabled" : "Disabled"]
"
-
-
dat += "
"
dat += ""
dat += ""
@@ -2382,6 +2383,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
buttons_locked = !buttons_locked
if("chat_on_map")
chat_on_map = !chat_on_map
+ if("radiosounds")
+ radiosounds = !radiosounds
if("see_chat_non_mob")
see_chat_non_mob = !see_chat_non_mob
if("tgui_fancy")
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index cca8266c..1c4c6a88 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -101,6 +101,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["uses_glasses_colour"]>> uses_glasses_colour
S["clientfps"] >> clientfps
S["chat_on_map"] >> chat_on_map
+ S["radiosounds"] >> chat_on_map
S["max_chat_length"] >> max_chat_length
S["see_chat_non_mob"] >> see_chat_non_mob
@@ -137,6 +138,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
UI_style = sanitize_inlist(UI_style, GLOB.available_ui_styles, GLOB.available_ui_styles[1])
hotkeys = sanitize_integer(hotkeys, 0, 1, initial(hotkeys))
chat_on_map = sanitize_integer(chat_on_map, 0, 1, initial(chat_on_map))
+ radiosounds = sanitize_integer(radiosounds, 0, 1, initial(radiosounds))
max_chat_length = sanitize_integer(max_chat_length, 1, CHAT_MESSAGE_MAX_LENGTH, initial(max_chat_length))
see_chat_non_mob = sanitize_integer(see_chat_non_mob, 0, 1, initial(see_chat_non_mob))
tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy))
@@ -192,6 +194,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["UI_style"], UI_style)
WRITE_FILE(S["hotkeys"], hotkeys)
WRITE_FILE(S["chat_on_map"], chat_on_map)
+ WRITE_FILE(S["radiosounds"], radiosounds)
WRITE_FILE(S["max_chat_length"], max_chat_length)
WRITE_FILE(S["see_chat_non_mob"], see_chat_non_mob)
WRITE_FILE(S["tgui_fancy"], tgui_fancy)
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index c608e584..23df3438 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -241,6 +241,8 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
// Create map text prior to modifying message for goonchat
if (client?.prefs.chat_on_map && stat != UNCONSCIOUS && (client.prefs.see_chat_non_mob || ismob(speaker)) && can_hear())
create_chat_message(speaker, message_language, raw_message, spans, message_mode)
+ if (client?.prefs.radiosounds && stat != UNCONSCIOUS && can_hear() && radio_freq)
+ playsound_local(src,'sound/voice/radio.ogg', 40, 1)
// Recompose message for AI hrefs, language incomprehension.
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mode)
diff --git a/sound/voice/radio.ogg b/sound/voice/radio.ogg
new file mode 100644
index 0000000000000000000000000000000000000000..0dcb87214ff4563daca5be5dd76c503717fa9d9b
GIT binary patch
literal 4388
zcmd5tmIin)KS#Zl!k9w
za5;-Z%s}mI_r@$y&IcO+z~rC6<{ReZH5dXH0F0{$MUM$ZpHNB@
zXjXa^7<>!>?dg`Z63gpnZG-QUg8Tf!8JYcV42Dj?QllM5-ns}y^$x79IJE@VVYU@(
zYR;Ska4_Wig|3WCb6QEIcl^v6OyN%Oc*vfBWZSvAWk$&ObcxBSUC
zjqBJCxtkQIq9@4WT3-5k6uDYA9+O6047oMdwR?C}RQ5N$+3-MreXwqMU)JIRzdpGi
zyY3LDt7h)-$t$)=W;^EB1)MxtLVt!6MP8#3D`!171puF8Ne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/tgstation.dme
+++ b/tgstation.dme
@@ -1147,7 +1147,6 @@
#include "code\modules\admin\verbs\adminjump.dm"
#include "code\modules\admin\verbs\adminpm.dm"
#include "code\modules\admin\verbs\adminsay.dm"
-#include "code\modules\admin\verbs\spawnfloorcluwne.dm"
#include "code\modules\admin\verbs\ak47s.dm"
#include "code\modules\admin\verbs\atmosdebug.dm"
#include "code\modules\admin\verbs\bluespacearty.dm"
@@ -1176,6 +1175,7 @@
#include "code\modules\admin\verbs\pray.dm"
#include "code\modules\admin\verbs\randomverbs.dm"
#include "code\modules\admin\verbs\reestablish_db_connection.dm"
+#include "code\modules\admin\verbs\spawnfloorcluwne.dm"
#include "code\modules\admin\verbs\spawnobjasmob.dm"
#include "code\modules\admin\verbs\tripAI.dm"
#include "code\modules\admin\verbs\SDQL2\SDQL_2.dm"