From 9043cfa63cf1394f193d655d8c3e066d69653318 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 19 Mar 2026 03:42:47 +0100 Subject: [PATCH] fix: InputSettings PhysicalKeycode, visibility guard, dead code, delegate save --- scripts/UI/InputSettings.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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