This commit is contained in:
NotAKidoS 2023-04-25 15:04:09 -05:00
parent dc577c3a2f
commit a468487850
24 changed files with 484 additions and 121 deletions

View file

@ -1,35 +1,29 @@
using MelonLoader;
using NAK.Melons.MenuScalePatch.Helpers;
namespace NAK.Melons.MenuScalePatch;
namespace NAK.MenuScalePatch;
public class MenuScalePatch : MelonMod
{
internal static MelonLogger.Instance Logger;
internal static MelonPreferences_Category m_categoryMenuScalePatch;
internal static MelonPreferences_Entry<bool>
//m_entryWorldAnchorVRQM,
m_entryUseIndependentHeadTurn,
m_entryPlayerAnchorMenus;
internal static MelonPreferences_Category Category = MelonPreferences.CreateCategory(nameof(MenuScalePatch));
internal static MelonPreferences_Entry<bool> EntryUseIndependentHeadTurn =
Category.CreateEntry<bool>("Use Independent Head Turn", true, description: "Should you be able to use independent head turn in a menu while in Desktop?");
internal static MelonPreferences_Entry<bool> EntryPlayerAnchorMenus =
Category.CreateEntry<bool>("Player Anchor Menus", true, description: "Should the menus be anchored to & constantly follow the player?");
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.");
m_entryUseIndependentHeadTurn = m_categoryMenuScalePatch.CreateEntry<bool>("Use Independent Head Turn", true, description: "Should you be able to use independent head turn in a menu while in Desktop?");
m_entryPlayerAnchorMenus = m_categoryMenuScalePatch.CreateEntry<bool>("Player Anchor Menus", true, description: "Should the menus be anchored to & constantly follow the player?");
foreach (var setting in m_categoryMenuScalePatch.Entries)
foreach (var setting in Category.Entries)
{
setting.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings);
}
}
Logger = LoggerInstance;
}
internal static void UpdateAllSettings()
internal static void UpdateSettings()
{
//MSP_MenuInfo.WorldAnchorQM = m_entryWorldAnchorVRQM.Value;
MSP_MenuInfo.UseIndependentHeadTurn = m_entryUseIndependentHeadTurn.Value;
MSP_MenuInfo.PlayerAnchorMenus = m_entryPlayerAnchorMenus.Value;
Helpers.MSP_MenuInfo.UseIndependentHeadTurn = EntryUseIndependentHeadTurn.Value;
Helpers.MSP_MenuInfo.PlayerAnchorMenus = EntryPlayerAnchorMenus.Value;
}
private static void OnUpdateSettings(object arg1, object arg2) => UpdateAllSettings();
private static void OnUpdateSettings(object arg1, object arg2) => UpdateSettings();
}