NAK_CVR_Mods/MenuScalePatch/Main.cs
2023-01-03 01:20:05 -06:00

32 lines
No EOL
1.1 KiB
C#

using ABI_RC.Core.InteractionSystem;
using ABI_RC.Core.Player;
using ABI_RC.Core.Savior;
using cohtml;
using HarmonyLib;
using MelonLoader;
using UnityEngine;
using NAK.Melons.MenuScalePatch.Helpers;
namespace NAK.Melons.MenuScalePatch;
public class MenuScalePatch : MelonMod
{
private static MelonPreferences_Category m_categoryMenuScalePatch;
private static MelonPreferences_Entry<bool> m_entryWorldAnchorVRQM;
public override void OnInitializeMelon()
{
m_categoryMenuScalePatch = MelonPreferences.CreateCategory(nameof(MenuScalePatch));
m_entryWorldAnchorVRQM = m_categoryMenuScalePatch.CreateEntry<bool>("World Anchor VR QM", false, description: "Should place QM in World Space while VR.");
foreach (var setting in m_categoryMenuScalePatch.Entries)
{
setting.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings);
}
}
private void UpdateAllSettings()
{
MSP_MenuInfo.WorldAnchorQM = m_entryWorldAnchorVRQM.Value;
}
private void OnUpdateSettings(object arg1, object arg2) => UpdateAllSettings();
}