@pchote breaks all the things

This commit is contained in:
Matthias Mailänder
2014-07-06 14:45:05 +02:00
parent 443b46ca64
commit fe41ac7fa3
4 changed files with 12 additions and 9 deletions

View File

@@ -443,8 +443,8 @@ namespace OpenRA
if (!string.IsNullOrEmpty(window))
{
var installData = modData.Manifest.ContentInstaller;
if (installData.InstallerMenuWidget != null)
Ui.LoadWidget(installData.InstallerMenuWidget, Ui.Root, new WidgetArgs());
if (installData.InstallerBackgroundWidget != null)
Ui.LoadWidget(installData.InstallerBackgroundWidget, Ui.Root, new WidgetArgs());
Widgets.Ui.OpenWindow(window, new WidgetArgs());
}

View File

@@ -22,16 +22,16 @@ namespace OpenRA.Mods.RA.Widgets.Logic
public class DownloadPackagesLogic
{
readonly Widget panel;
readonly InstallData installData;
readonly string mirrorListUrl;
readonly ProgressBarWidget progressBar;
readonly LabelWidget statusLabel;
readonly Action afterInstall;
string mirror;
[ObjectCreator.UseCtor]
public DownloadPackagesLogic(Widget widget, Action afterInstall)
public DownloadPackagesLogic(Widget widget, Action afterInstall, string mirrorListUrl)
{
installData = Game.modData.Manifest.ContentInstaller;
this.mirrorListUrl = mirrorListUrl;
this.afterInstall = afterInstall;
panel = widget.Get("INSTALL_DOWNLOAD_PANEL");
@@ -130,7 +130,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
};
// Get the list of mirrors
var updateMirrors = new Download(installData.PackageMirrorList, mirrorsFile, onDownloadProgress, onFetchMirrorsComplete);
var updateMirrors = new Download(mirrorListUrl, mirrorsFile, onDownloadProgress, onFetchMirrorsComplete);
cancelButton.OnClick = () => { updateMirrors.Cancel(); Ui.CloseWindow(); };
retryButton.OnClick = () => { updateMirrors.Cancel(); ShowDownloadDialog(); };
}

View File

@@ -19,11 +19,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
[ObjectCreator.UseCtor]
public InstallLogic(Widget widget, Action continueLoading)
{
var mirrorListUrl = Game.modData.Manifest.ContentInstaller.PackageMirrorList;
var panel = widget.Get("INSTALL_PANEL");
var widgetArgs = new WidgetArgs()
{
{ "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
{ "continueLoading", continueLoading }
{ "continueLoading", continueLoading },
{ "mirrorListUrl", mirrorListUrl },
};
panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>

View File

@@ -44,12 +44,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_BUTTON");
if (downloadButton != null)
{
var installData = Game.modData.Manifest.ContentInstaller;
downloadButton.IsVisible = () => !string.IsNullOrEmpty(installData.MusicPackageMirrorList);
var mirrorListUrl = Game.modData.Manifest.ContentInstaller.MusicPackageMirrorList;
downloadButton.IsVisible = () => !string.IsNullOrEmpty(mirrorListUrl);
downloadButton.OnClick = () =>
{
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs() {
{ "afterInstall", () => Game.InitializeMod(Game.Settings.Game.Mod, null) },
{ "mirrorListUrl", mirrorListUrl },
});
};
}