diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index 2665d2215eb..bb0bfca26a9 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -55,6 +55,9 @@ var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN) GLOB.requests.message_centcom(sender.client, msg) msg = span_adminnotice("CENTCOM:[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)]: [msg]") + for(var/client/staff as anything in GLOB.admins) + if(staff?.prefs.read_preference(/datum/preference/toggle/comms_notification)) + SEND_SOUND(staff, sound('sound/misc/announce_dig.ogg')) to_chat(GLOB.admins, msg, confidential = TRUE) for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list) console.override_cooldown() @@ -64,6 +67,9 @@ var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN) GLOB.requests.message_syndicate(sender.client, msg) msg = span_adminnotice("SYNDICATE:[ADMIN_FULLMONTY(sender)] [ADMIN_SYNDICATE_REPLY(sender)]: [msg]") + for(var/client/staff as anything in GLOB.admins) + if(staff?.prefs.read_preference(/datum/preference/toggle/comms_notification)) + SEND_SOUND(staff, sound('sound/misc/announce_dig.ogg')) to_chat(GLOB.admins, msg, confidential = TRUE) for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list) console.override_cooldown() @@ -73,6 +79,8 @@ var/msg = copytext_char(sanitize(text), 1, MAX_MESSAGE_LEN) GLOB.requests.nuke_request(sender.client, msg) msg = span_adminnotice("NUKE CODE REQUEST:[ADMIN_FULLMONTY(sender)] [ADMIN_CENTCOM_REPLY(sender)] [ADMIN_SET_SD_CODE]: [msg]") + for(var/client/staff as anything in GLOB.admins) + SEND_SOUND(staff, sound('sound/misc/announce_dig.ogg')) to_chat(GLOB.admins, msg, confidential = TRUE) for(var/obj/machinery/computer/communications/console in GLOB.shuttle_caller_list) console.override_cooldown() diff --git a/code/modules/client/preferences/README.md b/code/modules/client/preferences/README.md index 96fb5e754e6..9df77515e51 100644 --- a/code/modules/client/preferences/README.md +++ b/code/modules/client/preferences/README.md @@ -248,7 +248,7 @@ For example, `/datum/preference/numeric/age` contains: If your preference is `PREFERENCE_CHARACTER`, it MUST override `apply_to_human`, even if just to immediately `return`. -You can also read preferences directly with `preferences.read_preference(/datum/preference/type/here)`, which will return the stored value. +You can also read preferences directly with `prefs.read_preference(/datum/preference/type/here)`, which will return the stored value. ## Categories Every preference needs to be in a `category`. These can be found in `code/__DEFINES/preferences.dm`. diff --git a/code/modules/client/preferences/admin.dm b/code/modules/client/preferences/admin.dm index 965116fdff9..47b96abca41 100644 --- a/code/modules/client/preferences/admin.dm +++ b/code/modules/client/preferences/admin.dm @@ -62,3 +62,14 @@ return FALSE return is_admin(preferences.parent) + +/datum/preference/toggle/comms_notification + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "comms_notification" + savefile_identifier = PREFERENCE_PLAYER + +/datum/preference/toggle/comms_notification/is_accessible(datum/preferences/preferences) + if (!..(preferences)) + return FALSE + + return is_admin(preferences.parent) diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index a8d4a78f7a9..832ab59bed7 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -287,6 +287,9 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department GLOB.requests.fax_request(usr.client, "sent a fax message from [fax_name]/[fax_id] to [params["name"]]", fax_paper) to_chat(GLOB.admins, span_adminnotice("[icon2html(src.icon, GLOB.admins)]FAX REQUEST: [ADMIN_FULLMONTY(usr)]: [span_linkify("sent a fax message from [fax_name]/[fax_id][ADMIN_FLW(src)] to [html_encode(params["name"])]")] [ADMIN_SHOW_PAPER(fax_paper)]"), confidential = TRUE) + for(var/client/staff as anything in GLOB.admins) + if(staff?.prefs.read_preference(/datum/preference/toggle/comms_notification)) + SEND_SOUND(staff, sound('sound/misc/announce_dig.ogg')) log_fax(fax_paper, params["id"], params["name"]) loaded_item_ref = null update_appearance() diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx index f72caa6c2ac..3e2539ccec9 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/admin.tsx @@ -42,3 +42,9 @@ export const ghost_roles_as_admin: FeatureToggle = { `, component: CheckboxInput, }; + +export const comms_notification: FeatureToggle = { + name: 'Enable comms console sound', + category: 'ADMIN', + component: CheckboxInput, +};