From efcd3af1931d738826efee5cb64cb6b2b03cd1a1 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Thu, 23 Mar 2023 11:11:44 -0700 Subject: [PATCH] Fix Keybinds Menu --- source/funkin/options/keybinds/KeybindSetting.hx | 4 ++-- source/funkin/options/keybinds/KeybindsOptions.hx | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/source/funkin/options/keybinds/KeybindSetting.hx b/source/funkin/options/keybinds/KeybindSetting.hx index 3cbad799..4266fc7e 100644 --- a/source/funkin/options/keybinds/KeybindSetting.hx +++ b/source/funkin/options/keybinds/KeybindSetting.hx @@ -64,8 +64,8 @@ class KeybindSetting extends FlxTypedSpriteGroup { public override function update(elapsed:Float) { super.update(elapsed); - bind1.alpha = (p2Selected ? 0.55 : 1) / alpha; - bind2.alpha = (p2Selected ? 1 : 0.55) / alpha; + bind1.alpha = (p2Selected ? 0.2 : 1) / alpha; + bind2.alpha = (p2Selected ? 1 : 0.2) / alpha; bind1.alpha *= alpha; bind2.alpha *= alpha; } diff --git a/source/funkin/options/keybinds/KeybindsOptions.hx b/source/funkin/options/keybinds/KeybindsOptions.hx index 01ae3eaa..2de3f4d8 100644 --- a/source/funkin/options/keybinds/KeybindsOptions.hx +++ b/source/funkin/options/keybinds/KeybindsOptions.hx @@ -83,7 +83,7 @@ class KeybindsOptions extends MusicBeatSubstate { public var settingCam:FlxCamera; public var p2Selected:Bool = false; - public var curSelected:Int = -1; + public var curSelected:Int = 0; public var canSelect:Bool = true; public var alphabets:FlxTypedGroup; public var bg:FlxSprite; @@ -102,7 +102,6 @@ class KeybindsOptions extends MusicBeatSubstate { super.create(); instance = this; - isSubState = FlxG.state != this; alphabets = new FlxTypedGroup(); bg = new FlxSprite(-80).loadAnimatedGraphic(Paths.image(isSubState ? 'menus/menuTransparent' : 'menus/menuBGBlue')); @@ -166,8 +165,6 @@ class KeybindsOptions extends MusicBeatSubstate { } add(alphabets); add(camFollow); - - changeSelection(1); } public override function destroy() { @@ -197,7 +194,8 @@ class KeybindsOptions extends MusicBeatSubstate { } if (canSelect) { - changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0)); + changeSelection((controls.UP_P ? -1 : 0) + (controls.DOWN_P ? 1 : 0)); + if (controls.BACK) { FlxTransitionableState.skipNextTransIn = true; if (isSubState) @@ -235,11 +233,11 @@ class KeybindsOptions extends MusicBeatSubstate { } public function changeSelection(change:Int) { - if (change == 0) return; - CoolUtil.playMenuSFX(SCROLL, 0.4); + if (change != 0) CoolUtil.playMenuSFX(SCROLL, 0.4); + curSelected = FlxMath.wrap(curSelected + change, 0, alphabets.length-1); alphabets.forEach(function(e) { - e.alpha = 0.55; + e.alpha = 0.2; }); if (alphabets.members[curSelected] != null) { var alphabet = alphabets.members[curSelected];