Skip to content

Commit

Permalink
Remove blocking option
Browse files Browse the repository at this point in the history
It's no longer used
  • Loading branch information
blowfishpro committed Aug 29, 2017
1 parent 76c998c commit 55fc4e6
Showing 1 changed file with 14 additions and 33 deletions.
47 changes: 14 additions & 33 deletions MMPatchLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,6 @@ public override string ProgressTitle()
}

public override void StartLoad()
{
StartLoad(false);
}

public void Update()
{
if (progress.AppliedPatchCount > 0 && HighLogic.LoadedScene == GameScenes.LOADING)
StatusUpdate();
}

public void StartLoad(bool blocking)
{
patchSw.Reset();
patchSw.Start();
Expand All @@ -134,7 +123,13 @@ public void StartLoad(bool blocking)
// DB check used to track the now fixed TextureReplacer corruption
//checkValues();

StartCoroutine(ProcessPatch(blocking), blocking);
StartCoroutine(ProcessPatch());
}

public void Update()
{
if (progress.AppliedPatchCount > 0 && HighLogic.LoadedScene == GameScenes.LOADING)
StatusUpdate();
}

public static void addPostPatchCallback(ModuleManagerPostPatchCallback callback)
Expand Down Expand Up @@ -236,21 +231,7 @@ private void PrePatchInit()
#endregion List of mods
}


Coroutine StartCoroutine(IEnumerator enumerator, bool blocking)
{
if (blocking)
{
while (enumerator.MoveNext()) { }
return null;
}
else
{
return StartCoroutine(enumerator);
}
}

private IEnumerator ProcessPatch(bool blocking)
private IEnumerator ProcessPatch()
{
status = "Checking Cache";
logger.Info(status);
Expand Down Expand Up @@ -307,21 +288,21 @@ private IEnumerator ProcessPatch(bool blocking)
yield return null;

// :First node
yield return StartCoroutine(ApplyPatch(":FIRST"), blocking);
yield return StartCoroutine(ApplyPatch(":FIRST"));

// any node without a :pass
yield return StartCoroutine(ApplyPatch(":LEGACY"), blocking);
yield return StartCoroutine(ApplyPatch(":LEGACY"));

foreach (string mod in mods)
{
string upperModName = mod.ToUpper();
yield return StartCoroutine(ApplyPatch(":BEFORE[" + upperModName + "]"), blocking);
yield return StartCoroutine(ApplyPatch(":FOR[" + upperModName + "]"), blocking);
yield return StartCoroutine(ApplyPatch(":AFTER[" + upperModName + "]"), blocking);
yield return StartCoroutine(ApplyPatch(":BEFORE[" + upperModName + "]"));
yield return StartCoroutine(ApplyPatch(":FOR[" + upperModName + "]"));
yield return StartCoroutine(ApplyPatch(":AFTER[" + upperModName + "]"));
}

// :Final node
yield return StartCoroutine(ApplyPatch(":FINAL"), blocking);
yield return StartCoroutine(ApplyPatch(":FINAL"));

PurgeUnused();

Expand Down

0 comments on commit 55fc4e6

Please sign in to comment.