Move many mods to Deprecated folder, fix spelling

This commit is contained in:
NotAKidoS 2025-04-03 02:57:35 -05:00
parent 5e822cec8d
commit 0042590aa6
539 changed files with 7475 additions and 3120 deletions

View file

@ -211,7 +211,7 @@ public class AvatarScaleManager : MonoBehaviour
public float GetHeight() public float GetHeight()
{ {
if (_localAvatarScaler == null) if (_localAvatarScaler == null)
return PlayerAvatarPoint.defaultAvatarHeight; return PlayerAvatarPoint.DefaultAvatarHeight;
if (!_localAvatarScaler.IsForcingHeight()) if (!_localAvatarScaler.IsForcingHeight())
return PlayerSetup.Instance.GetAvatarHeight(); return PlayerSetup.Instance.GetAvatarHeight();
@ -222,7 +222,7 @@ public class AvatarScaleManager : MonoBehaviour
public float GetAnimationClipHeight() public float GetAnimationClipHeight()
{ {
if (_localAvatarScaler == null) if (_localAvatarScaler == null)
return PlayerAvatarPoint.defaultAvatarHeight; return PlayerAvatarPoint.DefaultAvatarHeight;
if (!_localAvatarScaler.IsForcingHeight()) if (!_localAvatarScaler.IsForcingHeight())
return PlayerSetup.Instance.GetAvatarHeight(); return PlayerSetup.Instance.GetAvatarHeight();

View file

@ -1,4 +1,5 @@
using ABI_RC.Core.Player; using ABI_RC.Core;
using ABI_RC.Core.Player;
using ABI_RC.Core.UI; using ABI_RC.Core.UI;
using NAK.AvatarScaleMod.AvatarScaling; using NAK.AvatarScaleMod.AvatarScaling;
using UnityEngine; using UnityEngine;
@ -72,7 +73,7 @@ public class LocalScaler : BaseScaler
} }
// animation scale changed, record it! // animation scale changed, record it!
Vector3 scaleDifference = PlayerSetup.DivideVectors(localScale - _initialScale, _initialScale); Vector3 scaleDifference = CVRTools.DivideVectors(localScale - _initialScale, _initialScale);
_animatedScaleFactor = scaleDifference.y; _animatedScaleFactor = scaleDifference.y;
_animatedHeight = (_initialHeight * _animatedScaleFactor) + _initialHeight; _animatedHeight = (_initialHeight * _animatedScaleFactor) + _initialHeight;
_animatedScale = localScale; _animatedScale = localScale;

View file

@ -3,32 +3,32 @@ using BTKUILib;
using BTKUILib.UIObjects; using BTKUILib.UIObjects;
using NAK.AvatarScaleMod.AvatarScaling; using NAK.AvatarScaleMod.AvatarScaling;
namespace NAK.AvatarScaleMod.Integrations namespace NAK.AvatarScaleMod.Integrations;
{
public static partial class BtkUiAddon
{
private static Page _asmRootPage;
private static string _rootPageElementID;
public static void Initialize() public static partial class BtkUiAddon
{ {
private static Page _asmRootPage;
private static string _rootPageElementID;
public static void Initialize()
{
Prepare_Icons(); Prepare_Icons();
Setup_AvatarScaleModTab(); Setup_AvatarScaleModTab();
Setup_PlayerSelectPage(); Setup_PlayerSelectPage();
} }
#region Initialization #region Initialization
private static void Prepare_Icons() private static void Prepare_Icons()
{ {
QuickMenuAPI.PrepareIcon(ModSettings.ModName, "ASM_Icon_AvatarHeightConfig", QuickMenuAPI.PrepareIcon(ModSettings.ModName, "ASM_Icon_AvatarHeightConfig",
GetIconStream("ASM_Icon_AvatarHeightConfig.png")); GetIconStream("ASM_Icon_AvatarHeightConfig.png"));
QuickMenuAPI.PrepareIcon(ModSettings.ModName, "ASM_Icon_AvatarHeightCopy", QuickMenuAPI.PrepareIcon(ModSettings.ModName, "ASM_Icon_AvatarHeightCopy",
GetIconStream("ASM_Icon_AvatarHeightCopy.png")); GetIconStream("ASM_Icon_AvatarHeightCopy.png"));
} }
private static void Setup_AvatarScaleModTab() private static void Setup_AvatarScaleModTab()
{ {
_asmRootPage = new Page(ModSettings.ModName, ModSettings.ASM_SettingsCategory, true, "ASM_Icon_AvatarHeightConfig") _asmRootPage = new Page(ModSettings.ModName, ModSettings.ASM_SettingsCategory, true, "ASM_Icon_AvatarHeightConfig")
{ {
MenuTitle = ModSettings.ASM_SettingsCategory, MenuTitle = ModSettings.ASM_SettingsCategory,
@ -54,18 +54,18 @@ namespace NAK.AvatarScaleMod.Integrations
Setup_DebugOptionsCategory(_asmRootPage); Setup_DebugOptionsCategory(_asmRootPage);
} }
#endregion #endregion
#region Player Count Display #region Player Count Display
private static void OnWorldLeave() private static void OnWorldLeave()
=> UpdatePlayerCountDisplay(); => UpdatePlayerCountDisplay();
private static void OnUserJoinLeave(CVRPlayerEntity _) private static void OnUserJoinLeave(CVRPlayerEntity _)
=> UpdatePlayerCountDisplay(); => UpdatePlayerCountDisplay();
private static void UpdatePlayerCountDisplay() private static void UpdatePlayerCountDisplay()
{ {
if (_asmRootPage == null) if (_asmRootPage == null)
return; return;
@ -74,14 +74,14 @@ namespace NAK.AvatarScaleMod.Integrations
_asmRootPage.MenuSubtitle = $"Everything Avatar Scaling! :: ({modUserCount}/{playerCount} players using ASM)"; _asmRootPage.MenuSubtitle = $"Everything Avatar Scaling! :: ({modUserCount}/{playerCount} players using ASM)";
} }
#endregion #endregion
#region Double-Click Reset Height #region Double-Click Reset Height
private static DateTime lastTime = DateTime.Now; private static DateTime lastTime = DateTime.Now;
private static void OnTabChange(string newTab, string previousTab) private static void OnTabChange(string newTab, string previousTab)
{ {
if (newTab == _rootPageElementID) if (newTab == _rootPageElementID)
{ {
UpdatePlayerCountDisplay(); UpdatePlayerCountDisplay();
@ -95,6 +95,5 @@ namespace NAK.AvatarScaleMod.Integrations
lastTime = DateTime.Now; lastTime = DateTime.Now;
} }
#endregion #endregion
}
} }

View file

@ -1,11 +1,11 @@
using BTKUILib.UIObjects; using BTKUILib.UIObjects;
namespace NAK.AvatarScaleMod.Integrations namespace NAK.AvatarScaleMod.Integrations;
public static partial class BtkUiAddon
{ {
public static partial class BtkUiAddon private static void Setup_AvatarScaleModCategory(Page page)
{ {
private static void Setup_AvatarScaleModCategory(Page page)
{
Category avScaleModCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_ASM_SettingsCategory); Category avScaleModCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_ASM_SettingsCategory);
AddMelonToggle(ref avScaleModCategory, ModSettings.EntryScaleGestureEnabled); AddMelonToggle(ref avScaleModCategory, ModSettings.EntryScaleGestureEnabled);
@ -13,5 +13,4 @@ namespace NAK.AvatarScaleMod.Integrations
AddMelonToggle(ref avScaleModCategory, ModSettings.EntryPersistentHeight); AddMelonToggle(ref avScaleModCategory, ModSettings.EntryPersistentHeight);
AddMelonToggle(ref avScaleModCategory, ModSettings.EntryPersistThroughRestart); AddMelonToggle(ref avScaleModCategory, ModSettings.EntryPersistThroughRestart);
} }
}
} }

View file

@ -1,12 +1,12 @@
using BTKUILib.UIObjects; using BTKUILib.UIObjects;
using BTKUILib.UIObjects.Components; using BTKUILib.UIObjects.Components;
namespace NAK.AvatarScaleMod.Integrations namespace NAK.AvatarScaleMod.Integrations;
public static partial class BtkUiAddon
{ {
public static partial class BtkUiAddon private static void Setup_AvatarScaleToolCategory(Page page)
{ {
private static void Setup_AvatarScaleToolCategory(Page page)
{
Category avScaleToolCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_AST_SettingsCategory); Category avScaleToolCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_AST_SettingsCategory);
AddMelonStringInput(ref avScaleToolCategory, ModSettings.EntryASTScaleParameter, "icon"); AddMelonStringInput(ref avScaleToolCategory, ModSettings.EntryASTScaleParameter, "icon");
@ -19,5 +19,4 @@ namespace NAK.AvatarScaleMod.Integrations
ModSettings.EntryASTMaxHeight.ResetToDefault(); ModSettings.EntryASTMaxHeight.ResetToDefault();
}; };
} }
}
} }

