Changes to the RestartGame function to make it more streamlined

Removal of PromptAbortAction and inclusion into PromptConfirmAction
Changes to prevent a restart button being required for all mods
ConfirmAction
Addtion of named parameters to PromptConfirmAction
Moved StartGame from MissionBrowserLogic.cs to Game.cs
This commit is contained in:
Whinis
2016-01-14 22:24:30 -05:00
parent e0c033fe99
commit 9059e3e2c8
11 changed files with 166 additions and 190 deletions

View File

@@ -403,16 +403,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Action<ReplayMetadata, Action> onDeleteReplay = (r, after) =>
{
ConfirmationDialogs.PromptConfirmAction(
"Delete selected replay?",
"Delete replay '{0}'?".F(Path.GetFileNameWithoutExtension(r.FilePath)),
() =>
title: "Delete selected replay?",
text: "Delete replay '{0}'?".F(Path.GetFileNameWithoutExtension(r.FilePath)),
onConfirm: () =>
{
DeleteReplay(r);
if (after != null)
after.Invoke();
},
null,
"Delete");
confirmText: "Delete");
};
{
@@ -444,16 +443,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
ConfirmationDialogs.PromptConfirmAction(
"Delete all selected replays?",
"Delete {0} replays?".F(list.Count),
() =>
title: "Delete all selected replays?",
text: "Delete {0} replays?".F(list.Count),
onConfirm: () =>
{
list.ForEach(DeleteReplay);
if (selectedReplay == null)
SelectFirstVisibleReplay();
},
null,
"Delete All");
confirmText: "Delete All");
};
}
}