diff --git a/src/PatchManager.Core/Assets/PatchingManager.cs b/src/PatchManager.Core/Assets/PatchingManager.cs index 509ebc3..2939f35 100644 --- a/src/PatchManager.Core/Assets/PatchingManager.cs +++ b/src/PatchManager.Core/Assets/PatchingManager.cs @@ -28,6 +28,8 @@ internal static class PatchingManager private static Dictionary> _createdAssets = new(); internal static int TotalPatchCount; + internal static int TotalErrorCount; + public static void GenerateUniverse(HashSet singleFileModIds) { var loadedPlugins = PluginList.AllEnabledAndActivePlugins.Select(x => x.Guid).ToList(); @@ -87,6 +89,7 @@ private static string PatchJson(string label, string assetName, string text) } catch (Exception e) { + TotalErrorCount += 1; Console.WriteLine($"Patch of {label}:{assetName} errored due to: {e}"); text = backup; } diff --git a/src/PatchManager.Core/Patches/Runtime/LoadingBarPatch.cs b/src/PatchManager.Core/Patches/Runtime/LoadingBarPatch.cs index 47c6a98..78a6b9e 100644 --- a/src/PatchManager.Core/Patches/Runtime/LoadingBarPatch.cs +++ b/src/PatchManager.Core/Patches/Runtime/LoadingBarPatch.cs @@ -17,6 +17,8 @@ public static bool ShuffleLoadingTip(ref LoadingBar __instance) if (!InjectPatchManagerTips) return true; __instance.tipsText.text = $"Patch Manager: {PatchingManager.TotalPatchCount} patches"; + if (PatchingManager.TotalErrorCount > 0) + __instance.tipsText.text += $", {PatchingManager.TotalErrorCount} errors"; return false; }