diff --git a/buildnumber.txt b/buildnumber.txt index 75d9bd8b..a7318fc0 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2460 \ No newline at end of file +2474 \ No newline at end of file diff --git a/source/funkin/game/PlayState.hx b/source/funkin/game/PlayState.hx index 7875324a..863e1317 100644 --- a/source/funkin/game/PlayState.hx +++ b/source/funkin/game/PlayState.hx @@ -1115,8 +1115,6 @@ class PlayState extends MusicBeatState gameOver(boyfriend); else if (health >= maxHealth && canDadDie) gameOver(dad); - - if (!inCutscene) keyShit(); diff --git a/source/funkin/options/OptionsMenu.hx b/source/funkin/options/OptionsMenu.hx index f358a9d2..f314d97b 100644 --- a/source/funkin/options/OptionsMenu.hx +++ b/source/funkin/options/OptionsMenu.hx @@ -1,5 +1,6 @@ package funkin.options; +import flixel.tweens.FlxTween; import funkin.options.OptionsScreen; import funkin.menus.MainMenuState; import funkin.options.type.TextOption; @@ -95,6 +96,14 @@ class OptionsMenu extends MusicBeatState { if (optionsTree.members.length <= 0) { exit(); } else { + if (menuChangeTween != null) { + menuChangeTween.cancel(); + } + + menuChangeTween = FlxTween.tween(FlxG.camera.scroll, {x: FlxG.width * Math.max(0, (optionsTree.members.length-1))}, 1.5, {ease: menuTransitionEase, onComplete: function(t) { + optionsTree.clearLastMenu(); + menuChangeTween = null; + }}); // TODO: update top info } } @@ -109,11 +118,13 @@ class OptionsMenu extends MusicBeatState { CoolUtil.playMenuSFX(CANCEL); } + var menuChangeTween:FlxTween; public override function update(elapsed:Float) { super.update(elapsed); - - FlxG.camera.scroll.x = lerp(FlxG.camera.scroll.x, FlxG.width * Math.max(0, (optionsTree.members.length-1)), 0.2); } + + public static inline function menuTransitionEase(e:Float) + return FlxEase.quintInOut(FlxEase.cubeOut(e)); } typedef OptionCategory = { diff --git a/source/funkin/options/OptionsScreen.hx b/source/funkin/options/OptionsScreen.hx index 8442f488..735112bd 100644 --- a/source/funkin/options/OptionsScreen.hx +++ b/source/funkin/options/OptionsScreen.hx @@ -31,8 +31,10 @@ class OptionsScreen extends FlxTypedSpriteGroup { option.y = __firstFrame ? y : CoolUtil.fpsLerp(option.y, y, 0.25); option.x = x + (-50 + (Math.abs(Math.cos((option.y + (optionHeight / 2) - (FlxG.camera.scroll.y + (FlxG.height / 2))) / (FlxG.height * 1.25) * Math.PI)) * 150)); } - - __firstFrame = false; + if (__firstFrame) { + __firstFrame = false; + return; + } if (members.length > 0) { members[curSelected].selected = true; diff --git a/source/funkin/options/OptionsTree.hx b/source/funkin/options/OptionsTree.hx index 30eb1b11..2960e0ab 100644 --- a/source/funkin/options/OptionsTree.hx +++ b/source/funkin/options/OptionsTree.hx @@ -1,6 +1,7 @@ package funkin.options; class OptionsTree extends FlxTypedGroup { + public var lastMenu:OptionsScreen; public override function new() { super(); @@ -12,9 +13,18 @@ class OptionsTree extends FlxTypedGroup { last.update(elapsed); } + + public override function draw() { + super.draw(); + if (lastMenu != null) { + lastMenu.draw(); + } + } + public override function add(m:OptionsScreen) { super.add(m); setup(m); + clearLastMenu(); onMenuChange(); return m; } @@ -31,14 +41,24 @@ class OptionsTree extends FlxTypedGroup { m.onClose = __subMenuClose; m.id = members.indexOf(m); m.parent = this; + m.update(0); } function __subMenuClose(m:OptionsScreen) { + clearLastMenu(); + lastMenu = m; remove(m, true); onMenuChange(); onMenuClose(m); } + public function clearLastMenu() { + if (lastMenu != null) { + lastMenu.destroy(); + lastMenu = null; + } + } + public dynamic function onMenuChange() { }