Skip to content

Commit e32debd

Browse files
committed
Add an error count counter
1 parent adfa158 commit e32debd

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/PatchManager.Core/Assets/PatchingManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ internal static class PatchingManager
2828
private static Dictionary<string, List<(string name, string text)>> _createdAssets = new();
2929

3030
internal static int TotalPatchCount;
31+
internal static int TotalErrorCount;
32+
3133
public static void GenerateUniverse(HashSet<string> singleFileModIds)
3234
{
3335
var loadedPlugins = PluginList.AllEnabledAndActivePlugins.Select(x => x.Guid).ToList();
@@ -87,6 +89,7 @@ private static string PatchJson(string label, string assetName, string text)
8789
}
8890
catch (Exception e)
8991
{
92+
TotalErrorCount += 1;
9093
Console.WriteLine($"Patch of {label}:{assetName} errored due to: {e}");
9194
text = backup;
9295
}

src/PatchManager.Core/Patches/Runtime/LoadingBarPatch.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ public static bool ShuffleLoadingTip(ref LoadingBar __instance)
1717
if (!InjectPatchManagerTips)
1818
return true;
1919
__instance.tipsText.text = $"Patch Manager: {PatchingManager.TotalPatchCount} patches";
20+
if (PatchingManager.TotalErrorCount > 0)
21+
__instance.tipsText.text += $", {PatchingManager.TotalErrorCount} errors";
2022

2123
return false;
2224
}

0 commit comments

Comments
 (0)