From e6c48ed56fadbfe316087a3cfbf4845fa8f92c04 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Tue, 23 Mar 2021 17:28:05 -0500 Subject: [PATCH] fix back bug --- source/ui/ControlsMenu.hx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/ui/ControlsMenu.hx b/source/ui/ControlsMenu.hx index 629a89914..5f977659a 100644 --- a/source/ui/ControlsMenu.hx +++ b/source/ui/ControlsMenu.hx @@ -204,7 +204,7 @@ class ControlsMenu extends ui.OptionsState.Page super.update(elapsed); var controls = PlayerSettings.player1.controls; - if (enabled && deviceList != null && deviceListSelected == false && controls.BACK) + if (controlGrid.enabled && deviceList != null && deviceListSelected == false && controls.BACK) goToDeviceList(); if (prompt.exists) @@ -213,7 +213,8 @@ class ControlsMenu extends ui.OptionsState.Page { case Keys: { - var key = FlxG.keys.firstJustPressed(); + // check released otherwise bugs can happen when you change the BACK key + var key = FlxG.keys.firstJustReleased(); if (key != NONE) { if (key != ESCAPE) @@ -223,7 +224,7 @@ class ControlsMenu extends ui.OptionsState.Page } case Gamepad(id): { - var button = FlxG.gamepads.getByID(id).firstJustPressedID(); + var button = FlxG.gamepads.getByID(id).firstJustReleasedID(); if (button != NONE) { if (button != BACK)