Skip to content

Commit 750779a

Browse files
Disable the pop-in animation on the Random capsule for consistency.
1 parent 095bc90 commit 750779a

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

source/funkin/ui/freeplay/FreeplayState.hx

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,20 @@ class FreeplayState extends MusicBeatSubState
703703

704704
if (onlyIfChanged)
705705
{
706-
// == performs equality by reference
707-
if (tempSongs.isEqualUnordered(currentFilteredSongs)) return;
706+
if (tempSongs.isEqualUnordered(currentFilteredSongs))
707+
{
708+
// If the song list is the same, we don't need to generate a new list.
709+
710+
// Instead, we just apply the jump-in animation to the existing capsules.
711+
for (capsule in grpCapsules.members)
712+
{
713+
capsule.initPosition(FlxG.width, 0);
714+
capsule.initJumpIn(0, force);
715+
}
716+
717+
// Stop processing.
718+
return;
719+
}
708720
}
709721

710722
// Only now do we know that the filter is actually changing.
@@ -721,7 +733,8 @@ class FreeplayState extends MusicBeatSubState
721733

722734
// Initialize the random capsule, with empty/blank info (which we display once bf/pico does his hand)
723735
var randomCapsule:SongMenuItem = grpCapsules.recycle(SongMenuItem);
724-
randomCapsule.init(FlxG.width, 0, null, styleData);
736+
randomCapsule.initPosition(FlxG.width, 0);
737+
randomCapsule.initData(null, styleData);
725738
randomCapsule.y = randomCapsule.intendedY(0) + 10;
726739
randomCapsule.targetPos.x = randomCapsule.x;
727740
randomCapsule.alpha = 0;
@@ -736,7 +749,8 @@ class FreeplayState extends MusicBeatSubState
736749
if (fromCharSelect) randomCapsule.forcePosition();
737750
else
738751
{
739-
randomCapsule.initJumpIn(0, force);
752+
// randomCapsule.initJumpIn(0, force);
753+
randomCapsule.forcePosition();
740754
}
741755

742756
var hsvShader:HSVShader = new HSVShader();
@@ -750,7 +764,8 @@ class FreeplayState extends MusicBeatSubState
750764

751765
var funnyMenu:SongMenuItem = grpCapsules.recycle(SongMenuItem);
752766

753-
funnyMenu.init(FlxG.width, 0, tempSong, styleData);
767+
funnyMenu.initPosition(FlxG.width, 0);
768+
funnyMenu.initData(tempSong, styleData);
754769
funnyMenu.onConfirm = function() {
755770
capsuleOnOpenDefault(funnyMenu);
756771
};
@@ -760,8 +775,12 @@ class FreeplayState extends MusicBeatSubState
760775
funnyMenu.capsule.alpha = 0.5;
761776
funnyMenu.hsvShader = hsvShader;
762777
funnyMenu.newText.animation.curAnim.curFrame = 45 - ((i * 4) % 45);
778+
779+
// This stops the bounce-in animation.
763780
funnyMenu.forcePosition();
764781

782+
// funnyMenu.initJumpIn(0, force);
783+
765784
grpCapsules.add(funnyMenu);
766785
}
767786

@@ -770,7 +789,6 @@ class FreeplayState extends MusicBeatSubState
770789
rememberSelection();
771790
changeSelection();
772791
refreshCapsuleDisplays();
773-
774792
}
775793

776794
/**
@@ -1566,7 +1584,6 @@ class FreeplayState extends MusicBeatSubState
15661584
if (dj != null) dj.resetAFKTimer();
15671585
changeDiff(1);
15681586
generateSongList(currentFilter, true, false);
1569-
15701587
}
15711588

15721589
if (controls.BACK && !busy)
@@ -1795,7 +1812,7 @@ class FreeplayState extends MusicBeatSubState
17951812

17961813
if (songCapsule.freeplayData != null)
17971814
{
1798-
songCapsule.init(null, null, songCapsule.freeplayData);
1815+
songCapsule.initData(songCapsule.freeplayData);
17991816
songCapsule.checkClip();
18001817
}
18011818
}

source/funkin/ui/freeplay/SongMenuItem.hx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,14 @@ class SongMenuItem extends FlxSpriteGroup
494494
updateSelected();
495495
}
496496

497-
public function init(?x:Float, ?y:Float, freeplayData:Null<FreeplaySongData>, ?styleData:FreeplayStyle = null):Void
497+
public function initPosition(x:Float, y:Float):Void
498+
{
499+
this.x = x;
500+
this.y = y;
501+
}
502+
503+
public function initData(freeplayData:Null<FreeplaySongData>, ?styleData:FreeplayStyle = null):Void
498504
{
499-
if (x != null) this.x = x;
500-
if (y != null) this.y = y;
501505
this.freeplayData = freeplayData;
502506

503507
// im so mad i have to do this but im pretty sure with the capsules recycling i cant call the new function properly :/
@@ -679,6 +683,17 @@ class SongMenuItem extends FlxSpriteGroup
679683

680684
if (selected && songText.tooLong) songText.initMove();
681685
}
686+
687+
public override function kill():Void
688+
{
689+
super.kill();
690+
691+
visible = true;
692+
capsule.alpha = 1;
693+
doLerp = false;
694+
doJumpIn = false;
695+
doJumpOut = false;
696+
}
682697
}
683698

684699
/**

0 commit comments

Comments
 (0)