diff --git a/src/UI/UIManager.cs b/src/UI/UIManager.cs index 9f0c374..13c5df7 100644 --- a/src/UI/UIManager.cs +++ b/src/UI/UIManager.cs @@ -158,6 +158,10 @@ namespace UnityExplorer.UI if (!ShowMenu) return; + // In case the bundle has been unloaded, reload it. + if (!DefaultFont) + LoadBundle(); + // Check forceUnlockMouse toggle if (InputManager.GetKeyDown(ConfigManager.Force_Unlock_Toggle.Value)) CursorUnlocker.Unlock = !CursorUnlocker.Unlock; @@ -454,14 +458,19 @@ namespace UnityExplorer.UI if (bundle == null) { ExplorerCore.LogWarning("Could not load the ExplorerUI Bundle!"); - ConsoleFont = Resources.GetBuiltinResource("Arial.ttf"); - DefaultFont = ConsoleFont; + DefaultFont = ConsoleFont = Resources.GetBuiltinResource("Arial.ttf"); return; } // Bundle loaded + ConsoleFont = bundle.LoadAsset("CONSOLA"); + ConsoleFont.hideFlags = HideFlags.HideAndDontSave; + UnityEngine.Object.DontDestroyOnLoad(ConsoleFont); + DefaultFont = bundle.LoadAsset("arial"); + DefaultFont.hideFlags = HideFlags.HideAndDontSave; + UnityEngine.Object.DontDestroyOnLoad(DefaultFont); BackupShader = bundle.LoadAsset("DefaultUI"); // Fix for games which don't ship with 'UI/Default' shader.