diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 878e00b93f..92485df71f 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -160,6 +160,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic var filename = widget.Get("FILENAME"); filename.Text = map.Package == null ? "" : mapIsUnpacked ? Path.GetFileName(map.Package.Name) : Path.GetFileNameWithoutExtension(map.Package.Name); + if (string.IsNullOrEmpty(filename.Text)) + filename.TakeKeyboardFocus(); + var fileType = mapIsUnpacked ? MapFileType.Unpacked : MapFileType.OraMap; var fileTypes = new Dictionary() @@ -231,11 +234,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic }; var save = widget.Get("SAVE_BUTTON"); + save.IsDisabled = () => string.IsNullOrWhiteSpace(filename.Text) || string.IsNullOrWhiteSpace(title.Text) || string.IsNullOrWhiteSpace(author.Text); + save.OnClick = () => { - if (string.IsNullOrEmpty(filename.Text)) - return; - var combinedPath = Platform.ResolvePath(Path.Combine(selectedDirectory.Folder.Name, filename.Text + fileTypes[fileType].Extension)); if (map.Package?.Name != combinedPath)