[AvatarScaleMod] Further improvments. Still needs a lot...

This commit is contained in:
NotAKidoS 2023-09-24 06:15:31 -05:00
parent 553da7edb3
commit ff06c20c01
7 changed files with 153 additions and 393 deletions

View file

@ -1,5 +1,6 @@
using MelonLoader;
using NAK.AvatarScaleMod.AvatarScaling;
using NAK.AvatarScaleMod.Networking;
namespace NAK.AvatarScaleMod;
@ -7,11 +8,16 @@ namespace NAK.AvatarScaleMod;
internal static class ModSettings
{
internal const string SettingsCategory = nameof(AvatarScaleMod);
public static readonly MelonPreferences_Category Category =
MelonPreferences.CreateCategory(nameof(AvatarScaleMod));
public static MelonPreferences_Entry<bool> PersistantHeight;
public static MelonPreferences_Entry<bool> Debug_NetworkInbound;
public static MelonPreferences_Entry<bool> Debug_NetworkOutbound;
// AvatarScaleTool supported scaling settings
public static readonly MelonPreferences_Entry<bool> EntryEnabled =
Category.CreateEntry("AvatarScaleTool Scaling", true, description: "Should there be persistant avatar scaling? This only works properly across supported avatars.");
@ -69,6 +75,11 @@ internal static class ModSettings
PersistantHeight = Category.CreateEntry("Persistant Height", false, description: "Should the avatar height persist between avatar switches?");
PersistantHeight.OnEntryValueChanged.Subscribe(OnPersistantHeightChanged);
Debug_NetworkInbound = Category.CreateEntry("Debug Inbound", false, description: "Log inbound Mod Network height updates.");
Debug_NetworkInbound.OnEntryValueChanged.Subscribe(OnDebugNetworkChanged);
Debug_NetworkOutbound = Category.CreateEntry("Debug Outbound", false, description: "Log outbound Mod Network height updates.");
Debug_NetworkOutbound.OnEntryValueChanged.Subscribe(OnDebugNetworkChanged);
//AvatarScaleManager.UseUniversalScaling = EntryEnabled.Value;
//AvatarScaleGesture.GestureEnabled = EntryUseScaleGesture.Value;
}
@ -77,4 +88,10 @@ internal static class ModSettings
{
AvatarScaleManager.Instance.Setting_PersistantHeight = newValue;
}
private static void OnDebugNetworkChanged(bool oldValue, bool newValue)
{
ModNetwork.Debug_NetworkInbound = Debug_NetworkInbound.Value;
ModNetwork.Debug_NetworkOutbound = Debug_NetworkOutbound.Value;
}
}