This commit is contained in:
Yoshman29
2023-03-12 23:44:37 +01:00
parent 7c073438b3
commit 9cd0742f53
5 changed files with 38 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
2460
2474
-2
View File
@@ -1115,8 +1115,6 @@ class PlayState extends MusicBeatState
gameOver(boyfriend);
else if (health >= maxHealth && canDadDie)
gameOver(dad);
if (!inCutscene)
keyShit();
+13 -2
View File
@@ -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 = {
+4 -2
View File
@@ -31,8 +31,10 @@ class OptionsScreen extends FlxTypedSpriteGroup<OptionType> {
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;
+20
View File
@@ -1,6 +1,7 @@
package funkin.options;
class OptionsTree extends FlxTypedGroup<OptionsScreen> {
public var lastMenu:OptionsScreen;
public override function new() {
super();
@@ -12,9 +13,18 @@ class OptionsTree extends FlxTypedGroup<OptionsScreen> {
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<OptionsScreen> {
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() {
}