View file

@ -1,16 +1,15 @@
using BTKUILib.UIObjects; using BTKUILib.UIObjects;
namespace NAK.AvatarScaleMod.Integrations namespace NAK.AvatarScaleMod.Integrations;
public static partial class BtkUiAddon
{ {
public static partial class BtkUiAddon private static void Setup_DebugOptionsCategory(Page page)
{ {
private static void Setup_DebugOptionsCategory(Page page)
{
Category debugCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_DEBUG_SettingsCategory); Category debugCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_DEBUG_SettingsCategory);
AddMelonToggle(ref debugCategory, ModSettings.Debug_NetworkInbound); AddMelonToggle(ref debugCategory, ModSettings.Debug_NetworkInbound);
AddMelonToggle(ref debugCategory, ModSettings.Debug_NetworkOutbound); AddMelonToggle(ref debugCategory, ModSettings.Debug_NetworkOutbound);
AddMelonToggle(ref debugCategory, ModSettings.Debug_ComponentSearchTime); AddMelonToggle(ref debugCategory, ModSettings.Debug_ComponentSearchTime);
} }
}
} }

View file

@ -4,14 +4,14 @@ using BTKUILib.UIObjects.Components;
using NAK.AvatarScaleMod.AvatarScaling; using NAK.AvatarScaleMod.AvatarScaling;
using System.Collections.Generic; // Added for list support using System.Collections.Generic; // Added for list support
namespace NAK.AvatarScaleMod.Integrations namespace NAK.AvatarScaleMod.Integrations;
{
public static partial class BtkUiAddon
{
private static readonly List<QMUIElement> USM_QmUiElements = new();
private static void Setup_UniversalScalingSettings(Page page) public static partial class BtkUiAddon
{ {
private static readonly List<QMUIElement> USM_QmUiElements = new();
private static void Setup_UniversalScalingSettings(Page page)
{
Category uniScalingCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_USM_SettingsCategory); Category uniScalingCategory = AddMelonCategory(ref page, ModSettings.Hidden_Foldout_USM_SettingsCategory);
SliderFloat scaleSlider = AddMelonSlider(ref uniScalingCategory, ModSettings.EntryHiddenAvatarHeight, AvatarScaleManager.DefaultMinHeight, AvatarScaleManager.DefaultMaxHeight); SliderFloat scaleSlider = AddMelonSlider(ref uniScalingCategory, ModSettings.EntryHiddenAvatarHeight, AvatarScaleManager.DefaultMinHeight, AvatarScaleManager.DefaultMaxHeight);
@ -52,24 +52,23 @@ namespace NAK.AvatarScaleMod.Integrations
ModSettings.EntryUseUniversalScaling.OnEntryValueChanged.Subscribe((_, newValue) => OnUniversalScalingChanged(newValue)); ModSettings.EntryUseUniversalScaling.OnEntryValueChanged.Subscribe((_, newValue) => OnUniversalScalingChanged(newValue));
} }
private static void OnUniversalScalingChanged(bool value) private static void OnUniversalScalingChanged(bool value)
{ {
foreach (QMUIElement uiElement in USM_QmUiElements) foreach (QMUIElement uiElement in USM_QmUiElements)
uiElement.Disabled = !value; uiElement.Disabled = !value;
} }
#region Slider Events #region Slider Events
private static void OnAvatarHeightSliderChanged(float height) private static void OnAvatarHeightSliderChanged(float height)
{ {
AvatarScaleManager.Instance.SetTargetHeight(height); AvatarScaleManager.Instance.SetTargetHeight(height);
} }
private static void OnAvatarHeightSliderReset() private static void OnAvatarHeightSliderReset()
{ {
AvatarScaleManager.Instance.Setting_UniversalScaling = false; AvatarScaleManager.Instance.Setting_UniversalScaling = false;
} }
#endregion #endregion
}
} }

