@@ -44,10 +44,6 @@ import funkin.api.discord.DiscordClient;
4444#if FEATURE_NEWGROUNDS
4545import funkin .api .newgrounds .NewgroundsClient ;
4646#end
47- #if FEATURE_LOST_FOCUS_VOLUME
48- import flixel .tweens .FlxTween ;
49- import flixel .tweens .FlxEase ;
50- #end
5147
5248/**
5349 * A core class which performs initialization of the game.
@@ -297,45 +293,18 @@ class InitState extends FlxState
297293
298294 #if FEATURE_LOST_FOCUS_VOLUME
299295 @:noCompletion var _lastFocusVolume : Null <Float >;
300- @:noCompletion var _lostFocusVolumeTween : Null <FlxTween >;
301296
302297 function onLostFocus ()
303298 {
304- if (FlxG .sound .muted || FlxG .sound .volume == 0 || Preferences .lostVolumeFocusMode == " Off" || FlxG .autoPause ) return ;
305- _lostFocusVolumeTween ?. cancel ();
299+ if (FlxG .sound .muted || FlxG .sound .volume == 0 || FlxG .autoPause ) return ;
306300 _lastFocusVolume = FlxG .sound .volume ;
307-
308- if (Preferences .lostVolumeFocusMode == " Instant" )
309- {
310- FlxG .sound .volume * = Constants .LOST_FOCUS_VOLUME_MULTIPLIER ;
311- }
312- else if (Preferences .lostVolumeFocusMode == " Delayed" )
313- {
314- _lostFocusVolumeTween = FlxTween .num (FlxG .sound .volume , FlxG .sound .volume * Constants .LOST_FOCUS_VOLUME_MULTIPLIER , Constants .LOST_FOCUS_VOLUME_DURATION ,
315- {
316- startDelay : Constants .LOST_FOCUS_VOLUME_DELAY ,
317- ease : FlxEase .smootherStepOut
318- }, (volume : Float ) -> FlxG .sound .volume = volume );
319- }
301+ FlxG .sound .volume * = Constants .LOST_FOCUS_VOLUME_MULTIPLIER ;
320302 }
321303
322304 function onGainFocus ()
323305 {
324- if (FlxG .sound .muted || Preferences .lostVolumeFocusMode == " Off" || FlxG .autoPause ) return ;
325- _lostFocusVolumeTween ?. cancel ();
326-
327- if (_lastFocusVolume != null )
328- {
329- if (Preferences .lostVolumeFocusMode == " Instant" )
330- {
331- FlxG .sound .volume = _lastFocusVolume ;
332- }
333- else if (Preferences .lostVolumeFocusMode == " Delayed" )
334- {
335- _lostFocusVolumeTween = FlxTween .num (FlxG .sound .volume , _lastFocusVolume , Math .max (0.15 , FlxG .sound .volume / _lastFocusVolume * .5 ),
336- {ease : FlxEase .smootherStepInOut }, (volume : Float ) -> FlxG .sound .volume = volume );
337- }
338- }
306+ if (FlxG .sound .muted || FlxG .autoPause ) return ;
307+ if (_lastFocusVolume != null ) FlxG .sound .volume = _lastFocusVolume ;
339308 }
340309 #end
341310
0 commit comments