diff --git a/assets b/assets index 005c96f85..d5b2d05df 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 005c96f85f4304865acb196e7cc4d6d83f9d76d8 +Subproject commit d5b2d05df6d197f90a1b93f5b50835209c21adf7 diff --git a/source/funkin/play/character/BaseCharacter.hx b/source/funkin/play/character/BaseCharacter.hx index 0dab2101a..4778e0c1c 100644 --- a/source/funkin/play/character/BaseCharacter.hx +++ b/source/funkin/play/character/BaseCharacter.hx @@ -382,12 +382,19 @@ class BaseCharacter extends Bopper // and Darnell (this keeps the flame on his lighter flickering). // Works for idle, singLEFT/RIGHT/UP/DOWN, alt singing animations, and anything else really. - if (!getCurrentAnimation().endsWith(Constants.ANIMATION_HOLD_SUFFIX) - && hasAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX) - && isAnimationFinished()) + if (isAnimationFinished() + && !getCurrentAnimation().endsWith(Constants.ANIMATION_HOLD_SUFFIX) + && hasAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX)) { playAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX); } + else + { + if (isAnimationFinished()) + { + trace('Not playing hold (${getCurrentAnimation()}) (${isAnimationFinished()}, ${getCurrentAnimation().endsWith(Constants.ANIMATION_HOLD_SUFFIX)}, ${hasAnimation(getCurrentAnimation() + Constants.ANIMATION_HOLD_SUFFIX)})'); + } + } // Handle character note hold time. if (isSinging()) @@ -427,7 +434,7 @@ class BaseCharacter extends Bopper else { // Play the idle animation. - trace('${characterId}: attempting dance'); + // trace('${characterId}: attempting dance'); dance(true); } } @@ -638,6 +645,7 @@ class BaseCharacter extends Bopper var anim:String = 'sing${dir.nameUpper}${miss ? 'miss' : ''}${suffix != '' ? '-${suffix}' : ''}'; // restart even if already playing, because the character might sing the same note twice. + trace('Playing ${anim}...'); playAnimation(anim, true); } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index dc42bd651..416e79df6 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -178,9 +178,22 @@ class FreeplayState extends MusicBeatSubState var stickerSubState:Null = null; - public static var rememberedDifficulty:Null = Constants.DEFAULT_DIFFICULTY; + /** + * The difficulty we were on when this menu was last accessed. + */ + public static var rememberedDifficulty:String = Constants.DEFAULT_DIFFICULTY; + + /** + * The song we were on when this menu was last accessed. + * NOTE: `null` if the last song was `Random`. + */ public static var rememberedSongId:Null = 'tutorial'; + /** + * The character we were on when this menu was last accessed. + */ + public static var rememberedCharacterId:String = Constants.DEFAULT_CHARACTER; + var funnyCam:FunkinCamera; var rankCamera:FunkinCamera; var rankBg:FunkinSprite; @@ -210,14 +223,16 @@ class FreeplayState extends MusicBeatSubState public function new(?params:FreeplayStateParams, ?stickers:StickerSubState) { - currentCharacterId = params?.character ?? Constants.DEFAULT_CHARACTER; + currentCharacterId = params?.character ?? rememberedCharacterId; var fetchPlayableCharacter = function():PlayableCharacter { - var result = PlayerRegistry.instance.fetchEntry(params?.character ?? Constants.DEFAULT_CHARACTER); + var result = PlayerRegistry.instance.fetchEntry(params?.character ?? rememberedCharacterId); if (result == null) throw 'No valid playable character with id ${params?.character}'; return result; }; currentCharacter = fetchPlayableCharacter(); + rememberedCharacterId = currentCharacter?.id ?? Constants.DEFAULT_CHARACTER; + fromResultsParams = params?.fromResults; if (fromResultsParams?.playRankAnim == true) @@ -744,10 +759,7 @@ class FreeplayState extends MusicBeatSubState var tempSongs:Array> = songs; // Remember just the difficulty because it's important for song sorting. - if (rememberedDifficulty != null) - { - currentDifficulty = rememberedDifficulty; - } + currentDifficulty = rememberedDifficulty; if (filterStuff != null) tempSongs = sortSongs(tempSongs, filterStuff); @@ -1216,7 +1228,7 @@ class FreeplayState extends MusicBeatSubState FlxG.switchState(FreeplayState.build( { { - character: currentCharacterId == "pico" ? "bf" : "pico", + character: currentCharacterId == "pico" ? Constants.DEFAULT_CHARACTER : "pico", } })); } @@ -1889,7 +1901,7 @@ class FreeplayState extends MusicBeatSubState intendedCompletion = 0.0; diffIdsCurrent = diffIdsTotal; rememberedSongId = null; - rememberedDifficulty = null; + rememberedDifficulty = Constants.DEFAULT_DIFFICULTY; albumRoll.albumId = null; } diff --git a/source/funkin/ui/freeplay/SongMenuItem.hx b/source/funkin/ui/freeplay/SongMenuItem.hx index 2eec83223..b4409d377 100644 --- a/source/funkin/ui/freeplay/SongMenuItem.hx +++ b/source/funkin/ui/freeplay/SongMenuItem.hx @@ -162,7 +162,7 @@ class SongMenuItem extends FlxSpriteGroup sparkle = new FlxSprite(ranking.x, ranking.y); sparkle.frames = Paths.getSparrowAtlas('freeplay/sparkle'); - sparkle.animation.addByPrefix('sparkle', 'sparkle', 24, false); + sparkle.animation.addByPrefix('sparkle', 'sparkle Export0', 24, false); sparkle.animation.play('sparkle', true); sparkle.scale.set(0.8, 0.8); sparkle.blend = BlendMode.ADD; @@ -523,7 +523,6 @@ class SongMenuItem extends FlxSpriteGroup checkWeek(songData?.songId); } - var frameInTicker:Float = 0; var frameInTypeBeat:Int = 0; diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx index d219bfbcf..3f532d33c 100644 --- a/source/funkin/ui/mainmenu/MainMenuState.hx +++ b/source/funkin/ui/mainmenu/MainMenuState.hx @@ -119,7 +119,10 @@ class MainMenuState extends MusicBeatState openSubState(new FreeplayState( { - character: FlxG.keys.pressed.SHIFT ? 'pico' : 'bf', + #if debug + // If SHIFT is held, toggle the selected character, else use the remembered character + character: (FlxG.keys.pressed.SHIFT) ? (FreeplayState.rememberedCharacterId == Constants.DEFAULT_CHARACTER ? 'pico' : 'bf') : null, + #end })); });