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:
@@ -309,31 +309,29 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
void DeleteOneMap(string map, Action<string> after)
|
||||
{
|
||||
ConfirmationDialogs.PromptConfirmAction(
|
||||
"Delete map",
|
||||
"Delete the map '{0}'?".F(Game.ModData.MapCache[map].Title),
|
||||
() =>
|
||||
title: "Delete map",
|
||||
text: "Delete the map '{0}'?".F(Game.ModData.MapCache[map].Title),
|
||||
onConfirm: () =>
|
||||
{
|
||||
var newUid = DeleteMap(map);
|
||||
if (after != null)
|
||||
after(newUid);
|
||||
},
|
||||
null,
|
||||
"Delete");
|
||||
confirmText: "Delete");
|
||||
}
|
||||
|
||||
void DeleteAllMaps(string[] maps, Action<string> after)
|
||||
{
|
||||
ConfirmationDialogs.PromptConfirmAction(
|
||||
"Delete maps",
|
||||
"Delete all maps on this page?",
|
||||
() =>
|
||||
title: "Delete maps",
|
||||
text: "Delete all maps on this page?",
|
||||
onConfirm: () =>
|
||||
{
|
||||
maps.Do(m => DeleteMap(m));
|
||||
if (after != null)
|
||||
after(WidgetUtils.ChooseInitialMap(null));
|
||||
},
|
||||
null,
|
||||
"Delete");
|
||||
confirmText: "Delete");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user