Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions HauntedModMenu/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,22 @@ public class HauntedModMenuPlugin : BaseUnityPlugin
private bool inRoom;
private GameObject menuObject = null;

private void Awake()
private void Start()
{
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HauntedModMenu.Resources.font");
if (stream == null)
return;
// usage of Awake() now locks the game up on boot so we need this to be in Start now :(
var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HauntedModMenu.Resources.font");
if (stream == null)
return;

var fontBundle = AssetBundle.LoadFromStream(stream);
if (fontBundle == null)
return;
var fontBundle = AssetBundle.LoadFromStream(stream);
if (fontBundle == null)
return;

Utils.RefCache.CustomFont = fontBundle.LoadAsset<Font>("ShortBaby");
Utils.RefCache.CustomFont = fontBundle.LoadAsset<Font>("ShortBaby");

fontBundle.Unload(false);
}
fontBundle.Unload(false);

private void Start()
{
foreach(BepInEx.PluginInfo plugin in Chainloader.PluginInfos.Values) {
foreach (BepInEx.PluginInfo plugin in Chainloader.PluginInfos.Values) {

BaseUnityPlugin modPlugin = plugin.Instance;
Type type = modPlugin.GetType();
Expand Down