@pchote breaks all the things
This commit is contained in:
@@ -443,8 +443,8 @@ namespace OpenRA
|
|||||||
if (!string.IsNullOrEmpty(window))
|
if (!string.IsNullOrEmpty(window))
|
||||||
{
|
{
|
||||||
var installData = modData.Manifest.ContentInstaller;
|
var installData = modData.Manifest.ContentInstaller;
|
||||||
if (installData.InstallerMenuWidget != null)
|
if (installData.InstallerBackgroundWidget != null)
|
||||||
Ui.LoadWidget(installData.InstallerMenuWidget, Ui.Root, new WidgetArgs());
|
Ui.LoadWidget(installData.InstallerBackgroundWidget, Ui.Root, new WidgetArgs());
|
||||||
|
|
||||||
Widgets.Ui.OpenWindow(window, new WidgetArgs());
|
Widgets.Ui.OpenWindow(window, new WidgetArgs());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,16 +22,16 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
public class DownloadPackagesLogic
|
public class DownloadPackagesLogic
|
||||||
{
|
{
|
||||||
readonly Widget panel;
|
readonly Widget panel;
|
||||||
readonly InstallData installData;
|
readonly string mirrorListUrl;
|
||||||
readonly ProgressBarWidget progressBar;
|
readonly ProgressBarWidget progressBar;
|
||||||
readonly LabelWidget statusLabel;
|
readonly LabelWidget statusLabel;
|
||||||
readonly Action afterInstall;
|
readonly Action afterInstall;
|
||||||
string mirror;
|
string mirror;
|
||||||
|
|
||||||
[ObjectCreator.UseCtor]
|
[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;
|
this.afterInstall = afterInstall;
|
||||||
|
|
||||||
panel = widget.Get("INSTALL_DOWNLOAD_PANEL");
|
panel = widget.Get("INSTALL_DOWNLOAD_PANEL");
|
||||||
@@ -130,7 +130,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get the list of mirrors
|
// 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(); };
|
cancelButton.OnClick = () => { updateMirrors.Cancel(); Ui.CloseWindow(); };
|
||||||
retryButton.OnClick = () => { updateMirrors.Cancel(); ShowDownloadDialog(); };
|
retryButton.OnClick = () => { updateMirrors.Cancel(); ShowDownloadDialog(); };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,11 +19,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
[ObjectCreator.UseCtor]
|
[ObjectCreator.UseCtor]
|
||||||
public InstallLogic(Widget widget, Action continueLoading)
|
public InstallLogic(Widget widget, Action continueLoading)
|
||||||
{
|
{
|
||||||
|
var mirrorListUrl = Game.modData.Manifest.ContentInstaller.PackageMirrorList;
|
||||||
var panel = widget.Get("INSTALL_PANEL");
|
var panel = widget.Get("INSTALL_PANEL");
|
||||||
var widgetArgs = new WidgetArgs()
|
var widgetArgs = new WidgetArgs()
|
||||||
{
|
{
|
||||||
{ "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
|
{ "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } },
|
||||||
{ "continueLoading", continueLoading }
|
{ "continueLoading", continueLoading },
|
||||||
|
{ "mirrorListUrl", mirrorListUrl },
|
||||||
};
|
};
|
||||||
|
|
||||||
panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
|
panel.Get<ButtonWidget>("DOWNLOAD_BUTTON").OnClick = () =>
|
||||||
|
|||||||
@@ -44,12 +44,13 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_BUTTON");
|
var downloadButton = installMusicContainer.GetOrNull<ButtonWidget>("DOWNLOAD_BUTTON");
|
||||||
if (downloadButton != null)
|
if (downloadButton != null)
|
||||||
{
|
{
|
||||||
var installData = Game.modData.Manifest.ContentInstaller;
|
var mirrorListUrl = Game.modData.Manifest.ContentInstaller.MusicPackageMirrorList;
|
||||||
downloadButton.IsVisible = () => !string.IsNullOrEmpty(installData.MusicPackageMirrorList);
|
downloadButton.IsVisible = () => !string.IsNullOrEmpty(mirrorListUrl);
|
||||||
downloadButton.OnClick = () =>
|
downloadButton.OnClick = () =>
|
||||||
{
|
{
|
||||||
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs() {
|
Ui.OpenWindow("INSTALL_DOWNLOAD_PANEL", new WidgetArgs() {
|
||||||
{ "afterInstall", () => Game.InitializeMod(Game.Settings.Game.Mod, null) },
|
{ "afterInstall", () => Game.InitializeMod(Game.Settings.Game.Mod, null) },
|
||||||
|
{ "mirrorListUrl", mirrorListUrl },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user