From afc6532aa8b58cad6a092d6f3542e9217a7e8ba9 Mon Sep 17 00:00:00 2001 From: Gustas <37534529+PunkPun@users.noreply.github.com> Date: Mon, 29 Dec 2025 20:29:26 +0200 Subject: [PATCH] Add more robust input handling --- OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs index a5a8a57184..e0406449a6 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/ActorEditLogic.cs @@ -107,6 +107,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic actorEditPanel.IsVisible = () => editor.CurrentBrush == editor.DefaultBrush && SelectedActor != null; actorIDField.OnEscKey = _ => actorIDField.YieldKeyboardFocus(); + actorIDField.OnEnterKey = _ => actorIDField.YieldKeyboardFocus(); actorIDField.OnTextEdited = () => { @@ -121,26 +122,26 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (!SelectedActor.ID.Equals(actorId, StringComparison.OrdinalIgnoreCase) && editorActorLayer[actorId] != null) { nextActorIDStatus = ActorIDStatus.Duplicate; - actorIDErrorLabel.Visible = true; return; } SetActorID(actorId); - nextActorIDStatus = ActorIDStatus.Normal; }; actorIDField.OnLoseFocus = () => { // Reset invalid IDs back to their starting value if (actorIDStatus != ActorIDStatus.Normal) + { SetActorID(initialActorID); + actorIDField.Text = initialActorID; + } }; } void SetActorID(string actorId) { editActorPreview.SetActorID(actorId); - nextActorIDStatus = ActorIDStatus.Normal; }