restart the game instead of unmounting on the fly

avoid more redundancy between the load screens
This commit is contained in:
Matthias Mailänder
2014-06-28 12:51:54 +02:00
parent 334605287c
commit 2f55768c1b
11 changed files with 64 additions and 105 deletions

View File

@@ -81,6 +81,16 @@ namespace OpenRA.Mods.RA.Widgets.Logic
musicSlider.OnChange += x => Sound.MusicVolume = x;
musicSlider.Value = Sound.MusicVolume;
var installButton = widget.GetOrNull<ButtonWidget>("INSTALL_BUTTON");
if (installButton != null)
{
var args = new string[] { "Launch.Window=INSTALL_MUSIC_PANEL" };
installButton.OnClick = () => Game.InitializeMod(Game.Settings.Game.Mod, new Arguments(args));
var installData = Game.modData.Manifest.ContentInstaller;
installButton.IsVisible = () =>
modRules.InstalledMusic.ToArray().Length <= Exts.ParseIntegerInvariant(installData["ShippedSoundtracks"]);
}
panel.Get<ButtonWidget>("BACK_BUTTON").OnClick = () => { Game.Settings.Save(); Ui.CloseWindow(); onExit(); };
}