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