mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Menu integration
This commit is contained in:
parent
a417b41be7
commit
b1c3c7f410
11 changed files with 223 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.UI;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -59,6 +60,7 @@ namespace ml_lme
|
|||
new HarmonyLib.HarmonyMethod(typeof(LeapMotionExtension).GetMethod(nameof(OnAvatarClear_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic))
|
||||
);
|
||||
|
||||
MelonLoader.MelonCoroutines.Start(WaitForMainMenuView());
|
||||
MelonLoader.MelonCoroutines.Start(CreateTrackingObjects());
|
||||
}
|
||||
|
||||
|
@ -105,6 +107,21 @@ namespace ml_lme
|
|||
OnSettingsHeadAttachChange(); // Includes offsets and parenting
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator WaitForMainMenuView()
|
||||
{
|
||||
while(ViewManager.Instance == null)
|
||||
yield return null;
|
||||
while(ViewManager.Instance.gameMenuView == null)
|
||||
yield return null;
|
||||
while(ViewManager.Instance.gameMenuView.Listener == null)
|
||||
yield return null;
|
||||
|
||||
ViewManager.Instance.gameMenuView.Listener.FinishLoad += (_) =>
|
||||
{
|
||||
ViewManager.Instance.gameMenuView.View.ExecuteScript(Scripts.GetEmbeddedScript("menu.js"));
|
||||
};
|
||||
}
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if(Settings.Enabled)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue