Streamline mod changing after installation

- Don't return to the ModChooser after a successful installation.
 - Don't reload the ModChooser after a cancelled installation.
This commit is contained in:
Pavel Penev
2015-09-08 22:25:05 +03:00
parent 4401e1aa0c
commit 50ea12723c
3 changed files with 10 additions and 20 deletions

View File

@@ -23,17 +23,17 @@ namespace OpenRA.Mods.Common.Widgets.Logic
readonly Widget panel;
readonly ProgressBarWidget progressBar;
readonly LabelWidget statusLabel;
readonly Action continueLoading;
readonly Action afterInstall;
readonly ButtonWidget retryButton, backButton;
readonly Widget installingContainer, insertDiskContainer;
readonly ContentInstaller installData;
[ObjectCreator.UseCtor]
public InstallFromCDLogic(Widget widget, Action continueLoading, string modId)
public InstallFromCDLogic(Widget widget, Action afterInstall, string modId)
{
this.modId = modId;
installData = ModMetadata.AllMods[modId].Content;
this.continueLoading = continueLoading;
this.afterInstall = afterInstall;
panel = widget.Get("INSTALL_FROMCD_PANEL");
progressBar = panel.Get<ProgressBarWidget>("PROGRESS_BAR");
statusLabel = panel.Get<LabelWidget>("STATUS_LABEL");
@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
}
}
continueLoading();
afterInstall();
}) { IsBackground = true }.Start();
}
@@ -198,7 +198,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
statusLabel.GetText = () => "Game assets have been extracted.";
Ui.CloseWindow();
continueLoading();
afterInstall();
});
}
catch (Exception e)