From 2c78e8f71aa29e76582b0028c7655e0914b0d3c4 Mon Sep 17 00:00:00 2001 From: Name Date: Sat, 19 Oct 2024 02:05:34 -0400 Subject: [PATCH 1/6] Initial commit --- code/controllers/subsystem/ambience.dm | 18 ++++-- .../game/objects/items/devices/radio/radio.dm | 21 +++++-- code/game/sound.dm | 9 ++- code/modules/client/client_procs.dm | 5 +- .../legacy_sound_toggles_migration.dm | 11 +++- .../migrations/sound_checkboxes_migration.dm | 20 ++++++ code/modules/client/preferences/sounds.dm | 63 ++++++++++++++++--- code/modules/client/preferences_savefile.dm | 9 ++- tgstation.dme | 1 + .../features/game_preferences/sounds.tsx | 44 +++++++++---- 10 files changed, 163 insertions(+), 38 deletions(-) create mode 100644 code/modules/client/preferences/migrations/sound_checkboxes_migration.dm diff --git a/code/controllers/subsystem/ambience.dm b/code/controllers/subsystem/ambience.dm index 87f088a41ea13..1469ff1026224 100644 --- a/code/controllers/subsystem/ambience.dm +++ b/code/controllers/subsystem/ambience.dm @@ -54,7 +54,12 @@ SUBSYSTEM_DEF(ambience) ///Attempts to play an ambient sound to a mob, returning the cooldown in deciseconds /area/proc/play_ambience(mob/M, sound/override_sound, volume = 27) var/sound/new_sound = override_sound || pick(ambientsounds) - new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume, channel = CHANNEL_AMBIENCE) +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume, channel = CHANNEL_AMBIENCE) +/// changes old function to instead grab volume from player preferences + var/volume_modifier = (M.client?.prefs.read_preference(/datum/preference/numeric/sound_ambience_volume))/100 + new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume*volume_modifier, channel = CHANNEL_AMBIENCE) +///END DOPPLER EDIT SEND_SOUND(M, new_sound) return rand(min_ambience_cooldown, max_ambience_cooldown) @@ -113,9 +118,14 @@ SUBSYSTEM_DEF(ambience) var/area/my_area = get_area(src) var/sound_to_use = my_area.ambient_buzz - - if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/toggle/sound_ship_ambience))) - SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = CHANNEL_BUZZ)) +///BEGIN DOPPLER EDIT - VOLUME MIXER + var/volume_modifier = client.prefs.read_preference(/datum/preference/numeric/sound_ship_ambience_volume) + +/// if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/toggle/sound_ship_ambience))) +/// SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = CHANNEL_BUZZ)) + if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/numeric/sound_ship_ambience_volume))) + SEND_SOUND(src, sound(null, repeat = 0, volume = volume_modifier, wait = 0, channel = CHANNEL_BUZZ)) +///END DOPPLER EDIT client.current_ambient_sound = null return diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 93a131a9b468b..9afe70443ca64 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -351,8 +351,13 @@ if(isliving(talking_movable)) var/mob/living/talking_living = talking_movable - if(radio_noise && !HAS_TRAIT(talking_living, TRAIT_DEAF) && talking_living.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) - SEND_SOUND(talking_living, 'sound/items/radio/radio_talk.ogg') +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// if(radio_noise && !HAS_TRAIT(talking_living, TRAIT_DEAF) && talking_living.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) +/// SEND_SOUND(talking_living, 'sound/items/radio/radio_talk.ogg') + var/volume_modifier = (talking_living.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) + if(radio_noise && !HAS_TRAIT(talking_living, TRAIT_DEAF) && volume_modifier) + SEND_SOUND(talking_living, sound('sound/items/radio/radio_talk.ogg', volume = volume_modifier)) +///END DOPPLER EDIT // All radios make an attempt to use the subspace system first signal.send_to_receivers() @@ -429,16 +434,22 @@ return var/mob/living/holder = loc - if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) + var/volume_modifier = (holder.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) + if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) return var/list/spans = data["spans"] if(COOLDOWN_FINISHED(src, audio_cooldown)) COOLDOWN_START(src, audio_cooldown, 0.5 SECONDS) - SEND_SOUND(holder, 'sound/items/radio/radio_receive.ogg') +/// SEND_SOUND(holder, 'sound/items/radio/radio_receive.ogg') + SEND_SOUND(holder, sound('sound/items/radio/radio_receive.ogg', volume = volume_modifier)) if((SPAN_COMMAND in spans) && COOLDOWN_FINISHED(src, important_audio_cooldown)) COOLDOWN_START(src, important_audio_cooldown, 0.5 SECONDS) - SEND_SOUND(holder, 'sound/items/radio/radio_important.ogg') +/// SEND_SOUND(holder, 'sound/items/radio/radio_important.ogg') + SEND_SOUND(holder, sound('sound/items/radio/radio_important.ogg', volume = volume_modifier)) +///END DOPPLER EDIT /obj/item/radio/ui_state(mob/user) return GLOB.inventory_state diff --git a/code/game/sound.dm b/code/game/sound.dm index fb9d70eb2cb03..96459b86590c8 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -195,8 +195,13 @@ set waitfor = FALSE UNTIL(SSticker.login_music) //wait for SSticker init to set the login music - if(prefs && (prefs.read_preference(/datum/preference/toggle/sound_lobby)) && !CONFIG_GET(flag/disallow_title_music)) - SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = vol, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// if(prefs && (prefs.read_preference(/datum/preference/toggle/sound_lobby)) && !CONFIG_GET(flag/disallow_title_music)) +/// SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = vol, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS + var/volume_modifier = prefs.read_preference(/datum/preference/numeric/sound_lobby_volume) + if((prefs && volume_modifier) && !CONFIG_GET(flag/disallow_title_music)) + SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = volume_modifier, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS +///END DOPPLER EDIT /proc/get_rand_frequency() return rand(32000, 55000) //Frequency stuff only works with 45kbps oggs. diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index ac3d6af179622..cc0934b1d305d 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -536,7 +536,10 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them. to_chat(src, span_warning("Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.")) - update_ambience_pref(prefs.read_preference(/datum/preference/toggle/sound_ambience)) +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// update_ambience_pref(prefs.read_preference(/datum/preference/toggle/sound_ambience)) + update_ambience_pref(prefs.read_preference(/datum/preference/numeric/sound_ambience_volume)) +///END DOPPLER EDIT check_ip_intel() //This is down here because of the browse() calls in tooltip/New() diff --git a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm index cb0ca59e34370..f0e8af612ef02 100644 --- a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm +++ b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm @@ -3,11 +3,16 @@ /// This migration transfers the player's existing preferences into the new toggles /datum/preferences/proc/migrate_legacy_sound_toggles(savefile/savefile) - write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ambience], toggles & 1<<2) +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ambience], toggles & 1<<2) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], toggles & 1<<2) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_announcements], toggles & 1<<11) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_combatmode], toggles & 1<<22) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_endofround], toggles & 1<<20) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_instruments], toggles & 1<<7) - write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_lobby], toggles & 1<<3) +/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_lobby], toggles & 1<<3) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby_volume], toggles & 1<<3) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_midi], toggles & 1<<1) - write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ship_ambience], toggles & 1<<8) +/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ship_ambience], toggles & 1<<8) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ship_ambience_volume], toggles & 1<<8) +///END DOPPLER EDIT diff --git a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm new file mode 100644 index 0000000000000..3af7f5a61714e --- /dev/null +++ b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm @@ -0,0 +1,20 @@ +/** Pull request: #86932 Sound mixer part 1 + * + * Multiplies boolean sound prefs by 100 + * + * Changed ambience tick pref to numeric slider + * Changed ship ambience tick pref to numeric slider + * Changed lobby music tick pref to numeric slider + * Changed Radio noise tick pref to numeric slider + */ + +/datum/preferences/proc/migrate_boolean_sound_prefs_to_default_volume() + var/ambience_pref = savefile.get_entry("sound_ambience_volume") + var/ship_ambience_pref = savefile.get_entry("sound_ship_ambience_volume") + var/lobby_music_pref = savefile.get_entry("sound_lobby_volume") + var/radio_noise_pref = savefile.get_entry("sound_radio_noise") + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], ambience_pref*100) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ship_ambience_volume], ship_ambience_pref*100) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby_volume], lobby_music_pref*100) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_radio_noise], radio_noise_pref*100) + return diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index 4a0298132c268..b58a076c8cceb 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -1,11 +1,23 @@ /// Controls hearing ambience -/datum/preference/toggle/sound_ambience +///BEGIN DOPPLER EDIT - VOLUME MIXER +////datum/preference/toggle/sound_ambience +/// Controls ambience volume +/datum/preference/numeric/sound_ambience_volume category = PREFERENCE_CATEGORY_GAME_PREFERENCES - savefile_key = "sound_ambience" +/// savefile_key = "sound_ambience" + savefile_key = "sound_ambience_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_ambience_volume/create_default_value() + return maximum/2 -/datum/preference/toggle/sound_ambience/apply_to_client(client/client, value) +////datum/preference/toggle/sound_ambience/apply_to_client(client/client, value) +/datum/preference/numeric/sound_ambience_volume/apply_to_client(client/client, value) client.update_ambience_pref(value) +///END DOPPLER EDIT /datum/preference/toggle/sound_breathing category = PREFERENCE_CATEGORY_GAME_PREFERENCES @@ -85,16 +97,27 @@ client.mob.stop_sound_channel(CHANNEL_JUKEBOX) /// Controls hearing lobby music -/datum/preference/toggle/sound_lobby +///BEGIN DOPPLER EDIT - VOLUME MIXER +////datum/preference/toggle/sound_lobby +/datum/preference/numeric/sound_lobby_volume category = PREFERENCE_CATEGORY_GAME_PREFERENCES - savefile_key = "sound_lobby" +/// savefile_key = "sound_lobby" + savefile_key = "sound_lobby_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_lobby_volume/create_default_value() + return maximum/2 -/datum/preference/toggle/sound_lobby/apply_to_client_updated(client/client, value) +////datum/preference/toggle/sound_lobby/apply_to_client_updated(client/client, value) +/datum/preference/numeric/sound_lobby/apply_to_client_updated(client/client, value) if (value && isnewplayer(client.mob)) client.playtitlemusic() else client.mob.stop_sound_channel(CHANNEL_LOBBYMUSIC) +///END DOPPLER EDIT /// Controls hearing admin music /datum/preference/toggle/sound_midi @@ -103,13 +126,24 @@ savefile_identifier = PREFERENCE_PLAYER /// Controls hearing ship ambience -/datum/preference/toggle/sound_ship_ambience +///BEGIN DOPPLER EDIT - VOLUME MIXER +////datum/preference/toggle/sound_ship_ambience +/datum/preference/numeric/sound_ship_ambience_volume category = PREFERENCE_CATEGORY_GAME_PREFERENCES - savefile_key = "sound_ship_ambience" +/// savefile_key = "sound_ship_ambience" + savefile_key = "sound_ship_ambience_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_ship_ambience_volume/create_default_value() + return maximum/2 -/datum/preference/toggle/sound_ship_ambience/apply_to_client_updated(client/client, value) +////datum/preference/toggle/sound_ship_ambience/apply_to_client_updated(client/client, value) +/datum/preference/numeric/sound_ship_ambience_volume/apply_to_client_updated(client/client, value) client.mob.refresh_looping_ambience() +///END DOPPLER EDIT /// Controls hearing elevator music /datum/preference/toggle/sound_elevator @@ -118,7 +152,16 @@ savefile_identifier = PREFERENCE_PLAYER /// Controls hearing radio noise -/datum/preference/toggle/radio_noise +///BEGIN DOPPLER EDIT - VOLUME MIXER +////datum/preference/toggle/radio_noise +/datum/preference/numeric/sound_radio_noise category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "sound_radio_noise" 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_radio_noise/create_default_value() + return maximum/2 +///END DOPPLER EDIT diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index e9732d8ce4ceb..8698f0a5dd5c7 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -5,7 +5,10 @@ // You do not need to raise this if you are adding new values that have sane defaults. // Only raise this value when changing the meaning/format/name/layout of an existing value // where you would want the updater procs below to run -#define SAVEFILE_VERSION_MAX 45 +///BEGIN DOPPLER EDIT - VOLUME MIXER +///#define SAVEFILE_VERSION_MAX 45 +#define SAVEFILE_VERSION_MAX 46 +///END DOPPLER EDIT /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -110,6 +113,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car new_typepath = /obj/item/clothing/accessory/pride, data_to_migrate = list(INFO_RESKIN = save_data?["pride_pin"]), ) +///BEGIN DOPPLER EDIT - VOLUME MIXER + if (current_version < 46) + migrate_boolean_sound_prefs_to_default_volume() +///END DOPPLER EDIT /// checks through keybindings for outdated unbound keys and updates them /datum/preferences/proc/check_keybindings() diff --git a/tgstation.dme b/tgstation.dme index 608523d1c467d..bff30b39ebcb7 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3884,6 +3884,7 @@ #include "code\modules\client\preferences\migrations\convert_to_json_savefile.dm" #include "code\modules\client\preferences\migrations\legacy_sound_toggles_migration.dm" #include "code\modules\client\preferences\migrations\quirk_loadout_migration.dm" +#include "code\modules\client\preferences\migrations\sound_checkboxes_migration.dm" #include "code\modules\client\preferences\migrations\tgui_prefs_migration.dm" #include "code\modules\client\preferences\migrations\tts_blip_migration.dm" #include "code\modules\client\preferences\species_features\basic.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 f190f6c238762..b18cb2f8b6442 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 @@ -7,12 +7,17 @@ import { } from '../base'; import { FeatureDropdownInput } from '../dropdowns'; -export const sound_ambience: FeatureToggle = { - name: 'Enable ambience', +// BEGIN DOPPLER EDIT - VOLUME MIXER +// export const sound_ambience: FeatureToggle = { +// name: 'Enable ambience', +export const sound_ambience_volume: Feature = { + name: 'Ambience volume', category: 'SOUND', description: `Ambience refers to the more noticeable ambient sounds that play on occasion.`, - component: CheckboxInput, + // component: CheckboxInput, + component: FeatureSliderInput, }; +// END DOPPLER EDIT export const sound_breathing: FeatureToggle = { name: 'Enable breathing sounds', @@ -73,11 +78,16 @@ export const sound_jukebox: FeatureToggle = { component: CheckboxInput, }; -export const sound_lobby: FeatureToggle = { - name: 'Enable lobby music', +// BEGIN DOPPLER EDIT - VOLUME MIXER +// export const sound_lobby: FeatureToggle = { +// name: 'Enable lobby music', +export const sound_lobby_volume: Feature = { + name: 'Lobby music volume', category: 'SOUND', - component: CheckboxInput, + // component: CheckboxInput, + component: FeatureSliderInput, }; +// END DOPPLER EDIT export const sound_midi: FeatureToggle = { name: 'Enable admin music', @@ -86,12 +96,17 @@ export const sound_midi: FeatureToggle = { component: CheckboxInput, }; -export const sound_ship_ambience: FeatureToggle = { - name: 'Enable ship ambience', +// BEGIN DOPPLER EDIT - VOLUME MIXER +// export const sound_ship_ambience: FeatureToggle = { +// name: 'Enable ship ambience', +export const sound_ship_ambience_volume: Feature = { + name: 'Ship ambience volume', category: 'SOUND', description: `Ship ambience refers to the low ambient buzz that plays on loop.`, - component: CheckboxInput, + // component: CheckboxInput, + component: FeatureSliderInput, }; +// END DOPPLER EDIT export const sound_elevator: FeatureToggle = { name: 'Enable elevator music', @@ -109,10 +124,15 @@ export const sound_achievement: FeatureChoiced = { component: FeatureDropdownInput, }; -export const sound_radio_noise: FeatureToggle = { - name: 'Enable radio noise', +// BEGIN DOPPLER EDIT - VOLUME MIXER +// export const sound_radio_noise: FeatureToggle = { +// name: 'Enable radio noise', +export const sound_radio_noise: Feature = { + name: 'Radio noise volume', category: 'SOUND', description: 'When enabled, hear sounds of talking and hearing radio chatter.', - component: CheckboxInput, + // component: CheckboxInput, + component: FeatureSliderInput, }; +// END DOPPLER EDIT From 17c677214032b1c18763578849eaf69593faeb40 Mon Sep 17 00:00:00 2001 From: Name Date: Sat, 19 Oct 2024 02:35:32 -0400 Subject: [PATCH 2/6] Announcements volume --- code/__HELPERS/announcements.dm | 8 ++++++-- code/__HELPERS/priority_announce.dm | 9 +++++++-- code/controllers/subsystem/vote.dm | 5 ++++- .../migrations/legacy_sound_toggles_migration.dm | 3 ++- .../migrations/sound_checkboxes_migration.dm | 2 ++ code/modules/client/preferences/sounds.dm | 10 +++++++++- code/modules/mob/living/silicon/ai/ai_say.dm | 5 ++++- .../preferences/features/game_preferences/sounds.tsx | 10 +++++++--- 8 files changed, 41 insertions(+), 11 deletions(-) diff --git a/code/__HELPERS/announcements.dm b/code/__HELPERS/announcements.dm index d8653a2eb05da..b334082549a66 100644 --- a/code/__HELPERS/announcements.dm +++ b/code/__HELPERS/announcements.dm @@ -50,7 +50,9 @@ if(islist(players)) for(var/mob/target in players) to_chat(target, finalized_announcement) - if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) + if(play_sound && target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) SEND_SOUND(target, sound(sound_override)) else to_chat(world, finalized_announcement) @@ -59,7 +61,9 @@ return for(var/mob/player in GLOB.player_list) - if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) +/// if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) + if(player.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) +///END DOPPLER EDIT SEND_SOUND(player, sound(sound_override)) /** diff --git a/code/__HELPERS/priority_announce.dm b/code/__HELPERS/priority_announce.dm index db381d2d589a4..afef5a57b840b 100644 --- a/code/__HELPERS/priority_announce.dm +++ b/code/__HELPERS/priority_announce.dm @@ -189,6 +189,8 @@ var/sound_to_play = !isnull(sound_override) ? sound_override : 'sound/announcer/notice/notice2.ogg' for(var/mob/target in players) +///BEGIN DOPPLER EDIT - VOLUME MIXER + var/volume_modifier = (target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) if(isnewplayer(target) || !target.can_hear()) continue @@ -196,8 +198,11 @@ if(!should_play_sound) continue - if(target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) - SEND_SOUND(target, sound(sound_to_play)) +/// if(target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) +/// SEND_SOUND(target, sound(sound_to_play)) + if(target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) + SEND_SOUND(target, sound(sound_to_play, volume = volume_modifier)) +///END DOPPLER EDIT #undef MAJOR_ANNOUNCEMENT_TITLE #undef MAJOR_ANNOUNCEMENT_TEXT diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 7bed63cc36fc8..81d903b80c721 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -239,7 +239,10 @@ SUBSYSTEM_DEF(vote) new_voter.player_details.player_actions += voting_action generated_actions += voting_action - if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/toggle/sound_announcements))) +///BEGIN DOPPLER EDIT - VOLUME MIXER +/// if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/toggle/sound_announcements))) + if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/numeric/sound_announcements))) +///END DOPPLER EDIT SEND_SOUND(new_voter, sound(current_vote.vote_sound)) return TRUE diff --git a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm index f0e8af612ef02..de5f82eb88b9b 100644 --- a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm +++ b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm @@ -6,7 +6,8 @@ ///BEGIN DOPPLER EDIT - VOLUME MIXER /// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ambience], toggles & 1<<2) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], toggles & 1<<2) - write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_announcements], toggles & 1<<11) +/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_announcements], toggles & 1<<11) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_announcements], toggles & 1<<11) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_combatmode], toggles & 1<<22) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_endofround], toggles & 1<<20) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_instruments], toggles & 1<<7) diff --git a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm index 3af7f5a61714e..1a696be8f7c69 100644 --- a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm +++ b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm @@ -10,10 +10,12 @@ /datum/preferences/proc/migrate_boolean_sound_prefs_to_default_volume() var/ambience_pref = savefile.get_entry("sound_ambience_volume") + var/announcement_pref = savefile.get_entry("sound_announcements") var/ship_ambience_pref = savefile.get_entry("sound_ship_ambience_volume") var/lobby_music_pref = savefile.get_entry("sound_lobby_volume") var/radio_noise_pref = savefile.get_entry("sound_radio_noise") write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], ambience_pref*100) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_announcements], announcement_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ship_ambience_volume], ship_ambience_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby_volume], lobby_music_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_radio_noise], radio_noise_pref*100) diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index b58a076c8cceb..f32ed8374fff5 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -25,10 +25,18 @@ savefile_identifier = PREFERENCE_PLAYER /// Controls hearing announcement sounds -/datum/preference/toggle/sound_announcements +///BEGIN DOPPLER EDIT - VOLUME MIXER +////datum/preference/toggle/sound_announcements +/datum/preference/numeric/sound_announcements category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "sound_announcements" savefile_identifier = PREFERENCE_PLAYER + minimum = 0 + maximum = 200 + +/datum/preference/numeric/sound_announcements/create_default_value() + return maximum/2 +///END DOPPLER EDIT /// Controls hearing the combat mode toggle sound /datum/preference/toggle/sound_combatmode diff --git a/code/modules/mob/living/silicon/ai/ai_say.dm b/code/modules/mob/living/silicon/ai/ai_say.dm index efb2366ca1234..7bb1ddbac70a1 100644 --- a/code/modules/mob/living/silicon/ai/ai_say.dm +++ b/code/modules/mob/living/silicon/ai/ai_say.dm @@ -168,7 +168,10 @@ if(!only_listener) // Play voice for all mobs in the z level for(var/mob/player_mob as anything in GLOB.player_list) - if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/toggle/sound_announcements))) +///BEGIN DOPPLER EDIT +/// if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/toggle/sound_announcements))) + if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/numeric/sound_announcements))) +///END DOPPLER EDIT continue var/turf/player_turf = get_turf(player_mob) 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 b18cb2f8b6442..6f52fdeabc0c2 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 @@ -26,11 +26,15 @@ export const sound_breathing: FeatureToggle = { component: CheckboxInput, }; -export const sound_announcements: FeatureToggle = { - name: 'Enable announcement sounds', +// BEGIN DOPPLER EDIT - VOLUME MIXER +// export const sound_announcements: FeatureToggle = { +// name: 'Enable announcement sounds', +export const sound_announcements: Feature = { + name: 'Announcement volume', category: 'SOUND', description: 'When enabled, hear sounds for command reports, notices, etc.', - component: CheckboxInput, + // component: CheckboxInput, + component: FeatureSliderInput, }; export const sound_combatmode: FeatureToggle = { From 293a1381baeac2810f021d2f0349fc30b1d07b31 Mon Sep 17 00:00:00 2001 From: Name Date: Sat, 19 Oct 2024 02:56:10 -0400 Subject: [PATCH 3/6] unit tests --- .../client/preferences/migrations/sound_checkboxes_migration.dm | 2 +- .../preferences/features/game_preferences/sounds.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm index 1a696be8f7c69..6c981ea27e5d8 100644 --- a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm +++ b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm @@ -12,7 +12,7 @@ var/ambience_pref = savefile.get_entry("sound_ambience_volume") var/announcement_pref = savefile.get_entry("sound_announcements") var/ship_ambience_pref = savefile.get_entry("sound_ship_ambience_volume") - var/lobby_music_pref = savefile.get_entry("sound_lobby_volume") + var/lobby_music_pref = savefile.get_entry("sound_lobby") var/radio_noise_pref = savefile.get_entry("sound_radio_noise") write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], ambience_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_announcements], announcement_pref*100) 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 6f52fdeabc0c2..4f1184f361d8b 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 @@ -85,7 +85,7 @@ export const sound_jukebox: FeatureToggle = { // BEGIN DOPPLER EDIT - VOLUME MIXER // export const sound_lobby: FeatureToggle = { // name: 'Enable lobby music', -export const sound_lobby_volume: Feature = { +export const sound_lobby: Feature = { name: 'Lobby music volume', category: 'SOUND', // component: CheckboxInput, From 2fd769dce236251d70bb5a7bb23e4e62338f5956 Mon Sep 17 00:00:00 2001 From: Name Date: Sat, 19 Oct 2024 03:11:22 -0400 Subject: [PATCH 4/6] more test... --- code/game/sound.dm | 2 +- .../migrations/legacy_sound_toggles_migration.dm | 2 +- .../preferences/migrations/sound_checkboxes_migration.dm | 2 +- code/modules/client/preferences/sounds.dm | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/code/game/sound.dm b/code/game/sound.dm index 96459b86590c8..1a2f65e2e12c7 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -198,7 +198,7 @@ ///BEGIN DOPPLER EDIT - VOLUME MIXER /// if(prefs && (prefs.read_preference(/datum/preference/toggle/sound_lobby)) && !CONFIG_GET(flag/disallow_title_music)) /// SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = vol, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS - var/volume_modifier = prefs.read_preference(/datum/preference/numeric/sound_lobby_volume) + var/volume_modifier = prefs.read_preference(/datum/preference/numeric/sound_lobby) if((prefs && volume_modifier) && !CONFIG_GET(flag/disallow_title_music)) SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = volume_modifier, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS ///END DOPPLER EDIT diff --git a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm index de5f82eb88b9b..1edec070d076b 100644 --- a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm +++ b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm @@ -12,7 +12,7 @@ write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_endofround], toggles & 1<<20) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_instruments], toggles & 1<<7) /// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_lobby], toggles & 1<<3) - write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby_volume], toggles & 1<<3) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby], toggles & 1<<3) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_midi], toggles & 1<<1) /// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ship_ambience], toggles & 1<<8) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ship_ambience_volume], toggles & 1<<8) diff --git a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm index 6c981ea27e5d8..80149e5bc3baf 100644 --- a/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm +++ b/code/modules/client/preferences/migrations/sound_checkboxes_migration.dm @@ -17,6 +17,6 @@ write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], ambience_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_announcements], announcement_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ship_ambience_volume], ship_ambience_pref*100) - write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby_volume], lobby_music_pref*100) + write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby], lobby_music_pref*100) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_radio_noise], radio_noise_pref*100) return diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index f32ed8374fff5..a1c59f053f131 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -107,16 +107,15 @@ /// Controls hearing lobby music ///BEGIN DOPPLER EDIT - VOLUME MIXER ////datum/preference/toggle/sound_lobby -/datum/preference/numeric/sound_lobby_volume +/datum/preference/numeric/sound_lobby category = PREFERENCE_CATEGORY_GAME_PREFERENCES -/// savefile_key = "sound_lobby" - savefile_key = "sound_lobby_volume" + savefile_key = "sound_lobby" 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_lobby_volume/create_default_value() +/datum/preference/numeric/sound_lobby/create_default_value() return maximum/2 ////datum/preference/toggle/sound_lobby/apply_to_client_updated(client/client, value) From 78770fc07290a636ea831a3f37f1c6dcbb549d5c Mon Sep 17 00:00:00 2001 From: Name Date: Wed, 23 Oct 2024 19:18:39 -0400 Subject: [PATCH 5/6] Documentation cleanup --- code/__HELPERS/announcements.dm | 9 +-- code/__HELPERS/priority_announce.dm | 10 +--- code/controllers/subsystem/ambience.dm | 16 ++---- code/controllers/subsystem/vote.dm | 5 +- .../game/objects/items/devices/radio/radio.dm | 17 ++---- code/game/sound.dm | 6 +- code/modules/client/client_procs.dm | 5 +- .../legacy_sound_toggles_migration.dm | 12 ++-- code/modules/client/preferences/sounds.dm | 57 ++++++++----------- code/modules/client/preferences_savefile.dm | 9 +-- code/modules/mob/living/silicon/ai/ai_say.dm | 5 +- 11 files changed, 55 insertions(+), 96 deletions(-) diff --git a/code/__HELPERS/announcements.dm b/code/__HELPERS/announcements.dm index b334082549a66..67a642c7d5e0c 100644 --- a/code/__HELPERS/announcements.dm +++ b/code/__HELPERS/announcements.dm @@ -50,10 +50,7 @@ if(islist(players)) for(var/mob/target in players) to_chat(target, finalized_announcement) -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) - if(play_sound && target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) - SEND_SOUND(target, sound(sound_override)) + if(play_sound && target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) //DOPPLER EDIT CHANGE - Original: if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) else to_chat(world, finalized_announcement) @@ -61,9 +58,7 @@ return for(var/mob/player in GLOB.player_list) -/// if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) - if(player.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) -///END DOPPLER EDIT + if(player.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) //DOPPLER EDIT CHANGE - Original: if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) SEND_SOUND(player, sound(sound_override)) /** diff --git a/code/__HELPERS/priority_announce.dm b/code/__HELPERS/priority_announce.dm index afef5a57b840b..f589b6ad28e5f 100644 --- a/code/__HELPERS/priority_announce.dm +++ b/code/__HELPERS/priority_announce.dm @@ -189,8 +189,7 @@ var/sound_to_play = !isnull(sound_override) ? sound_override : 'sound/announcer/notice/notice2.ogg' for(var/mob/target in players) -///BEGIN DOPPLER EDIT - VOLUME MIXER - var/volume_modifier = (target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) + var/volume_modifier = (target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) //DOPPLER EDIT ADDITION if(isnewplayer(target) || !target.can_hear()) continue @@ -198,11 +197,8 @@ if(!should_play_sound) continue -/// if(target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) -/// SEND_SOUND(target, sound(sound_to_play)) - if(target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) - SEND_SOUND(target, sound(sound_to_play, volume = volume_modifier)) -///END DOPPLER EDIT + if(target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) //DOPPLER EDIT CHANGE - Original: if(target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) + SEND_SOUND(target, sound(sound_to_play, volume = volume_modifier)) //DOPPLER EDIT CHANGE - Original: SEND_SOUND(target, sound(sound_to_play)) #undef MAJOR_ANNOUNCEMENT_TITLE #undef MAJOR_ANNOUNCEMENT_TEXT diff --git a/code/controllers/subsystem/ambience.dm b/code/controllers/subsystem/ambience.dm index 1469ff1026224..af7b3833c91d8 100644 --- a/code/controllers/subsystem/ambience.dm +++ b/code/controllers/subsystem/ambience.dm @@ -54,12 +54,12 @@ SUBSYSTEM_DEF(ambience) ///Attempts to play an ambient sound to a mob, returning the cooldown in deciseconds /area/proc/play_ambience(mob/M, sound/override_sound, volume = 27) var/sound/new_sound = override_sound || pick(ambientsounds) -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume, channel = CHANNEL_AMBIENCE) -/// changes old function to instead grab volume from player preferences +/* BEGIN DOPPLER EDIT - VOLUME MIXER +new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume, channel = CHANNEL_AMBIENCE) +changes old function to instead grab volume from player preferences */ var/volume_modifier = (M.client?.prefs.read_preference(/datum/preference/numeric/sound_ambience_volume))/100 new_sound = sound(new_sound, repeat = 0, wait = 0, volume = volume*volume_modifier, channel = CHANNEL_AMBIENCE) -///END DOPPLER EDIT +// END DOPPLER EDIT SEND_SOUND(M, new_sound) return rand(min_ambience_cooldown, max_ambience_cooldown) @@ -118,14 +118,10 @@ SUBSYSTEM_DEF(ambience) var/area/my_area = get_area(src) var/sound_to_use = my_area.ambient_buzz -///BEGIN DOPPLER EDIT - VOLUME MIXER var/volume_modifier = client.prefs.read_preference(/datum/preference/numeric/sound_ship_ambience_volume) -/// if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/toggle/sound_ship_ambience))) -/// SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = CHANNEL_BUZZ)) - if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/numeric/sound_ship_ambience_volume))) - SEND_SOUND(src, sound(null, repeat = 0, volume = volume_modifier, wait = 0, channel = CHANNEL_BUZZ)) -///END DOPPLER EDIT + if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/numeric/sound_ship_ambience_volume))) //DOPPLER EDIT CHANGE - Original: if(!sound_to_use || !(client.prefs.read_preference(/datum/preference/toggle/sound_ship_ambience))) + SEND_SOUND(src, sound(null, repeat = 0, volume = volume_modifier, wait = 0, channel = CHANNEL_BUZZ)) //DOPPLER EDIT CHANGE - Original: SEND_SOUND(src, sound(null, repeat = 0, wait = 0, channel = CHANNEL_BUZZ)) client.current_ambient_sound = null return diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 81d903b80c721..41e41758a42bc 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -239,10 +239,7 @@ SUBSYSTEM_DEF(vote) new_voter.player_details.player_actions += voting_action generated_actions += voting_action -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/toggle/sound_announcements))) - if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/numeric/sound_announcements))) -///END DOPPLER EDIT + if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/numeric/sound_announcements))) //DOPPLER EDIT CHANGE - Original: if(current_vote.vote_sound && (new_voter.prefs.read_preference(/datum/preference/toggle/sound_announcements))) SEND_SOUND(new_voter, sound(current_vote.vote_sound)) return TRUE diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 9afe70443ca64..6a6ca49d7ae67 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -351,9 +351,9 @@ if(isliving(talking_movable)) var/mob/living/talking_living = talking_movable -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// if(radio_noise && !HAS_TRAIT(talking_living, TRAIT_DEAF) && talking_living.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) -/// SEND_SOUND(talking_living, 'sound/items/radio/radio_talk.ogg') +/*BEGIN DOPPLER EDIT - VOLUME MIXER + if(radio_noise && !HAS_TRAIT(talking_living, TRAIT_DEAF) && talking_living.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) + SEND_SOUND(talking_living, 'sound/items/radio/radio_talk.ogg') */ var/volume_modifier = (talking_living.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) if(radio_noise && !HAS_TRAIT(talking_living, TRAIT_DEAF) && volume_modifier) SEND_SOUND(talking_living, sound('sound/items/radio/radio_talk.ogg', volume = volume_modifier)) @@ -434,22 +434,17 @@ return var/mob/living/holder = loc -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) var/volume_modifier = (holder.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) - if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) + if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/numeric/sound_radio_noise)) //DOPPLER EDIT CHANGE - Original: if(!radio_noise || HAS_TRAIT(holder, TRAIT_DEAF) || !holder.client?.prefs.read_preference(/datum/preference/toggle/radio_noise)) return var/list/spans = data["spans"] if(COOLDOWN_FINISHED(src, audio_cooldown)) COOLDOWN_START(src, audio_cooldown, 0.5 SECONDS) -/// SEND_SOUND(holder, 'sound/items/radio/radio_receive.ogg') - SEND_SOUND(holder, sound('sound/items/radio/radio_receive.ogg', volume = volume_modifier)) + SEND_SOUND(holder, sound('sound/items/radio/radio_receive.ogg', volume = volume_modifier)) //DOPPLER EDIT CHANGE - Original: SEND_SOUND(holder, 'sound/items/radio/radio_receive.ogg') if((SPAN_COMMAND in spans) && COOLDOWN_FINISHED(src, important_audio_cooldown)) COOLDOWN_START(src, important_audio_cooldown, 0.5 SECONDS) -/// SEND_SOUND(holder, 'sound/items/radio/radio_important.ogg') - SEND_SOUND(holder, sound('sound/items/radio/radio_important.ogg', volume = volume_modifier)) -///END DOPPLER EDIT + SEND_SOUND(holder, sound('sound/items/radio/radio_important.ogg', volume = volume_modifier)) //DOPPLER EDIT CHANGE - Original: SEND_SOUND(holder, 'sound/items/radio/radio_important.ogg') /obj/item/radio/ui_state(mob/user) return GLOB.inventory_state diff --git a/code/game/sound.dm b/code/game/sound.dm index 1a2f65e2e12c7..e8403c00e4f54 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -195,9 +195,9 @@ set waitfor = FALSE UNTIL(SSticker.login_music) //wait for SSticker init to set the login music -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// if(prefs && (prefs.read_preference(/datum/preference/toggle/sound_lobby)) && !CONFIG_GET(flag/disallow_title_music)) -/// SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = vol, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS +/* BEGIN DOPPLER EDIT - VOLUME MIXER + if(prefs && (prefs.read_preference(/datum/preference/toggle/sound_lobby)) && !CONFIG_GET(flag/disallow_title_music)) + SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = vol, channel = CHANNEL_LOBBYMUSIC)) */ var/volume_modifier = prefs.read_preference(/datum/preference/numeric/sound_lobby) if((prefs && volume_modifier) && !CONFIG_GET(flag/disallow_title_music)) SEND_SOUND(src, sound(SSticker.login_music, repeat = 0, wait = 0, volume = volume_modifier, channel = CHANNEL_LOBBYMUSIC)) // MAD JAMS diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index cc0934b1d305d..ecae65ad7f586 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -536,10 +536,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them. to_chat(src, span_warning("Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.")) -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// update_ambience_pref(prefs.read_preference(/datum/preference/toggle/sound_ambience)) - update_ambience_pref(prefs.read_preference(/datum/preference/numeric/sound_ambience_volume)) -///END DOPPLER EDIT + update_ambience_pref(prefs.read_preference(/datum/preference/numeric/sound_ambience_volume)) //DOPPLER EDIT CHANGE - Original: update_ambience_pref(prefs.read_preference(/datum/preference/toggle/sound_ambience)) check_ip_intel() //This is down here because of the browse() calls in tooltip/New() diff --git a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm index 1edec070d076b..caf8b0fed25b8 100644 --- a/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm +++ b/code/modules/client/preferences/migrations/legacy_sound_toggles_migration.dm @@ -3,17 +3,17 @@ /// This migration transfers the player's existing preferences into the new toggles /datum/preferences/proc/migrate_legacy_sound_toggles(savefile/savefile) -///BEGIN DOPPLER EDIT - VOLUME MIXER -/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ambience], toggles & 1<<2) +// BEGIN DOPPLER EDIT - VOLUME MIXER +// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ambience], toggles & 1<<2) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ambience_volume], toggles & 1<<2) -/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_announcements], toggles & 1<<11) +// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_announcements], toggles & 1<<11) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_announcements], toggles & 1<<11) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_combatmode], toggles & 1<<22) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_endofround], toggles & 1<<20) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_instruments], toggles & 1<<7) -/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_lobby], toggles & 1<<3) +// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_lobby], toggles & 1<<3) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_lobby], toggles & 1<<3) write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_midi], toggles & 1<<1) -/// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ship_ambience], toggles & 1<<8) +// write_preference(GLOB.preference_entries[/datum/preference/toggle/sound_ship_ambience], toggles & 1<<8) write_preference(GLOB.preference_entries[/datum/preference/numeric/sound_ship_ambience_volume], toggles & 1<<8) -///END DOPPLER EDIT +// END DOPPLER EDIT diff --git a/code/modules/client/preferences/sounds.dm b/code/modules/client/preferences/sounds.dm index a1c59f053f131..4b612769c85e5 100644 --- a/code/modules/client/preferences/sounds.dm +++ b/code/modules/client/preferences/sounds.dm @@ -1,23 +1,19 @@ /// Controls hearing ambience -///BEGIN DOPPLER EDIT - VOLUME MIXER -////datum/preference/toggle/sound_ambience -/// Controls ambience volume -/datum/preference/numeric/sound_ambience_volume +/datum/preference/numeric/sound_ambience_volume //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_ambience category = PREFERENCE_CATEGORY_GAME_PREFERENCES -/// savefile_key = "sound_ambience" - savefile_key = "sound_ambience_volume" + savefile_key = "sound_ambience_volume" //DOPPLER EDIT CHANGE - Original: savefile_key = "sound_ambience" savefile_identifier = PREFERENCE_PLAYER minimum = 0 maximum = 200 -/// default value is max/2 because 100 1x modifier, while 200 is 2x +//BEGIN DOPPLER ADDITION - VOLUME MIXER +// default value is max/2 because 100 1x modifier, while 200 is 2x /datum/preference/numeric/sound_ambience_volume/create_default_value() return maximum/2 +//END DOPPLER ADD -////datum/preference/toggle/sound_ambience/apply_to_client(client/client, value) -/datum/preference/numeric/sound_ambience_volume/apply_to_client(client/client, value) +/datum/preference/numeric/sound_ambience_volume/apply_to_client(client/client, value) //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_ambience/apply_to_client(client/client, value) client.update_ambience_pref(value) -///END DOPPLER EDIT /datum/preference/toggle/sound_breathing category = PREFERENCE_CATEGORY_GAME_PREFERENCES @@ -25,18 +21,17 @@ savefile_identifier = PREFERENCE_PLAYER /// Controls hearing announcement sounds -///BEGIN DOPPLER EDIT - VOLUME MIXER -////datum/preference/toggle/sound_announcements -/datum/preference/numeric/sound_announcements +/datum/preference/numeric/sound_announcements //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_announcements category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "sound_announcements" savefile_identifier = PREFERENCE_PLAYER minimum = 0 maximum = 200 +//BEGIN DOPPLER ADDITION - VOLUME MIXER /datum/preference/numeric/sound_announcements/create_default_value() return maximum/2 -///END DOPPLER EDIT +///END DOPPLER ADD /// Controls hearing the combat mode toggle sound /datum/preference/toggle/sound_combatmode @@ -105,26 +100,24 @@ client.mob.stop_sound_channel(CHANNEL_JUKEBOX) /// Controls hearing lobby music -///BEGIN DOPPLER EDIT - VOLUME MIXER -////datum/preference/toggle/sound_lobby -/datum/preference/numeric/sound_lobby +/datum/preference/numeric/sound_lobby //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_lobby category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "sound_lobby" savefile_identifier = PREFERENCE_PLAYER minimum = 0 maximum = 200 -/// default value is max/2 because 100 1x modifier, while 200 is 2x +//BEGIN DOPPLER ADDITION - VOLUME MIXER +// default value is max/2 because 100 1x modifier, while 200 is 2x /datum/preference/numeric/sound_lobby/create_default_value() return maximum/2 +//END DOPPLER ADD -////datum/preference/toggle/sound_lobby/apply_to_client_updated(client/client, value) -/datum/preference/numeric/sound_lobby/apply_to_client_updated(client/client, value) +/datum/preference/numeric/sound_lobby/apply_to_client_updated(client/client, value) //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_lobby/apply_to_client_updated(client/client, value) if (value && isnewplayer(client.mob)) client.playtitlemusic() else client.mob.stop_sound_channel(CHANNEL_LOBBYMUSIC) -///END DOPPLER EDIT /// Controls hearing admin music /datum/preference/toggle/sound_midi @@ -133,24 +126,21 @@ savefile_identifier = PREFERENCE_PLAYER /// Controls hearing ship ambience -///BEGIN DOPPLER EDIT - VOLUME MIXER -////datum/preference/toggle/sound_ship_ambience -/datum/preference/numeric/sound_ship_ambience_volume +/datum/preference/numeric/sound_ship_ambience_volume //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_ship_ambience category = PREFERENCE_CATEGORY_GAME_PREFERENCES -/// savefile_key = "sound_ship_ambience" - savefile_key = "sound_ship_ambience_volume" + savefile_key = "sound_ship_ambience_volume" //DOPPLER EDIT CHANGE - Original: savefile_key = "sound_ship_ambience" savefile_identifier = PREFERENCE_PLAYER minimum = 0 maximum = 200 -/// default value is max/2 because 100 1x modifier, while 200 is 2x +//BEGIN DOPPLER ADDITION - VOLUME MIXER +// default value is max/2 because 100 1x modifier, while 200 is 2x /datum/preference/numeric/sound_ship_ambience_volume/create_default_value() return maximum/2 +//END DOPPLER ADD -////datum/preference/toggle/sound_ship_ambience/apply_to_client_updated(client/client, value) -/datum/preference/numeric/sound_ship_ambience_volume/apply_to_client_updated(client/client, value) +/datum/preference/numeric/sound_ship_ambience_volume/apply_to_client_updated(client/client, value) //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_ship_ambience/apply_to_client_updated(client/client, value) client.mob.refresh_looping_ambience() -///END DOPPLER EDIT /// Controls hearing elevator music /datum/preference/toggle/sound_elevator @@ -159,16 +149,15 @@ savefile_identifier = PREFERENCE_PLAYER /// Controls hearing radio noise -///BEGIN DOPPLER EDIT - VOLUME MIXER -////datum/preference/toggle/radio_noise -/datum/preference/numeric/sound_radio_noise +/datum/preference/numeric/sound_radio_noise //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/radio_noise category = PREFERENCE_CATEGORY_GAME_PREFERENCES savefile_key = "sound_radio_noise" savefile_identifier = PREFERENCE_PLAYER minimum = 0 maximum = 200 +//BEGIN DOPPLER ADDITION - VOLUME MIXER /// default value is max/2 because 100 1x modifier, while 200 is 2x /datum/preference/numeric/sound_radio_noise/create_default_value() return maximum/2 -///END DOPPLER EDIT +//END DOPPLER ADD diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 8698f0a5dd5c7..0b5ac9565759f 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -5,10 +5,7 @@ // You do not need to raise this if you are adding new values that have sane defaults. // Only raise this value when changing the meaning/format/name/layout of an existing value // where you would want the updater procs below to run -///BEGIN DOPPLER EDIT - VOLUME MIXER -///#define SAVEFILE_VERSION_MAX 45 -#define SAVEFILE_VERSION_MAX 46 -///END DOPPLER EDIT +#define SAVEFILE_VERSION_MAX 46 //DOPPLER EDIT CHANGE - Original: #define SAVEFILE_VERSION_MAX 45 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -113,10 +110,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car new_typepath = /obj/item/clothing/accessory/pride, data_to_migrate = list(INFO_RESKIN = save_data?["pride_pin"]), ) -///BEGIN DOPPLER EDIT - VOLUME MIXER +//BEGIN DOPPLER ADDITION - VOLUME MIXER if (current_version < 46) migrate_boolean_sound_prefs_to_default_volume() -///END DOPPLER EDIT +//END DOPPLER ADD /// checks through keybindings for outdated unbound keys and updates them /datum/preferences/proc/check_keybindings() diff --git a/code/modules/mob/living/silicon/ai/ai_say.dm b/code/modules/mob/living/silicon/ai/ai_say.dm index 7bb1ddbac70a1..e55dcdb58aa3f 100644 --- a/code/modules/mob/living/silicon/ai/ai_say.dm +++ b/code/modules/mob/living/silicon/ai/ai_say.dm @@ -168,10 +168,7 @@ if(!only_listener) // Play voice for all mobs in the z level for(var/mob/player_mob as anything in GLOB.player_list) -///BEGIN DOPPLER EDIT -/// if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/toggle/sound_announcements))) - if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/numeric/sound_announcements))) -///END DOPPLER EDIT + if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/numeric/sound_announcements))) //DOPPLER EDIT CHANGE - Original: if(!player_mob.can_hear() || !(safe_read_pref(player_mob.client, /datum/preference/toggle/sound_announcements))) continue var/turf/player_turf = get_turf(player_mob) From 8556611eacc47c94fb8249948ef4b9655e30468c Mon Sep 17 00:00:00 2001 From: Name Date: Wed, 23 Oct 2024 19:22:12 -0400 Subject: [PATCH 6/6] accidentally committed a goober action. the code monkey responsible has been shot --- code/__HELPERS/announcements.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/__HELPERS/announcements.dm b/code/__HELPERS/announcements.dm index 67a642c7d5e0c..ad5b22045195e 100644 --- a/code/__HELPERS/announcements.dm +++ b/code/__HELPERS/announcements.dm @@ -51,6 +51,7 @@ for(var/mob/target in players) to_chat(target, finalized_announcement) if(play_sound && target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) //DOPPLER EDIT CHANGE - Original: if(play_sound && target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements)) + SEND_SOUND(target, sound(sound_override)) else to_chat(world, finalized_announcement)