From 3cf307a3b86736beb3275742a61130b8f9e12cdb Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 21 Jan 2021 02:14:18 +0100 Subject: [PATCH] Just one more fix and dialog (no patcher, command line) --- GCMM/GCMM.csproj | 2 +- GCMM/MainPatcher.cs | 11 ++++++++++- GCMM/MainUtils.cs | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/GCMM/GCMM.csproj b/GCMM/GCMM.csproj index 4bba088..af4a3b4 100644 --- a/GCMM/GCMM.csproj +++ b/GCMM/GCMM.csproj @@ -6,7 +6,7 @@ true false favicon.ico - 1.3.0 + 1.4.0 NorbiPeti ExMods A mod manager for Gamecraft. It automatically downloads and runs GCIPA and allows the user to install mods. diff --git a/GCMM/MainPatcher.cs b/GCMM/MainPatcher.cs index 5fc8c03..1d9d704 100644 --- a/GCMM/MainPatcher.cs +++ b/GCMM/MainPatcher.cs @@ -82,6 +82,7 @@ namespace GCMM } } var status = CheckIfPatched(); + //bool justDownloadedPatcherSoDontWarnAboutIncompatibility = false; switch (status) { case GameState.NotFound: @@ -91,6 +92,7 @@ namespace GCMM case GameState.NoPatcher: case GameState.OldPatcher: { + EnsureShown(false); if (MessageBox.Show((status == GameState.NoPatcher ? "The patcher (GCIPA) is not found. It's necessary to load the mods." : "There is a patcher update available!" @@ -101,7 +103,14 @@ namespace GCMM return retOpenedWindowShouldStay; } this.status.Text = "Status: Patching..."; - EnsureShown(false); + int C = 0; + while (gcipa.DownloadURL == null && C < 20) + await Task.Delay(500); //The EnsureShown() call should download info about GCIPA + if (gcipa.DownloadURL == null) + { + MessageBox.Show("Could not get information about GCIPA in time. Please run GCMM manually."); + return retOpenedWindowShouldStay; + } using (WebClient client = GetClient()) { string url = gcipa.DownloadURL; diff --git a/GCMM/MainUtils.cs b/GCMM/MainUtils.cs index 27c83eb..0270484 100644 --- a/GCMM/MainUtils.cs +++ b/GCMM/MainUtils.cs @@ -203,13 +203,13 @@ namespace GCMM Process.Start("steam://run/1078000/"); else Process.Start("xdg-open", "steam://run/1078000/"); + EndWork(false); + tcs.SetResult(null); }; if (InvokeRequired) Invoke(act); else act(); - EndWork(false); - tcs.SetResult(null); }, tcs.Task); }