Make the save game title field take focus

This commit is contained in:
abcdefg30
2023-02-09 16:50:43 +01:00
committed by Gustas
parent 9ce4ef0bff
commit f1d439a07f

View File

@@ -312,14 +312,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic
void SelectFirstVisible()
{
Select(isSavePanel ? null : games.FirstOrDefault());
if (isSavePanel)
{
saveTextField.TakeKeyboardFocus();
saveTextField.CursorPosition = saveTextField.Text.Length;
}
}
void Select(string savePath)
{
selectedSave = savePath;
if (isSavePanel)
saveTextField.Text = savePath == null ? defaultSaveFilename :
Path.GetFileNameWithoutExtension(savePath);
{
saveTextField.Text = savePath == null ? defaultSaveFilename : Path.GetFileNameWithoutExtension(savePath);
saveTextField.CursorPosition = saveTextField.Text.Length;
}
}
void Load()