Skip to content

Commit

Permalink
Keep track of progress fraction independently
Browse files Browse the repository at this point in the history
  • Loading branch information
blowfishpro committed Sep 23, 2017
1 parent 7a40730 commit 7e714a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ModuleManager/MMPatchLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public class MMPatchLoader : LoadingSystem
private IBasicLogger logger;

public IPatchProgress progress;
private float progressFraction = 0;

public static MMPatchLoader Instance { get; private set; }

Expand Down Expand Up @@ -101,7 +102,7 @@ public override bool IsReady()
return ready;
}

public override float ProgressFraction() => progress.ProgressFraction;
public override float ProgressFraction() => progressFraction;

public override string ProgressTitle()
{
Expand Down Expand Up @@ -758,12 +759,15 @@ private void LoadCache()
logger.Warning("Parent null for " + parentUrl);
}
}
progressFraction = 1;
logger.Info("Cache Loaded");
}

private void StatusUpdate()
{
status = "ModuleManager: " + progress.PatchedNodeCount + " patch" + (progress.PatchedNodeCount != 1 ? "es" : "") + (useCache ? " loaded from cache" : " applied");
progressFraction = progress.ProgressFraction;


if (progress.ErrorCount > 0)
status += ", found <color=orange>" + progress.ErrorCount + " error" + (progress.ErrorCount != 1 ? "s" : "") + "</color>";
Expand Down

0 comments on commit 7e714a4

Please sign in to comment.