From 2a88adf6b33ce832fb8c76f8a565ca7cb34c4eff Mon Sep 17 00:00:00 2001 From: MAJigsaw77 <77043862+MAJigsaw77@users.noreply.github.com> Date: Thu, 16 Oct 2025 20:10:35 +0300 Subject: [PATCH] Fix `FunkinSoundTray`. --- source/funkin/ui/options/FunkinSoundTray.hx | 22 ++++++++------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/source/funkin/ui/options/FunkinSoundTray.hx b/source/funkin/ui/options/FunkinSoundTray.hx index 6dd070a09..42c6ffd86 100644 --- a/source/funkin/ui/options/FunkinSoundTray.hx +++ b/source/funkin/ui/options/FunkinSoundTray.hx @@ -100,16 +100,15 @@ class FunkinSoundTray extends FlxSoundTray else if (!visible) moveTrayMakeVisible(); } - /** - * Makes the little volume tray slide out. - * This is usually called by SoundFrontEnd, rather than being called by us explicitly - * (Which is why it's internals have been separated out a bit, for easier internal calling) - * - * @param up Whether the volume is increasing. - */ - override public function show(up:Bool = false):Void + override function showIncrement():Void { - moveTrayMakeVisible(up); + moveTrayMakeVisible(true); + saveVolumePreferences(); + } + + override function showDecrement():Void + { + moveTrayMakeVisible(false); saveVolumePreferences(); } @@ -125,11 +124,6 @@ class FunkinSoundTray extends FlxSoundTray _bars[i].visible = i < getGlobalVolume(up); } - /** - * Calculates the volume with proper linear scaling, and returns it as an int. - * @param up Whether the volume is increasing. - * @return Int The volume as an int from 0 to 10. - */ function getGlobalVolume(up:Bool = false):Int { var globalVolume:Int = Math.round(FlxG.sound.logToLinear(FlxG.sound.volume) * 10);