View file

@ -3,15 +3,15 @@ using BTKUILib.UIObjects;
using BTKUILib.UIObjects.Components; using BTKUILib.UIObjects.Components;
using NAK.AvatarScaleMod.AvatarScaling; using NAK.AvatarScaleMod.AvatarScaling;
namespace NAK.AvatarScaleMod.Integrations namespace NAK.AvatarScaleMod.Integrations;
public static partial class BtkUiAddon
{ {
public static partial class BtkUiAddon private static Button _playerHasModElement;
{ private static string _selectedPlayer;
private static Button _playerHasModElement;
private static string _selectedPlayer;
private static void Setup_PlayerSelectPage() private static void Setup_PlayerSelectPage()
{ {
QuickMenuAPI.OnPlayerSelected += OnPlayerSelected; QuickMenuAPI.OnPlayerSelected += OnPlayerSelected;
Category category = QuickMenuAPI.PlayerSelectPage.AddCategory(ModSettings.ASM_SettingsCategory, ModSettings.ModName); Category category = QuickMenuAPI.PlayerSelectPage.AddCategory(ModSettings.ASM_SettingsCategory, ModSettings.ModName);
@ -22,27 +22,27 @@ namespace NAK.AvatarScaleMod.Integrations
button.OnPress += OnCopyPlayerHeight; button.OnPress += OnCopyPlayerHeight;
} }
#region QM Events #region QM Events
private static void OnPlayerSelected(string _, string id) private static void OnPlayerSelected(string _, string id)
{ {
_selectedPlayer = id; _selectedPlayer = id;
UpdatePlayerHasModIcon(); UpdatePlayerHasModIcon();
} }
private static void OnCopyPlayerHeight() private static void OnCopyPlayerHeight()
{ {
float networkHeight = AvatarScaleManager.Instance.GetNetworkHeight(_selectedPlayer); float networkHeight = AvatarScaleManager.Instance.GetNetworkHeight(_selectedPlayer);
if (networkHeight < 0) return; if (networkHeight < 0) return;
AvatarScaleManager.Instance.SetTargetHeight(networkHeight); AvatarScaleManager.Instance.SetTargetHeight(networkHeight);
} }
#endregion #endregion
#region Private Methods #region Private Methods
private static void UpdatePlayerHasModIcon() private static void UpdatePlayerHasModIcon()
{ {
if (_playerHasModElement == null) if (_playerHasModElement == null)
return; return;
@ -60,6 +60,5 @@ namespace NAK.AvatarScaleMod.Integrations
} }
} }
#endregion #endregion
}
} }

