From df561d7cbdc72be1a02dd16757abd167a5187569 Mon Sep 17 00:00:00 2001 From: Delta Date: Fri, 27 Oct 2023 15:01:01 -0700 Subject: [PATCH] Check if headless before setting LoadProgressIndicator --- ResoniteModLoader/LoadProgressIndicator.cs | 7 +++++-- ResoniteModLoader/ModLoader.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ResoniteModLoader/LoadProgressIndicator.cs b/ResoniteModLoader/LoadProgressIndicator.cs index 00505c9..af8ecc2 100644 --- a/ResoniteModLoader/LoadProgressIndicator.cs +++ b/ResoniteModLoader/LoadProgressIndicator.cs @@ -23,11 +23,14 @@ private static FieldInfo? ShowSubphase { } } + private static bool isHeadless => Type.GetType("FrooxEngine.Headless.HeadlessCommands, Resonite") != null; // Returned true means success, false means something went wrong. internal static bool SetCustom(string text) { if (ModLoaderConfiguration.Get().HideVisuals) { return true; } - if (ShowSubphase != null) { - ShowSubphase.SetValue(Engine.Current.InitProgress, text); + if (!isHeadless) { + if (ShowSubphase != null) { + ShowSubphase.SetValue(Engine.Current.InitProgress, text); + } return true; } return false; diff --git a/ResoniteModLoader/ModLoader.cs b/ResoniteModLoader/ModLoader.cs index 6e9746e..aa73ecb 100644 --- a/ResoniteModLoader/ModLoader.cs +++ b/ResoniteModLoader/ModLoader.cs @@ -6,7 +6,7 @@ namespace ResoniteModLoader; /// Contains the actual mod loader. /// public class ModLoader { - internal const string VERSION_CONSTANT = "2.5.0"; + internal const string VERSION_CONSTANT = "2.5.1"; /// /// ResoniteModLoader's version ///