Skip to content

Commit

Permalink
remove volume mixer to add volume mixer
Browse files Browse the repository at this point in the history
  • Loading branch information
carpotoxin committed Nov 4, 2024
1 parent 60bf21d commit 41f69e1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
4 changes: 2 additions & 2 deletions code/__HELPERS/announcements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
if(islist(players))
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))
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)
Expand All @@ -59,7 +59,7 @@
return

for(var/mob/player in GLOB.player_list)
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))
if(player.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements))
SEND_SOUND(player, sound(sound_override))

/**
Expand Down
5 changes: 2 additions & 3 deletions code/__HELPERS/priority_announce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,15 @@
should_play_sound_callback = should_play_sound

for(var/mob/target in players)
var/volume_modifier = (target.client?.prefs.read_preference(/datum/preference/numeric/sound_announcements)) //DOPPLER EDIT ADDITION
if(isnewplayer(target) || !target.can_hear())
continue

to_chat(target, announcement)
if(!should_play_sound || (should_play_sound_callback && !should_play_sound_callback.Invoke(target)))
continue

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))
if(target.client?.prefs.read_preference(/datum/preference/toggle/sound_announcements))
SEND_SOUND(target, sound(sound_to_play))

#undef MAJOR_ANNOUNCEMENT_TITLE
#undef MAJOR_ANNOUNCEMENT_TEXT
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/vote.dm
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ 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/numeric/sound_announcements))) //DOPPLER EDIT CHANGE - Original: 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/toggle/sound_announcements)))
SEND_SOUND(new_voter, sound(current_vote.vote_sound))

return TRUE
Expand Down
15 changes: 1 addition & 14 deletions code/modules/client/preferences/sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_ambience_volume"
savefile_identifier = PREFERENCE_PLAYER
minimum = 0
maximum = 200

minimum = 0
maximum = 200
Expand All @@ -22,17 +20,10 @@
savefile_identifier = PREFERENCE_PLAYER

/// Controls hearing announcement sounds
/datum/preference/numeric/sound_announcements //DOPPLER EDIT CHANGE - Original: /datum/preference/toggle/sound_announcements
/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 ADD

/// Controls hearing the combat mode toggle sound
/datum/preference/toggle/sound_combatmode
Expand Down Expand Up @@ -106,8 +97,6 @@
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_lobby_volume"
savefile_identifier = PREFERENCE_PLAYER
minimum = 0
maximum = 200

minimum = 0
maximum = 200
Expand All @@ -133,8 +122,6 @@
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
savefile_key = "sound_ship_ambience_volume"
savefile_identifier = PREFERENCE_PLAYER
minimum = 0
maximum = 200

minimum = 0
maximum = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const sound_ambience_volume: Feature<number> = {
description: `Ambience refers to the more noticeable ambient sounds that play on occasion.`,
component: FeatureSliderInput,
};
// END DOPPLER EDIT

export const sound_breathing: FeatureToggle = {
name: 'Enable breathing sounds',
Expand All @@ -22,15 +21,11 @@ export const sound_breathing: FeatureToggle = {
component: CheckboxInput,
};

// BEGIN DOPPLER EDIT - VOLUME MIXER
// export const sound_announcements: FeatureToggle = {
// name: 'Enable announcement sounds',
export const sound_announcements: Feature<number> = {
name: 'Announcement volume',
export const sound_announcements: FeatureToggle = {
name: 'Enable announcement sounds',
category: 'SOUND',
description: 'When enabled, hear sounds for command reports, notices, etc.',
// component: CheckboxInput,
component: FeatureSliderInput,
component: CheckboxInput,
};

export const sound_combatmode: FeatureToggle = {
Expand Down Expand Up @@ -83,7 +78,6 @@ export const sound_lobby_volume: Feature<number> = {
category: 'SOUND',
component: FeatureSliderInput,
};
// END DOPPLER EDIT

export const sound_midi: FeatureToggle = {
name: 'Enable admin music',
Expand All @@ -98,7 +92,6 @@ export const sound_ship_ambience_volume: Feature<number> = {
description: `Ship ambience refers to the low ambient buzz that plays on loop.`,
component: FeatureSliderInput,
};
// END DOPPLER EDIT

export const sound_elevator: FeatureToggle = {
name: 'Enable elevator music',
Expand Down

0 comments on commit 41f69e1

Please sign in to comment.