View file

@ -0,0 +1,77 @@
using System.Reflection;
using BTKUILib;
using BTKUILib.UIObjects;
using BTKUILib.UIObjects.Components;
using MelonLoader;
using UnityEngine;
namespace NAK.AvatarScaleMod.Integrations;
public static partial class BtkUiAddon
{
#region Melon Preference Helpers
private static ToggleButton AddMelonToggle(ref Category category, MelonPreferences_Entry<bool> entry)
{
ToggleButton toggle = category.AddToggle(entry.DisplayName, entry.Description, entry.Value);
toggle.OnValueUpdated += b => entry.Value = b;
return toggle;
}
private static SliderFloat AddMelonSlider(ref Category category, MelonPreferences_Entry<float> entry, float min,
float max, int decimalPlaces = 2, bool allowReset = true)
{
SliderFloat slider = category.AddSlider(entry.DisplayName, entry.Description,
Mathf.Clamp(entry.Value, min, max), min, max, decimalPlaces, entry.DefaultValue, allowReset);
slider.OnValueUpdated += f => entry.Value = f;
return slider;
}
private static Button AddMelonStringInput(ref Category category, MelonPreferences_Entry<string> entry, string buttonIcon = "", ButtonStyle buttonStyle = ButtonStyle.TextOnly)
{
Button button = category.AddButton(entry.DisplayName, buttonIcon, entry.Description, buttonStyle);
button.OnPress += () => QuickMenuAPI.OpenKeyboard(entry.Value, s => entry.Value = s);
return button;
}
private static Button AddMelonNumberInput(ref Category category, MelonPreferences_Entry<float> entry, string buttonIcon = "", ButtonStyle buttonStyle = ButtonStyle.TextOnly)
{
Button button = category.AddButton(entry.DisplayName, buttonIcon, entry.Description, buttonStyle);
button.OnPress += () => QuickMenuAPI.OpenNumberInput(entry.DisplayName, entry.Value, f => entry.Value = f);
return button;
}
// private static SliderFloat AddMelonSlider(ref Page page, MelonPreferences_Entry<float> entry, float min, float max, int decimalPlaces = 2, bool allowReset = true)
// {
// SliderFloat slider = page.AddSlider(entry.DisplayName, entry.Description, Mathf.Clamp(entry.Value, min, max), min, max, decimalPlaces, entry.DefaultValue, allowReset);
// slider.OnValueUpdated += f => entry.Value = f;
// return slider;
// }
/// <summary>
/// Helper method to create a category that saves its collapsed state to a MelonPreferences entry.
/// </summary>
/// <param name="page"></param>
/// <param name="entry"></param>
/// <param name="showHeader"></param>
/// <returns></returns>
private static Category AddMelonCategory(ref Page page, MelonPreferences_Entry<bool> entry, bool showHeader = true)
{
Category category = page.AddCategory(entry.DisplayName, showHeader, true, entry.Value);
category.OnCollapse += b => entry.Value = b;
return category;
}
#endregion
#region Icon Utils
private static Stream GetIconStream(string iconName)
{
Assembly assembly = Assembly.GetExecutingAssembly();
string assemblyName = assembly.GetName().Name;
return assembly.GetManifestResourceStream($"{assemblyName}.resources.{iconName}");
}
#endregion
}

