diff --git a/scripts/UI/InputSettings.cs b/scripts/UI/InputSettings.cs index c15d525..8850640 100644 --- a/scripts/UI/InputSettings.cs +++ b/scripts/UI/InputSettings.cs @@ -10,6 +10,7 @@ public partial class InputSettings : Control [Export] public Control InputSettingsControl { get; set; } [Export] public PackedScene InputButtonScene { get; set; } + // When adding new game actions, update this list to make them remappable in settings. private static readonly string[] RemappableActions = ["left", "right", "jump", "attack", "pause", "show_marketplace"]; @@ -40,6 +41,8 @@ public partial class InputSettings : Control public override void _UnhandledInput(InputEvent @event) { + if (!IsVisibleInTree()) return; + if (_rebindingAction != null) { if (@event is InputEventKey keyEvent && keyEvent.Pressed && !keyEvent.Echo) @@ -65,7 +68,6 @@ public partial class InputSettings : Control foreach (Node child in ActionsContainer.GetChildren()) child.QueueFree(); - bool first = true; foreach (var action in RemappableActions) { var row = InputButtonScene.Instantiate