diff --git a/PathCamDisabler/Main.cs b/PathCamDisabler/Main.cs new file mode 100644 index 0000000..4d21597 --- /dev/null +++ b/PathCamDisabler/Main.cs @@ -0,0 +1,52 @@ +using ABI_RC.Core.Player; +using ABI_RC.Core.IO; +using MelonLoader; +using UnityEngine; + +namespace PathCamDisabler; + +public class PathCamDisabler : MelonMod +{ + private static MelonPreferences_Category m_categoryPathCamDisabler; + private static MelonPreferences_Entry m_entryDisablePathCam, m_entryDisableFlightBind; + + public override void OnInitializeMelon() + { + m_categoryPathCamDisabler = MelonPreferences.CreateCategory(nameof(PathCamDisabler)); + m_entryDisablePathCam = m_categoryPathCamDisabler.CreateEntry("Disable Path Camera Controller.", true, description: "Disable path camera controller so you can use your numpad keys without funky shit."); + m_entryDisableFlightBind = m_categoryPathCamDisabler.CreateEntry("Disable Flight Binding (if controller off).", false, description: "Disables the flight binding as the path camera controller handles that...?"); + m_categoryPathCamDisabler.SaveToFile(false); + + foreach (var setting in m_categoryPathCamDisabler.Entries) + { + setting.OnEntryValueChangedUntyped.Subscribe(OnUpdateSettings); + } + + MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer()); + } + + 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)) + { + PlayerSetup.Instance._movementSystem.ToggleFlight(); + } + } + } +} \ No newline at end of file diff --git a/PathCamDisabler/PathCamDisabler.csproj b/PathCamDisabler/PathCamDisabler.csproj new file mode 100644 index 0000000..703e8cc --- /dev/null +++ b/PathCamDisabler/PathCamDisabler.csproj @@ -0,0 +1,76 @@ + + + + + net472 + enable + latest + false + + + + + + + + + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\MelonLoader\0Harmony.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Cohtml.Runtime.dll + + + ..\..\Giamoz\Giamoz\bin\Debug\net472\Giamoz.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\MelonLoader\MelonLoader.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\SteamVR.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.AnimationModule.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.AssetBundleModule.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll + + + C:\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.InputLegacyModule.dll + + + ..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.PhysicsModule.dll + + + + + + True + True + Resource1.resx + + + + + + ResXFileCodeGenerator + Resource1.Designer.cs + + + + + + + + + diff --git a/PathCamDisabler/PathCamDisabler.sln b/PathCamDisabler/PathCamDisabler.sln new file mode 100644 index 0000000..1f80bd8 --- /dev/null +++ b/PathCamDisabler/PathCamDisabler.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32630.192 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PathCamDisabler", "PathCamDisabler.csproj", "{010592B6-9D1E-49D8-B4B2-6D5A6BCF5405}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {010592B6-9D1E-49D8-B4B2-6D5A6BCF5405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {010592B6-9D1E-49D8-B4B2-6D5A6BCF5405}.Debug|Any CPU.Build.0 = Debug|Any CPU + {010592B6-9D1E-49D8-B4B2-6D5A6BCF5405}.Release|Any CPU.ActiveCfg = Release|Any CPU + {010592B6-9D1E-49D8-B4B2-6D5A6BCF5405}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {116A47FE-B7C5-4C2A-8437-5D5357FE783F} + EndGlobalSection +EndGlobal diff --git a/PathCamDisabler/Properties/AssemblyInfo.cs b/PathCamDisabler/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..652ae4d --- /dev/null +++ b/PathCamDisabler/Properties/AssemblyInfo.cs @@ -0,0 +1,30 @@ +using PathCamDisabler.Properties; +using MelonLoader; +using System.Reflection; + + +[assembly: AssemblyVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyFileVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyInformationalVersion(AssemblyInfoParams.Version)] +[assembly: AssemblyTitle(nameof(PathCamDisabler))] +[assembly: AssemblyCompany(AssemblyInfoParams.Author)] +[assembly: AssemblyProduct(nameof(PathCamDisabler))] + +[assembly: MelonInfo( + typeof(PathCamDisabler.PathCamDisabler), + nameof(PathCamDisabler), + AssemblyInfoParams.Version, + AssemblyInfoParams.Author, + downloadLink: "https://github.com/NotAKidOnSteam/PathCamDisabler" +)] + +[assembly: MelonGame("Alpha Blend Interactive", "ChilloutVR")] +[assembly: MelonPlatform(MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] +[assembly: MelonPlatformDomain(MelonPlatformDomainAttribute.CompatibleDomains.MONO)] + +namespace PathCamDisabler.Properties; +internal static class AssemblyInfoParams +{ + public const string Version = "1.0.0"; + public const string Author = "NotAKidoS"; +} \ No newline at end of file diff --git a/PathCamDisabler/format.json b/PathCamDisabler/format.json new file mode 100644 index 0000000..b493eea --- /dev/null +++ b/PathCamDisabler/format.json @@ -0,0 +1,23 @@ +{ + "_id": -1, + "name": "PathCamDisabler", + "modversion": "1.0.0", + "gameversion": "2022r169", + "loaderversion": "0.5.7", + "modtype": "Mod", + "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.", + "searchtags": [ + "numpad", + "camera", + "pathing", + "path" + ], + "requirements": [ + "None" + ], + "downloadlink": "https://github.com/NotAKidOnSteam/PathCamDisabler/releases/download/r1/PathCamDisabler.dll", + "sourcelink": "https://github.com/NotAKidOnSteam/PathCamDisabler/", + "changelog": "sign initials here", + "embedcolor": "#9b59b6" +} \ No newline at end of file