From 63de0bb910a90b2257e6ac44d630287bb37df058 Mon Sep 17 00:00:00 2001 From: rob-v Date: Tue, 18 Apr 2017 16:02:36 +0200 Subject: [PATCH] Fix ignored 'Failed to save map' #13036 --- .../Widgets/Logic/Editor/SaveMapLogic.cs | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs index 7b60a501e3..b5a97c4892 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Editor/SaveMapLogic.cs @@ -191,19 +191,25 @@ namespace OpenRA.Mods.Common.Widgets.Logic } map.Save(package); + + // Update the map cache so it can be loaded without restarting the game + modData.MapCache[map.Uid].UpdateFromMap(map.Package, selectedDirectory.Folder, selectedDirectory.Classification, null, map.Grid.Type); + + Console.WriteLine("Saved current map at {0}", combinedPath); + Ui.CloseWindow(); + + onSave(map.Uid); } - catch + catch (Exception e) { - Console.WriteLine("Failed to save map at {0}", combinedPath); + Log.Write("debug", "Failed to save map at {0}: {1}", combinedPath, e.Message); + + ConfirmationDialogs.ButtonPrompt( + title: "Failed to save map", + text: "See debug.log for details.", + onConfirm: () => { }, + confirmText: "Ok"); } - - // Update the map cache so it can be loaded without restarting the game - modData.MapCache[map.Uid].UpdateFromMap(map.Package, selectedDirectory.Folder, selectedDirectory.Classification, null, map.Grid.Type); - - Console.WriteLine("Saved current map at {0}", combinedPath); - Ui.CloseWindow(); - - onSave(map.Uid); }; } }