Skip to content

Commit

Permalink
Check if headless before setting LoadProgressIndicator
Browse files Browse the repository at this point in the history
  • Loading branch information
XDelta committed Oct 27, 2023
1 parent c82d49a commit df561d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions ResoniteModLoader/LoadProgressIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ResoniteModLoader/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace ResoniteModLoader;
/// Contains the actual mod loader.
/// </summary>
public class ModLoader {
internal const string VERSION_CONSTANT = "2.5.0";
internal const string VERSION_CONSTANT = "2.5.1";
/// <summary>
/// ResoniteModLoader's version
/// </summary>
Expand Down

0 comments on commit df561d7

Please sign in to comment.