diff --git a/code/__DEFINES/sound_preferences.dm b/code/__DEFINES/sound_preferences.dm new file mode 100644 index 00000000000..095cc5b47a9 --- /dev/null +++ b/code/__DEFINES/sound_preferences.dm @@ -0,0 +1,6 @@ +///Doesn't play +#define GHOST_POLL_PROMPT_DISABLED "Disabled" +///Number one +#define GHOST_POLL_PROMPT_1 "Calm" +///Number two +#define GHOST_POLL_PROMPT_2 "Alert" diff --git a/code/controllers/subsystem/polling.dm b/code/controllers/subsystem/polling.dm index e41468071ad..99b179af6e7 100644 --- a/code/controllers/subsystem/polling.dm +++ b/code/controllers/subsystem/polling.dm @@ -155,7 +155,18 @@ SUBSYSTEM_DEF(polling) act_never = "[custom_link_style_start]\[Never For This Round\]" if(!duplicate_message_check(alert_poll)) //Only notify people once. They'll notice if there are multiple and we don't want to spam people. - SEND_SOUND(candidate_mob, sound('sound/misc/prompt.ogg', volume = 50)) + + // ghost poll prompt sound handling + var/polling_sound_pref = candidate_mob.client?.prefs.read_preference(/datum/preference/choiced/sound_ghost_poll_prompt) + var/polling_sound_volume = candidate_mob.client?.prefs.read_preference(/datum/preference/numeric/sound_ghost_poll_prompt_volume) + if(polling_sound_pref != GHOST_POLL_PROMPT_DISABLED && polling_sound_volume) + var/polling_sound + if(polling_sound_pref == GHOST_POLL_PROMPT_1) + polling_sound = 'sound/misc/prompt1.ogg' + else + polling_sound = 'sound/misc/prompt2.ogg' + SEND_SOUND(candidate_mob, sound(polling_sound, volume = polling_sound_volume)) + var/surrounding_icon if(chat_text_border_icon) var/image/surrounding_image diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index 376e06cad6f..9a5b15e34cd 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -112,3 +112,28 @@ category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "sound_ai_vox" savefile_identifier = PREFERENCE_PLAYER + +/// Choice of which ghost poll prompt to use +/datum/preference/choiced/sound_ghost_poll_prompt + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "sound_ghost_poll_prompt" + savefile_identifier = PREFERENCE_PLAYER + +/datum/preference/choiced/sound_ghost_poll_prompt/create_default_value() + return GHOST_POLL_PROMPT_1 + +/datum/preference/choiced/sound_ghost_poll_prompt/init_possible_values() + return list(GHOST_POLL_PROMPT_DISABLED, GHOST_POLL_PROMPT_1, GHOST_POLL_PROMPT_2) + +/// Volume which ghost poll prompts are played at +/datum/preference/numeric/sound_ghost_poll_prompt_volume + category = PREFERENCE_CATEGORY_GAME_PREFERENCES + savefile_key = "sound_ghost_poll_prompt_volume" + savefile_identifier = PREFERENCE_PLAYER + + minimum = 0 + maximum = 200 + +/// default value is max/2 because 100 1x modifier, while 200 is 2x +/datum/preference/numeric/sound_ghost_poll_prompt_volume/create_default_value() + return maximum/2 diff --git a/sound/misc/attribution.txt b/sound/misc/attribution.txt new file mode 100644 index 00000000000..3afee6c881a --- /dev/null +++ b/sound/misc/attribution.txt @@ -0,0 +1,6 @@ +bloop.ogg by my man Tim Khan +(https://freesound.org/people/tim.kahn/sounds/130377/) + +prompt1.ogg by Flleeppyy (https://github.com/Flleeppyy), originally for https://github.com/Monkestation/Monkestation2.0/pull/2621 + +prompt2.ogg by sadboysuss. \ No newline at end of file diff --git a/sound/misc/license.txt b/sound/misc/license.txt deleted file mode 100644 index 945c48e279d..00000000000 --- a/sound/misc/license.txt +++ /dev/null @@ -1,4 +0,0 @@ -bloop.ogg by my man Tim Khan -(https://freesound.org/people/tim.kahn/sounds/130377/) - -prompt.ogg by Flleeppyy (https://github.com/Flleeppyy), originally for https://github.com/Monkestation/Monkestation2.0/pull/2621 diff --git a/sound/misc/prompt.ogg b/sound/misc/prompt.ogg deleted file mode 100644 index e32942e0d3c..00000000000 Binary files a/sound/misc/prompt.ogg and /dev/null differ diff --git a/sound/misc/prompt1.ogg b/sound/misc/prompt1.ogg new file mode 100644 index 00000000000..b284fcaef5d Binary files /dev/null and b/sound/misc/prompt1.ogg differ diff --git a/sound/misc/prompt2.ogg b/sound/misc/prompt2.ogg new file mode 100644 index 00000000000..4787e527710 Binary files /dev/null and b/sound/misc/prompt2.ogg differ diff --git a/tgstation.dme b/tgstation.dme index 3c05efc4e62..35382116db2 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -218,6 +218,7 @@ #include "code\__DEFINES\song.dm" #include "code\__DEFINES\sort_types.dm" #include "code\__DEFINES\sound.dm" +#include "code\__DEFINES\sound_preferences.dm" #include "code\__DEFINES\space.dm" #include "code\__DEFINES\spaceman_dmm.dm" #include "code\__DEFINES\spacevines.dm" diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx index 51b257b3ff1..e6982af7b58 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/game_preferences/sounds.tsx @@ -28,6 +28,20 @@ export const sound_announcements: FeatureToggle = { component: CheckboxInput, }; +export const sound_ghost_poll_prompt: FeatureChoiced = { + name: 'Ghost poll prompt', + category: 'SOUND', + description: 'Choose which sound prompt to play on getting ghost polls.', + component: FeatureDropdownInput, +}; + +export const sound_ghost_poll_prompt_volume: Feature = { + name: 'Ghost poll prompt volume', + category: 'SOUND', + description: 'The volume that ghost poll prompts will play at.', + component: FeatureSliderInput, +}; + export const sound_combatmode: FeatureToggle = { name: 'Enable combat mode sound', category: 'SOUND',