From c6d5a1a182cccdf4e2bc176dd328328abd67051a Mon Sep 17 00:00:00 2001 From: Ashley Newson Date: Sun, 2 Feb 2025 15:14:24 +0000 Subject: [PATCH] Yield focus for map generator text settings Makes any selected text-based map generator settings (currently just the seed input) yield keyboard focus when the user presses escape or enter. --- .../Widgets/Logic/Editor/MapGeneratorToolLogic.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs index ff1d083914..74503a2f8d 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/MapGeneratorToolLogic.cs @@ -230,6 +230,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic input.IsValid = () => valid; }; + input.OnEscKey = _ => { input.YieldKeyboardFocus(); return true; }; + input.OnEnterKey = _ => { input.YieldKeyboardFocus(); return true; }; break; }