Skip to content

Commit 4129f4f

Browse files
committed
Fix FunkinSoundTray volumes being played 10 times
1 parent 0702429 commit 4129f4f

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

source/funkin/ui/options/FunkinSoundTray.hx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,26 +120,20 @@ class FunkinSoundTray extends FlxSoundTray
120120
active = true;
121121
alphaTarget = 1;
122122

123-
for (i in 0..._bars.length)
124-
_bars[i].visible = i < getGlobalVolume(up);
125-
}
126-
127-
function getGlobalVolume(up:Bool = false):Int
128-
{
129123
var globalVolume:Int = Math.round(FlxG.sound.logToLinear(FlxG.sound.volume) * 10);
130-
131124
if (FlxG.sound.muted || FlxG.sound.volume == 0) globalVolume = 0;
132125

126+
for (i in 0..._bars.length)
127+
_bars[i].visible = i < globalVolume;
128+
133129
if (!silent)
134130
{
135131
// This is a String currently, but there is or was a Flixel PR to change this to a FlxSound or a Sound bject
136132
var sound:String = up ? volumeUpSound : volumeDownSound;
137-
138133
if (globalVolume == 10) sound = volumeMaxSound;
139-
if (sound != null) FlxG.sound.load(sound).play().volume = 0.3;
140-
}
141134

142-
return globalVolume;
135+
if (sound != null) FlxG.sound.play(sound);
136+
}
143137
}
144138

145139
function saveVolumePreferences():Void

0 commit comments

Comments
 (0)