From ca88b00d95de70cb43bace7a49ecac4d4fe5dad2 Mon Sep 17 00:00:00 2001 From: AwesomezPro99 Date: Tue, 30 Sep 2025 18:48:13 -0400 Subject: [PATCH] Fixed Random! song fade --- source/funkin/ui/freeplay/FreeplayState.hx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 90eb2711b..3158f1c13 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -2888,6 +2888,8 @@ class FreeplayState extends MusicBeatSubState var previewVolume:Float = 0.7; if (dj != null) previewVolume *= dj.getMusicPreviewMult(); + clearPreviews(); + if (curSelected == 0) { FunkinSound.playMusic('freeplayRandom', @@ -2919,8 +2921,6 @@ class FreeplayState extends MusicBeatSubState instSuffix = (instSuffix != '') ? '-$instSuffix' : ''; // trace('Attempting to play partial preview: ${previewSong.id}:${instSuffix}'); - clearPreviews(); - FunkinSound.playMusic(previewSong.id, { startingVolume: 0.0, @@ -2940,13 +2940,11 @@ class FreeplayState extends MusicBeatSubState var fadeStart:Float = (FlxG.sound.music.length / 1000) - 2; - previewTimers.push(new FlxTimer().start(fadeStart, function(_) - { + previewTimers.push(new FlxTimer().start(fadeStart, function(_) { FlxG.sound.music.fadeOut(2, 0); })); - previewTimers.push(new FlxTimer().start(FlxG.sound.music.length / 1000, function(_) - { + previewTimers.push(new FlxTimer().start(FlxG.sound.music.length / 1000, function(_) { playCurSongPreview(); })); }, @@ -3411,4 +3409,4 @@ typedef MoveData = var ?y:Float; var ?speed:Float; var ?wait:Float; -} \ No newline at end of file +}