View file

@ -3,12 +3,12 @@ using System.IO;
using System.Reflection; using System.Reflection;
// https://github.com/SDraw/ml_mods_cvr/blob/master/ml_amt/Scripts.cs // https://github.com/SDraw/ml_mods_cvr/blob/master/ml_amt/Scripts.cs
namespace NAK.AvatarScaleMod namespace NAK.AvatarScaleMod;
static class Scripts
{ {
static class Scripts public static string GetEmbeddedScript(string p_name)
{ {
public static string GetEmbeddedScript(string p_name)
{
string l_result = ""; string l_result = "";
Assembly l_assembly = Assembly.GetExecutingAssembly(); Assembly l_assembly = Assembly.GetExecutingAssembly();
string l_assemblyName = l_assembly.GetName().Name; string l_assemblyName = l_assembly.GetName().Name;
@ -23,5 +23,4 @@ namespace NAK.AvatarScaleMod
return l_result; return l_result;
} }
}
} }

View file

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

View file

@ -2,18 +2,18 @@
using UnityEngine; using UnityEngine;
using Gizmos = Popcron.Gizmos; using Gizmos = Popcron.Gizmos;
namespace NAK.CVRGizmos namespace NAK.CVRGizmos;
public class CVRGizmoManager : MonoBehaviour
{ {
public class CVRGizmoManager : MonoBehaviour public static CVRGizmoManager Instance;
{
public static CVRGizmoManager Instance;
public bool g_enabled = false; public bool g_enabled = false;
public bool g_localOnly = false; public bool g_localOnly = false;
public MonoBehaviour[] managed; public MonoBehaviour[] managed;
public System.Type[] GizmoTypes = { public System.Type[] GizmoTypes = {
typeof(CVRGizmos_Pointer), typeof(CVRGizmos_Pointer),
typeof(CVRGizmos_AdvancedAvatarSettingsTrigger), typeof(CVRGizmos_AdvancedAvatarSettingsTrigger),
typeof(CVRGizmos_SpawnableTrigger), typeof(CVRGizmos_SpawnableTrigger),
@ -30,8 +30,8 @@ namespace NAK.CVRGizmos
typeof(CVRGizmos_CapsuleCollider), typeof(CVRGizmos_CapsuleCollider),
}; };
private void Start() private void Start()
{ {
CVRGizmoManager.Instance = this; CVRGizmoManager.Instance = this;
managed = new MonoBehaviour[GizmoTypes.Count()]; managed = new MonoBehaviour[GizmoTypes.Count()];
for (int i = 0; i < GizmoTypes.Count(); i++) for (int i = 0; i < GizmoTypes.Count(); i++)
@ -40,8 +40,8 @@ namespace NAK.CVRGizmos
} }
} }
public void EnableGizmos(bool able) public void EnableGizmos(bool able)
{ {
for (int i = 0; i < GizmoTypes.Count(); i++) for (int i = 0; i < GizmoTypes.Count(); i++)
{ {
managed[i].enabled = able; managed[i].enabled = able;
@ -50,12 +50,11 @@ namespace NAK.CVRGizmos
RefreshGizmos(); RefreshGizmos();
} }
public void RefreshGizmos() public void RefreshGizmos()
{ {
for (int i = 0; i < GizmoTypes.Count(); i++) for (int i = 0; i < GizmoTypes.Count(); i++)
{ {
managed[i].Invoke("CacheGizmos", 0f); managed[i].Invoke("CacheGizmos", 0f);
} }
} }
}
} }

Some files were not shown because too many files have changed in this diff Show more