Add more confirmation dialogue to the map editor
When saving on top of another map, or when saving on a map that has been edited outside the map editor
This commit is contained in:
@@ -389,12 +389,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
// Show dialog only if updated since last save
|
||||
button.OnClick = () =>
|
||||
{
|
||||
if (actionManager.HasUnsavedItems())
|
||||
var map = modData.MapCache.GetUpdatedMap(world.Map.Uid);
|
||||
var deletedOrUnavailable = map == null || modData.MapCache[map].Status != MapStatus.Available;
|
||||
if (actionManager.HasUnsavedItems() || deletedOrUnavailable)
|
||||
{
|
||||
hideMenu = true;
|
||||
ConfirmationDialogs.ButtonPrompt(
|
||||
title: "Exit Map Editor",
|
||||
text: "Exit and lose all unsaved changes?",
|
||||
title: "Warning",
|
||||
text: deletedOrUnavailable ? "The map may have been deleted outside the editor" : "Exit and lose all unsaved changes?",
|
||||
confirmText: deletedOrUnavailable ? "Exit anyway" : "Exit",
|
||||
onConfirm: OnQuit,
|
||||
onCancel: ShowMenu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user