Skip to content

Commit 29e8f6b

Browse files
committed
Another fix, this time on the ReloadingDatabase dialogbox.
1 parent 2e48a7d commit 29e8f6b

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

Source/ModuleManager/GUI/ReloadingDatabase.12.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ namespace ModuleManager.GUI
1414
#if KSP12
1515
public class ReloadingDatabaseDialog
1616
{
17-
internal static ReloadingDatabaseDialog Show(ModuleManager parent, bool startedReload)
17+
internal static ReloadingDatabaseDialog Show(ModuleManager parent)
1818
{
19-
return new ReloadingDatabaseDialog(parent, startedReload);
19+
return new ReloadingDatabaseDialog(parent);
2020
}
2121

2222
internal Menu Dismiss()
@@ -28,7 +28,7 @@ internal Menu Dismiss()
2828

2929
private ModuleManager parent;
3030
private PopupDialog instance;
31-
private ReloadingDatabaseDialog(ModuleManager parent, bool startedReload)
31+
private ReloadingDatabaseDialog(ModuleManager parent)
3232
{
3333
this.parent = parent;
3434
}

Source/ModuleManager/GUI/ReloadingDatabase.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ namespace ModuleManager.GUI
1414
#if !KSP12
1515
public class ReloadingDatabaseDialog
1616
{
17-
internal static ReloadingDatabaseDialog Show(ModuleManager parent, bool startedReload)
17+
internal static ReloadingDatabaseDialog Show(ModuleManager parent)
1818
{
19-
return new ReloadingDatabaseDialog(parent, startedReload);
19+
return new ReloadingDatabaseDialog(parent);
2020
}
2121

2222
internal Menu Dismiss()
@@ -28,8 +28,9 @@ internal Menu Dismiss()
2828

2929
private ModuleManager parent;
3030
private PopupDialog instance;
31-
private ReloadingDatabaseDialog(ModuleManager parent, bool startedReload)
31+
private ReloadingDatabaseDialog(ModuleManager parent)
3232
{
33+
bool startedReload = false;
3334
this.parent = parent;
3435

3536
UISkinDef skinDef = HighLogic.UISkin;
@@ -73,6 +74,7 @@ private ReloadingDatabaseDialog(ModuleManager parent, bool startedReload)
7374
if (!startedReload)
7475
{
7576
progressFraction = 0f;
77+
startedReload = true;
7678
}
7779
else if (!GameDatabase.Instance.IsReady() || !PostPatchLoader.Instance.IsReady())
7880
{

Source/ModuleManager/ModuleManager.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,21 +277,16 @@ public static bool IsABadIdea()
277277
internal IEnumerator DataBaseReloadWithMM(bool dump = false)
278278
{
279279
PerformanceMetrics.Instance.Start();
280+
GUI.ReloadingDatabaseDialog reloadingDialog = GUI.ReloadingDatabaseDialog.Show(this);
280281
try
281282
{
282283
patchRunner = new MMPatchRunner(ModLogger.Instance);
283284

284-
bool startedReload = false;
285-
286-
GUI.ReloadingDatabaseDialog reloadingDialog = GUI.ReloadingDatabaseDialog.Show(this, startedReload);
287-
288285
yield return null;
289286

290287
GameDatabase.Instance.Recompile = true;
291288
GameDatabase.Instance.StartLoad();
292289

293-
startedReload = true;
294-
295290
yield return null;
296291
StartCoroutine(patchRunner.Run());
297292

@@ -325,12 +320,11 @@ internal IEnumerator DataBaseReloadWithMM(bool dump = false)
325320
// ResearchAndDevelopment.Instance.OnLoad(scenario);
326321
// }
327322
//}
328-
329-
reloadingDialog.Dismiss();
330323
}
331324
finally
332325
{
333326
PerformanceMetrics.Instance.Stop();
327+
reloadingDialog.Dismiss();
334328
Log("Total reloading Time = " + PerformanceMetrics.Instance.ElapsedTimeInSecs.ToString("F3") + "s");
335329
PerformanceMetrics.Instance.Destroy();
336330
}

0 commit comments

Comments
 (0)