mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
Initial Upload
it working and not nuking fps... wow
This commit is contained in:
parent
cb280bdf00
commit
29060f71c1
23 changed files with 1905 additions and 0 deletions
46
CVRGizmos/Main.cs
Normal file
46
CVRGizmos/Main.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using MelonLoader;
|
||||
using System.Collections;
|
||||
|
||||
namespace CVRGizmos;
|
||||
|
||||
public class CVRGizmos : MelonMod
|
||||
{
|
||||
|
||||
private static MelonPreferences_Category m_categoryCVRGizmos;
|
||||
private static MelonPreferences_Entry<bool> m_entryCVRGizmosEnabled;
|
||||
private static MelonPreferences_Entry<bool> m_entryCVRGizmosLocalOnly;
|
||||
|
||||
public override void OnApplicationStart()
|
||||
{
|
||||
m_categoryCVRGizmos = MelonPreferences.CreateCategory(nameof(CVRGizmos));
|
||||
m_entryCVRGizmosEnabled = m_categoryCVRGizmos.CreateEntry<bool>("Enabled", false);
|
||||
m_entryCVRGizmosLocalOnly = m_categoryCVRGizmos.CreateEntry<bool>("Local Only", false);
|
||||
m_entryCVRGizmosEnabled.Value = false;
|
||||
|
||||
m_categoryCVRGizmos.SaveToFile(false);
|
||||
m_entryCVRGizmosEnabled.OnValueChangedUntyped += CVRGizmosEnabled;
|
||||
m_entryCVRGizmosLocalOnly.OnValueChangedUntyped += CVRGizmosLocalOnly;
|
||||
|
||||
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
|
||||
}
|
||||
|
||||
IEnumerator WaitForLocalPlayer()
|
||||
{
|
||||
while (PlayerSetup.Instance == null)
|
||||
yield return null;
|
||||
|
||||
PlayerSetup.Instance.gameObject.AddComponent<CVRGizmoManager>();
|
||||
}
|
||||
|
||||
public void CVRGizmosEnabled()
|
||||
{
|
||||
CVRGizmoManager.Instance.EnableGizmos(m_entryCVRGizmosEnabled.Value);
|
||||
}
|
||||
|
||||
public void CVRGizmosLocalOnly()
|
||||
{
|
||||
CVRGizmoManager.Instance.g_localOnly = m_entryCVRGizmosLocalOnly.Value;
|
||||
CVRGizmoManager.Instance.RefreshGizmos();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue