NAK_CVR_Mods/AvatarScale/ModSettings.cs
2023-06-24 01:11:38 -05:00

39 lines
No EOL
1.3 KiB
C#

using MelonLoader;
namespace NAK.AvatarScaleMod;
// i like this
static class ModSettings
{
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(AvatarScaleMod));
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("Enabled", true, description: "Toggle AvatarScaleMod entirely for Local user. Kinda.");
public static readonly MelonPreferences_Entry<bool> EntryUseScaleGesture =
Category.CreateEntry("Scale Gesture", false, description: "Use two fists to scale yourself easily.");
static ModSettings()
{
EntryEnabled.OnEntryValueChanged.Subscribe(OnEntryEnabledChanged);
EntryUseScaleGesture.OnEntryValueChanged.Subscribe(OnEntryUseScaleGestureChanged);
}
public static void InitializeModSettings()
{
AvatarScaleManager.GlobalEnabled = EntryEnabled.Value;
AvatarScaleGesture.GestureEnabled = EntryUseScaleGesture.Value;
}
static void OnEntryEnabledChanged(bool oldValue, bool newValue)
{
AvatarScaleManager.GlobalEnabled = newValue;
}
static void OnEntryUseScaleGestureChanged(bool oldValue, bool newValue)
{
AvatarScaleGesture.GestureEnabled = newValue;
}
}