Use mod switching for settings menu restart.

This commit is contained in:
Paul Chote
2017-02-18 11:27:45 +00:00
parent 500da07565
commit 073a00a2f4

View File

@@ -74,13 +74,21 @@ namespace OpenRA.Mods.Common.Widgets.Logic
OriginalGraphicsWindowedSize != current.Graphics.WindowedSize ||
OriginalGraphicsFullscreenSize != current.Graphics.FullscreenSize ||
OriginalServerDiscoverNatDevices != current.Server.DiscoverNatDevices)
{
Action restart = () =>
{
var external = Game.ExternalMods[ExternalMod.MakeKey(Game.ModData.Manifest)];
Game.SwitchToExternalMod(external, null, closeAndExit);
};
ConfirmationDialogs.ButtonPrompt(
title: "Restart Now?",
text: "Some changes will not be applied until\nthe game is restarted. Restart now?",
onConfirm: Game.Restart,
onConfirm: restart,
onCancel: closeAndExit,
confirmText: "Restart Now",
cancelText: "Restart Later");
}
else
closeAndExit();
};