diff --git a/OpenRA.Mods.D2k/D2kLoadScreen.cs b/OpenRA.Mods.D2k/D2kLoadScreen.cs index 9bd9c709da..146d1e250e 100644 --- a/OpenRA.Mods.D2k/D2kLoadScreen.cs +++ b/OpenRA.Mods.D2k/D2kLoadScreen.cs @@ -77,6 +77,7 @@ namespace OpenRA.Mods.D2k { var args = new WidgetArgs() { + { "continueLoading", () => TestAndContinue() }, { "installData", Info } }; Ui.OpenWindow(Info["InstallerMenuWidget"], args); diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kDownloadPackagesLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kDownloadPackagesLogic.cs index c7bb742514..ff982effce 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kDownloadPackagesLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kDownloadPackagesLogic.cs @@ -25,13 +25,13 @@ namespace OpenRA.Mods.D2k.Widgets.Logic Dictionary installData; ProgressBarWidget progressBar; LabelWidget statusLabel; - //Action afterInstall; + Action afterInstall; [ObjectCreator.UseCtor] public D2kDownloadPackagesLogic(Widget widget, Dictionary installData, Action afterInstall) { this.installData = installData; - //this.afterInstall = afterInstall; + this.afterInstall = afterInstall; panel = widget.Get("INSTALL_DOWNLOAD_PANEL"); progressBar = panel.Get("PROGRESS_BAR"); @@ -97,7 +97,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic Game.RunAfterTick(() => { Ui.CloseWindow(); - //afterInstall(); + afterInstall(); }); } }; diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs index c96d3659d9..7d7e1e05a4 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kExtractGameFilesLogic.cs @@ -25,11 +25,12 @@ namespace OpenRA.Mods.D2k.Widgets.Logic Widget panel; ProgressBarWidget progressBar; LabelWidget statusLabel; + Action continueLoading; ButtonWidget retryButton, backButton; Widget extractingContainer, copyFilesContainer; [ObjectCreator.UseCtor] - public D2kExtractGameFilesLogic(Widget widget) + public D2kExtractGameFilesLogic(Widget widget, Action continueLoading) { panel = widget.Get("EXTRACT_GAMEFILES_PANEL"); progressBar = panel.Get("PROGRESS_BAR"); @@ -43,7 +44,9 @@ namespace OpenRA.Mods.D2k.Widgets.Logic extractingContainer = panel.Get("EXTRACTING"); copyFilesContainer = panel.Get("COPY_FILES"); + Extract(); + this.continueLoading = continueLoading; } void Extract() @@ -536,6 +539,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic progressBar.Percentage = 100; statusLabel.GetText = () => "Extraction and conversion complete."; backButton.IsDisabled = () => false; + continueLoading(); }); } catch diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs index ee1b60f32b..4ec19a3eaf 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallFromCDLogic.cs @@ -24,11 +24,12 @@ namespace OpenRA.Mods.D2k.Widgets.Logic Widget panel; ProgressBarWidget progressBar; LabelWidget statusLabel; + Action continueLoading; ButtonWidget retryButton, backButton; Widget installingContainer, insertDiskContainer; [ObjectCreator.UseCtor] - public D2kInstallFromCDLogic(Widget widget) + public D2kInstallFromCDLogic(Widget widget, Action continueLoading) { panel = widget.Get("INSTALL_FROMCD_PANEL"); progressBar = panel.Get("PROGRESS_BAR"); @@ -42,7 +43,9 @@ namespace OpenRA.Mods.D2k.Widgets.Logic installingContainer = panel.Get("INSTALLING"); insertDiskContainer = panel.Get("INSERT_DISK"); + CheckForDisk(); + this.continueLoading = continueLoading; } public static bool IsValidDisk(string diskRoot) @@ -114,6 +117,7 @@ namespace OpenRA.Mods.D2k.Widgets.Logic { statusLabel.GetText = () => "Music has been copied."; backButton.IsDisabled = () => false; + continueLoading(); }); } catch diff --git a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs index b668c5824e..7f620676ba 100644 --- a/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs +++ b/OpenRA.Mods.D2k/Widgets/Logic/D2kInstallLogic.cs @@ -17,13 +17,14 @@ namespace OpenRA.Mods.D2k.Widgets.Logic public class D2kInstallLogic { [ObjectCreator.UseCtor] - public D2kInstallLogic(Widget widget, Dictionary installData) + public D2kInstallLogic(Widget widget, Dictionary installData, Action continueLoading) { var panel = widget.Get("INSTALL_PANEL"); var args = new WidgetArgs() { - { "afterInstall", () => { Ui.CloseWindow(); Game.Exit(); } }, - { "installData", installData } + { "afterInstall", () => { Ui.CloseWindow(); continueLoading(); } }, + { "installData", installData }, + { "continueLoading", continueLoading } }; panel.Get("DOWNLOAD_BUTTON").OnClick = () => diff --git a/mods/d2k/TODO b/mods/d2k/TODO index 24beb575fb..f87ffe6e06 100644 --- a/mods/d2k/TODO +++ b/mods/d2k/TODO @@ -35,5 +35,4 @@ # infantry-only areas (Rough) do not show the dark-green mouse cursor # put TilesetBuilder.Export into OpenRA.Utility to call the functions directly when extracting game-files (instead of opening a GUI) # group number metrics are off, should use DrawText not pips SHP -# AcceptSmudges should be a string and not a boolean or array to seperate SmudgeTypes -# start the game after getting the game-file \ No newline at end of file +# AcceptSmudges should be a string and not a boolean or array to seperate SmudgeTypes \ No newline at end of file