mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-01 22:09:23 +00:00
wasd
This commit is contained in:
parent
7d775af7d3
commit
1b188433a2
3 changed files with 47 additions and 51 deletions
|
@ -1,51 +1,48 @@
|
||||||
using ABI_RC.Core.Player;
|
using ABI_RC.Core.IO;
|
||||||
using ABI_RC.Core.IO;
|
using ABI_RC.Core.Player;
|
||||||
using MelonLoader;
|
using MelonLoader;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace PathCamDisabler;
|
namespace NAK.Melons.PathCamDisabler
|
||||||
|
|
||||||
public class PathCamDisabler : MelonMod
|
|
||||||
{
|
{
|
||||||
private static MelonPreferences_Category m_categoryPathCamDisabler;
|
public class PathCamDisablerMod : MelonMod
|
||||||
private static MelonPreferences_Entry<bool> m_entryDisablePathCam, m_entryDisableFlightBind;
|
|
||||||
|
|
||||||
public override void OnInitializeMelon()
|
|
||||||
{
|
{
|
||||||
m_categoryPathCamDisabler = MelonPreferences.CreateCategory(nameof(PathCamDisabler));
|
internal const string SettingsCategory = "PathCamDisabler";
|
||||||
m_entryDisablePathCam = m_categoryPathCamDisabler.CreateEntry<bool>("Disable Path Camera Controller.", true, description: "Disable path camera controller so you can use your numpad keys without funky shit.");
|
internal static MelonPreferences_Category m_categoryPathCamDisabler;
|
||||||
m_entryDisableFlightBind = m_categoryPathCamDisabler.CreateEntry<bool>("Disable Flight Binding (if controller off).", false, description: "Disables the flight binding as the path camera controller handles that...?");
|
internal static MelonPreferences_Entry<bool> m_entryDisablePathCam, m_entryDisableFlightBind;
|
||||||
m_categoryPathCamDisabler.SaveToFile(false);
|
|
||||||
|
|
||||||
foreach (var setting in m_categoryPathCamDisabler.Entries)
|
public override void OnInitializeMelon()
|
||||||
{
|
{
|
||||||
setting.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings);
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
|
private System.Collections.IEnumerator WaitForCVRPathCamController()
|
||||||
}
|
|
||||||
|
|
||||||
System.Collections.IEnumerator WaitForLocalPlayer()
|
|
||||||
{
|
|
||||||
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))
|
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)
|
||||||
{
|
{
|
||||||
PlayerSetup.Instance._movementSystem.ToggleFlight();
|
if (Input.GetKeyDown(KeyCode.Keypad5))
|
||||||
|
{
|
||||||
|
PlayerSetup.Instance._movementSystem.ToggleFlight();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
using PathCamDisabler.Properties;
|
using MelonLoader;
|
||||||
using MelonLoader;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using NAK.Melons.PathCamDisabler.Properties;
|
||||||
|
|
||||||
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
[assembly: AssemblyVersion(AssemblyInfoParams.Version)]
|
||||||
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)]
|
||||||
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)]
|
||||||
[assembly: AssemblyTitle(nameof(PathCamDisabler))]
|
[assembly: AssemblyTitle(nameof(NAK.Melons.PathCamDisabler))]
|
||||||
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
[assembly: AssemblyCompany(AssemblyInfoParams.Author)]
|
||||||
[assembly: AssemblyProduct(nameof(PathCamDisabler))]
|
[assembly: AssemblyProduct(nameof(NAK.Melons.PathCamDisabler))]
|
||||||
|
|
||||||
[assembly: MelonInfo(
|
[assembly: MelonInfo(
|
||||||
typeof(PathCamDisabler.PathCamDisabler),
|
typeof(NAK.Melons.PathCamDisabler.PathCamDisablerMod),
|
||||||
nameof(PathCamDisabler),
|
nameof(NAK.Melons.PathCamDisabler),
|
||||||
AssemblyInfoParams.Version,
|
AssemblyInfoParams.Version,
|
||||||
AssemblyInfoParams.Author,
|
AssemblyInfoParams.Author,
|
||||||
downloadLink: "https://github.com/NotAKidOnSteam/PathCamDisabler"
|
downloadLink: "https://github.com/NotAKidOnSteam/PathCamDisabler"
|
||||||
|
@ -22,9 +21,9 @@ using System.Reflection;
|
||||||
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]
|
||||||
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)]
|
||||||
|
|
||||||
namespace PathCamDisabler.Properties;
|
namespace NAK.Melons.PathCamDisabler.Properties;
|
||||||
internal static class AssemblyInfoParams
|
internal static class AssemblyInfoParams
|
||||||
{
|
{
|
||||||
public const string Version = "1.0.0";
|
public const string Version = "1.0.1";
|
||||||
public const string Author = "NotAKidoS";
|
public const string Author = "NotAKidoS";
|
||||||
}
|
}
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"_id": 110,
|
"_id": 110,
|
||||||
"name": "PathCamDisabler",
|
"name": "PathCamDisabler",
|
||||||
"modversion": "1.0.0",
|
"modversion": "1.0.1",
|
||||||
"gameversion": "2022r169",
|
"gameversion": "2022r170",
|
||||||
"loaderversion": "0.5.7",
|
"loaderversion": "0.5.7",
|
||||||
"modtype": "Mod",
|
"modtype": "Mod",
|
||||||
"author": "NotAKidoS",
|
"author": "NotAKidoS",
|
||||||
"description": "Disables path camera controller to free up your numkeys. Additional option to disable the flight binding. \n\n Won't do much for VR. Can toggle with UIExpansionKit or similar.",
|
"description": "Adds option to disable the Path Camera Controller to free up your numkeys.\nAdditional option to disable flight binding.",
|
||||||
"searchtags": [
|
"searchtags": [
|
||||||
"numpad",
|
"numpad",
|
||||||
"camera",
|
"camera",
|
||||||
|
@ -16,8 +16,8 @@
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"None"
|
"None"
|
||||||
],
|
],
|
||||||
"downloadlink": "https://github.com/NotAKidOnSteam/PathCamDisabler/releases/download/r1/PathCamDisabler.dll",
|
"downloadlink": "https://github.com/NotAKidOnSteam/PathCamDisabler/releases/download/v1.0.1/PathCamDisabler.dll",
|
||||||
"sourcelink": "https://github.com/NotAKidOnSteam/PathCamDisabler/",
|
"sourcelink": "https://github.com/NotAKidOnSteam/PathCamDisabler/",
|
||||||
"changelog": "initial release\n(i made this in 5 minutes after months of annoyances)",
|
"changelog": "- Organizational changes.\n- No longer using SaveToFile().",
|
||||||
"embedcolor": "#9b59b6"
|
"embedcolor": "#9b59b6"
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue