mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
major cleanup
This commit is contained in:
parent
b33e15377f
commit
e5242f76c7
85 changed files with 584 additions and 571 deletions
|
@ -3,46 +3,46 @@ using ABI_RC.Core.Player;
|
|||
using MelonLoader;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NAK.PathCamDisabler
|
||||
namespace NAK.PathCamDisabler;
|
||||
|
||||
public class PathCamDisabler : MelonMod
|
||||
{
|
||||
public class PathCamDisablerMod : MelonMod
|
||||
public static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(PathCamDisabler));
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryDisablePathCam =
|
||||
Category.CreateEntry("Disable Path Camera Controller.", true, "Disable Path Camera Controller.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryDisableFlightBind =
|
||||
Category.CreateEntry("Disable Flight Binding (if controller off).", false, "Disable flight bind if Path Camera Controller is also disabled.");
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
internal const string SettingsCategory = "PathCamDisabler";
|
||||
internal static MelonPreferences_Category m_categoryPathCamDisabler;
|
||||
internal static MelonPreferences_Entry<bool> m_entryDisablePathCam, m_entryDisableFlightBind;
|
||||
EntryDisablePathCam.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings);
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
MelonLoader.MelonCoroutines.Start(WaitForCVRPathCamController());
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator WaitForCVRPathCamController()
|
||||
{
|
||||
while (CVRPathCamController.Instance == null)
|
||||
yield return null;
|
||||
UpdateSettings();
|
||||
}
|
||||
|
||||
private void UpdateSettings()
|
||||
{
|
||||
CVRPathCamController.Instance.enabled = !EntryDisablePathCam.Value;
|
||||
}
|
||||
private void OnUpdateSettings(object arg1, object arg2) => UpdateSettings();
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (EntryDisablePathCam.Value && !EntryDisableFlightBind.Value)
|
||||
{
|
||||
m_categoryPathCamDisabler = MelonPreferences.CreateCategory(SettingsCategory);
|
||||
m_entryDisablePathCam = m_categoryPathCamDisabler.CreateEntry<bool>("Disable Path Camera Controller.", true, description: "Disable Path Camera Controller.");
|
||||
m_entryDisableFlightBind = m_categoryPathCamDisabler.CreateEntry<bool>("Disable Flight Binding (if controller off).", false, description: "Disable flight bind if Path Camera Controller is also disabled.");
|
||||
|
||||
m_entryDisablePathCam.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings);
|
||||
|
||||
MelonLoader.MelonCoroutines.Start(WaitForCVRPathCamController());
|
||||
}
|
||||
|
||||
private System.Collections.IEnumerator WaitForCVRPathCamController()
|
||||
{
|
||||
while (CVRPathCamController.Instance == null)
|
||||
yield return null;
|
||||
UpdateSettings();
|
||||
}
|
||||
|
||||
private void UpdateSettings()
|
||||
{
|
||||
CVRPathCamController.Instance.enabled = !m_entryDisablePathCam.Value;
|
||||
}
|
||||
private void OnUpdateSettings(object arg1, object arg2) => UpdateSettings();
|
||||
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (m_entryDisablePathCam.Value && !m_entryDisableFlightBind.Value)
|
||||
if (Input.GetKeyDown(KeyCode.Keypad5))
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Keypad5))
|
||||
{
|
||||
PlayerSetup.Instance._movementSystem.ToggleFlight();
|
||||
}
|
||||
PlayerSetup.Instance._movementSystem.ToggleFlight();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using MelonLoader;
|
||||
using System.Reflection;
|
||||
using NAK.PathCamDisabler.Properties;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||
|
@ -10,11 +10,11 @@ using NAK.PathCamDisabler.Properties;
|
|||
[assembly: AssemblyProduct(nameof(NAK.PathCamDisabler))]
|
||||
|
||||
[assembly: MelonInfo(
|
||||
typeof(NAK.PathCamDisabler.PathCamDisablerMod),
|
||||
typeof(NAK.PathCamDisabler.PathCamDisabler),
|
||||
nameof(NAK.PathCamDisabler),
|
||||
AssemblyInfoParams.Version,
|
||||
AssemblyInfoParams.Author,
|
||||
downloadLink: "https://github.com/NotAKidOnSteam/PathCamDisabler"
|
||||
downloadLink: "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PathCamDisabler"
|
||||
)]
|
||||
|
||||
[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")]
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
"requirements": [
|
||||
"None"
|
||||
],
|
||||
"downloadlink": "https://github.com/NotAKidOnSteam/PathCamDisabler/releases/download/v1.0.1/PathCamDisabler.dll",
|
||||
"sourcelink": "https://github.com/NotAKidOnSteam/PathCamDisabler/",
|
||||
"downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r3/PathCamDisabler.dll",
|
||||
"sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/PathCamDisabler/",
|
||||
"changelog": "- Organizational changes.\n- No longer using SaveToFile().",
|
||||
"embedcolor": "#9b59b6"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue