mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-08-31 21:39:27 +00:00
Move many mods to Deprecated folder, fix spelling
This commit is contained in:
parent
5e822cec8d
commit
0042590aa6
539 changed files with 7475 additions and 3120 deletions
|
@ -211,7 +211,7 @@ public class AvatarScaleManager : MonoBehaviour
|
|||
public float GetHeight()
|
||||
{
|
||||
if (_localAvatarScaler == null)
|
||||
return PlayerAvatarPoint.defaultAvatarHeight;
|
||||
return PlayerAvatarPoint.DefaultAvatarHeight;
|
||||
|
||||
if (!_localAvatarScaler.IsForcingHeight())
|
||||
return PlayerSetup.Instance.GetAvatarHeight();
|
||||
|
@ -222,7 +222,7 @@ public class AvatarScaleManager : MonoBehaviour
|
|||
public float GetAnimationClipHeight()
|
||||
{
|
||||
if (_localAvatarScaler == null)
|
||||
return PlayerAvatarPoint.defaultAvatarHeight;
|
||||
return PlayerAvatarPoint.DefaultAvatarHeight;
|
||||
|
||||
if (!_localAvatarScaler.IsForcingHeight())
|
||||
return PlayerSetup.Instance.GetAvatarHeight();
|
|
@ -1,4 +1,5 @@
|
|||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core;
|
||||
using ABI_RC.Core.Player;
|
||||
using ABI_RC.Core.UI;
|
||||
using NAK.AvatarScaleMod.AvatarScaling;
|
||||
using UnityEngine;
|
||||
|
@ -72,7 +73,7 @@ public class LocalScaler : BaseScaler
|
|||
}
|
||||
|
||||
// animation scale changed, record it!
|
||||
Vector3 scaleDifference = PlayerSetup.DivideVectors(localScale - _initialScale, _initialScale);
|
||||
Vector3 scaleDifference = CVRTools.DivideVectors(localScale - _initialScale, _initialScale);
|
||||
_animatedScaleFactor = scaleDifference.y;
|
||||
_animatedHeight = (_initialHeight * _animatedScaleFactor) + _initialHeight;
|
||||
_animatedScale = localScale;
|
|
@ -3,32 +3,32 @@ using BTKUILib;
|
|||
using BTKUILib.UIObjects;
|
||||
using NAK.AvatarScaleMod.AvatarScaling;
|
||||
|
||||
namespace NAK.AvatarScaleMod.Integrations
|
||||
{
|
||||
public static partial class BtkUiAddon
|
||||
{
|
||||
private static Page _asmRootPage;
|
||||
private static string _rootPageElementID;
|
||||
namespace NAK.AvatarScaleMod.Integrations;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
public static partial class BtkUiAddon
|
||||
{
|
||||
private static Page _asmRootPage;
|
||||
private static string _rootPageElementID;
|
||||
|
||||
public static void Initialize()
|
||||
{
|
||||
Prepare_Icons();
|
||||
Setup_AvatarScaleModTab();
|
||||
Setup_PlayerSelectPage();
|
||||
}
|
||||
|
||||
#region Initialization
|
||||
#region Initialization
|
||||
|
||||
private static void Prepare_Icons()
|
||||
{
|
||||
private static void Prepare_Icons()
|
||||
{
|
||||
QuickMenuAPI.PrepareIcon(ModSettings.ModName, "ASM_Icon_AvatarHeightConfig",
|
||||
GetIconStream("ASM_Icon_AvatarHeightConfig.png"));
|
||||
QuickMenuAPI.PrepareIcon(ModSettings.ModName, "ASM_Icon_AvatarHeightCopy",
|
||||
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")
|
||||
{
|
||||
MenuTitle = ModSettings.ASM_SettingsCategory,
|
||||
|
@ -54,18 +54,18 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
Setup_DebugOptionsCategory(_asmRootPage);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Player Count Display
|
||||
#region Player Count Display
|
||||
|
||||
private static void OnWorldLeave()
|
||||
=> UpdatePlayerCountDisplay();
|
||||
private static void OnWorldLeave()
|
||||
=> UpdatePlayerCountDisplay();
|
||||
|
||||
private static void OnUserJoinLeave(CVRPlayerEntity _)
|
||||
=> UpdatePlayerCountDisplay();
|
||||
private static void OnUserJoinLeave(CVRPlayerEntity _)
|
||||
=> UpdatePlayerCountDisplay();
|
||||
|
||||
private static void UpdatePlayerCountDisplay()
|
||||
{
|
||||
private static void UpdatePlayerCountDisplay()
|
||||
{
|
||||
if (_asmRootPage == null)
|
||||
return;
|
||||
|
||||
|
@ -74,14 +74,14 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
_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)
|
||||
{
|
||||
UpdatePlayerCountDisplay();
|
||||
|
@ -95,6 +95,5 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
lastTime = DateTime.Now;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
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);
|
||||
|
||||
AddMelonToggle(ref avScaleModCategory, ModSettings.EntryScaleGestureEnabled);
|
||||
|
@ -13,5 +13,4 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
AddMelonToggle(ref avScaleModCategory, ModSettings.EntryPersistentHeight);
|
||||
AddMelonToggle(ref avScaleModCategory, ModSettings.EntryPersistThroughRestart);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
using BTKUILib.UIObjects;
|
||||
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);
|
||||
|
||||
AddMelonStringInput(ref avScaleToolCategory, ModSettings.EntryASTScaleParameter, "icon");
|
||||
|
@ -19,5 +19,4 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
ModSettings.EntryASTMaxHeight.ResetToDefault();
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,16 +1,15 @@
|
|||
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);
|
||||
|
||||
AddMelonToggle(ref debugCategory, ModSettings.Debug_NetworkInbound);
|
||||
AddMelonToggle(ref debugCategory, ModSettings.Debug_NetworkOutbound);
|
||||
AddMelonToggle(ref debugCategory, ModSettings.Debug_ComponentSearchTime);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,14 +4,14 @@ using BTKUILib.UIObjects.Components;
|
|||
using NAK.AvatarScaleMod.AvatarScaling;
|
||||
using System.Collections.Generic; // Added for list support
|
||||
|
||||
namespace NAK.AvatarScaleMod.Integrations
|
||||
{
|
||||
public static partial class BtkUiAddon
|
||||
{
|
||||
private static readonly List<QMUIElement> USM_QmUiElements = new();
|
||||
namespace NAK.AvatarScaleMod.Integrations;
|
||||
|
||||
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);
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
private static void OnUniversalScalingChanged(bool value)
|
||||
{
|
||||
private static void OnUniversalScalingChanged(bool value)
|
||||
{
|
||||
foreach (QMUIElement uiElement in USM_QmUiElements)
|
||||
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);
|
||||
}
|
||||
|
||||
private static void OnAvatarHeightSliderReset()
|
||||
{
|
||||
private static void OnAvatarHeightSliderReset()
|
||||
{
|
||||
AvatarScaleManager.Instance.Setting_UniversalScaling = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
|
@ -3,15 +3,15 @@ using BTKUILib.UIObjects;
|
|||
using BTKUILib.UIObjects.Components;
|
||||
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;
|
||||
|
||||
Category category = QuickMenuAPI.PlayerSelectPage.AddCategory(ModSettings.ASM_SettingsCategory, ModSettings.ModName);
|
||||
|
@ -22,27 +22,27 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
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;
|
||||
UpdatePlayerHasModIcon();
|
||||
}
|
||||
|
||||
private static void OnCopyPlayerHeight()
|
||||
{
|
||||
private static void OnCopyPlayerHeight()
|
||||
{
|
||||
float networkHeight = AvatarScaleManager.Instance.GetNetworkHeight(_selectedPlayer);
|
||||
if (networkHeight < 0) return;
|
||||
AvatarScaleManager.Instance.SetTargetHeight(networkHeight);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
#region Private Methods
|
||||
|
||||
private static void UpdatePlayerHasModIcon()
|
||||
{
|
||||
private static void UpdatePlayerHasModIcon()
|
||||
{
|
||||
if (_playerHasModElement == null)
|
||||
return;
|
||||
|
||||
|
@ -60,6 +60,5 @@ namespace NAK.AvatarScaleMod.Integrations
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -3,12 +3,12 @@ using System.IO;
|
|||
using System.Reflection;
|
||||
|
||||
// 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 = "";
|
||||
Assembly l_assembly = Assembly.GetExecutingAssembly();
|
||||
string l_assemblyName = l_assembly.GetName().Name;
|
||||
|
@ -23,5 +23,4 @@ namespace NAK.AvatarScaleMod
|
|||
|
||||
return l_result;
|
||||
}
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
@ -2,18 +2,18 @@
|
|||
using UnityEngine;
|
||||
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_localOnly = false;
|
||||
public bool g_enabled = 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_AdvancedAvatarSettingsTrigger),
|
||||
typeof(CVRGizmos_SpawnableTrigger),
|
||||
|
@ -30,8 +30,8 @@ namespace NAK.CVRGizmos
|
|||
typeof(CVRGizmos_CapsuleCollider),
|
||||
};
|
||||
|
||||
private void Start()
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
CVRGizmoManager.Instance = this;
|
||||
managed = new MonoBehaviour[GizmoTypes.Count()];
|
||||
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++)
|
||||
{
|
||||
managed[i].enabled = able;
|
||||
|
@ -50,12 +50,11 @@ namespace NAK.CVRGizmos
|
|||
RefreshGizmos();
|
||||
}
|
||||
|
||||
public void RefreshGizmos()
|
||||
{
|
||||
public void RefreshGizmos()
|
||||
{
|
||||
for (int i = 0; i < GizmoTypes.Count(); i++)
|
||||
{
|
||||
managed[i].Invoke("CacheGizmos", 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue