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

@ -4,19 +4,19 @@ using BTKUILib.UIObjects;
using BTKUILib.UIObjects.Components;
using NAK.OriginShift;
namespace NAK.OriginShiftMod.Integrations
namespace NAK.OriginShiftMod.Integrations;
public static partial class BtkUiAddon
{
public static partial class BtkUiAddon
private static Category _ourCategory;
private static Button _ourMainButton;
private static bool _isForcedMode;
private static ToggleButton _ourToggle;
private static void Setup_OriginShiftModCategory(Page page)
{
private static Category _ourCategory;
private static Button _ourMainButton;
private static bool _isForcedMode;
private static ToggleButton _ourToggle;
private static void Setup_OriginShiftModCategory(Page page)
{
// dear category
_ourCategory = page.AddCategory(ModSettings.OSM_SettingsCategory, ModSettings.ModName, true, true, false);
@ -38,21 +38,21 @@ namespace NAK.OriginShiftMod.Integrations
debugToggle.OnValueUpdated += OnDebugToggle;
}
#region Category Actions
#region Category Actions
private static void UpdateCategoryModUserCount()
{
private static void UpdateCategoryModUserCount()
{
int modUsers = 1; // we are always here :3
int playerCount = CVRPlayerManager.Instance.NetworkPlayers.Count + 1; // +1 for us :3
_ourCategory.CategoryName = $"{ModSettings.OSM_SettingsCategory} ({modUsers}/{playerCount})";
}
#endregion Category Actions
#endregion Category Actions
#region Button Actions
#region Button Actions
private static void SetButtonState(OriginShiftManager.OriginShiftState state)
{
private static void SetButtonState(OriginShiftManager.OriginShiftState state)
{
switch (state)
{
default:
@ -74,8 +74,8 @@ namespace NAK.OriginShiftMod.Integrations
}
}
private static void OnMainButtonClick()
{
private static void OnMainButtonClick()
{
// if active, return as world is using Origin Shift
if (OriginShiftManager.Instance.CurrentState
is OriginShiftManager.OriginShiftState.Active)
@ -97,19 +97,19 @@ namespace NAK.OriginShiftMod.Integrations
}
}
private static void OnOriginShiftStateChanged(OriginShiftManager.OriginShiftState state)
{
private static void OnOriginShiftStateChanged(OriginShiftManager.OriginShiftState state)
{
_isForcedMode = state == OriginShiftManager.OriginShiftState.Forced;
SetButtonState(state);
SetToggleLocked(_isForcedMode);
}
#endregion Button Actions
#endregion Button Actions
#region Toggle Actions
#region Toggle Actions
private static void SetToggleLocked(bool value)
{
private static void SetToggleLocked(bool value)
{
if (value)
{
// lock the toggle
@ -126,20 +126,19 @@ namespace NAK.OriginShiftMod.Integrations
}
}
private static void OnCompatibilityModeToggle(bool value)
{
private static void OnCompatibilityModeToggle(bool value)
{
ModSettings.EntryCompatibilityMode.Value = value;
}
#endregion Toggle Actions
#endregion Toggle Actions
#region Debug Toggle Actions
#region Debug Toggle Actions
private static void OnDebugToggle(bool value)
{
private static void OnDebugToggle(bool value)
{
OriginShiftManager.Instance.ToggleDebugOverlay(value);
}
#endregion Debug Toggle Actions
}
#endregion Debug Toggle Actions
}

View file

@ -3,23 +3,23 @@ using BTKUILib;
using BTKUILib.UIObjects;
using NAK.OriginShift;
namespace NAK.OriginShiftMod.Integrations
{
public static partial class BtkUiAddon
{
private static Page _miscTabPage;
private static string _miscTabElementID;
namespace NAK.OriginShiftMod.Integrations;
public static void Initialize()
{
public static partial class BtkUiAddon
{
private static Page _miscTabPage;
private static string _miscTabElementID;
public static void Initialize()
{
Prepare_Icons();
Setup_OriginShiftTab();
}
#region Initialization
#region Initialization
private static void Prepare_Icons()
{
private static void Prepare_Icons()
{
QuickMenuAPI.PrepareIcon(ModSettings.ModName, "OriginShift-Icon-Active",
GetIconStream("OriginShift-Icon-Active.png"));
@ -30,8 +30,8 @@ namespace NAK.OriginShiftMod.Integrations
GetIconStream("OriginShift-Icon-Forced.png"));
}
private static void Setup_OriginShiftTab()
{
private static void Setup_OriginShiftTab()
{
_miscTabPage = QuickMenuAPI.MiscTabPage;
_miscTabElementID = _miscTabPage.ElementID;
QuickMenuAPI.UserJoin += OnUserJoinLeave;
@ -51,16 +51,15 @@ namespace NAK.OriginShiftMod.Integrations
// Setup_DebugOptionsCategory(_miscTabPage);
}
#endregion
#endregion
#region Player Count Display
#region Player Count Display
private static void OnWorldLeave()
=> UpdateCategoryModUserCount();
private static void OnWorldLeave()
=> UpdateCategoryModUserCount();
private static void OnUserJoinLeave(CVRPlayerEntity _)
=> UpdateCategoryModUserCount();
private static void OnUserJoinLeave(CVRPlayerEntity _)
=> UpdateCategoryModUserCount();
#endregion
}
}
#endregion
}

View file

@ -5,60 +5,59 @@ using BTKUILib.UIObjects.Components;
using MelonLoader;
using UnityEngine;
namespace NAK.OriginShiftMod.Integrations
namespace NAK.OriginShiftMod.Integrations;
public static partial class BtkUiAddon
{
public static partial class BtkUiAddon
{
#region Melon Preference Helpers
#region Melon Preference Helpers
private static ToggleButton AddMelonToggle(ref Category category, MelonPreferences_Entry<bool> entry)
{
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)
{
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)
{
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)
{
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 Category AddMelonCategory(ref Page page, MelonPreferences_Entry<bool> entry, bool showHeader = true)
{
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 Melon Preference Helpers
#endregion Melon Preference Helpers
#region Icon Utils
#region Icon Utils
private static Stream GetIconStream(string iconName)
{
private static Stream GetIconStream(string iconName)
{
Assembly assembly = Assembly.GetExecutingAssembly();
string assemblyName = assembly.GetName().Name;
return assembly.GetManifestResourceStream($"{assemblyName}.Resources.{iconName}");
}
#endregion Icon Utils
}
#endregion Icon Utils
}