Init repo
This commit is contained in:
59
Plugin.cs
Normal file
59
Plugin.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using BepInEx;
|
||||||
|
using BepInEx.Configuration;
|
||||||
|
using BepInEx.Logging;
|
||||||
|
using BepInEx.Unity.IL2CPP;
|
||||||
|
using HarmonyLib;
|
||||||
|
using RecRoom.Systems;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Radium.InputManagerPatch
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Patch for InputManager in Radium's 2021 build to set the input type to whatever you desire!
|
||||||
|
/// </summary>
|
||||||
|
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
|
||||||
|
public class Plugin : BasePlugin
|
||||||
|
{
|
||||||
|
internal static new ManualLogSource Log;
|
||||||
|
|
||||||
|
internal static readonly Harmony _harmony = new(MyPluginInfo.PLUGIN_GUID);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The input type we wish to set. If no value is provided, it defaults to SteamVR_Vive.
|
||||||
|
/// </summary>
|
||||||
|
internal static ConfigEntry<InputManager.LNEHPBFDEGG> VRInputDeviceType;
|
||||||
|
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
Log = base.Log;
|
||||||
|
|
||||||
|
// The valid input types to print in our config
|
||||||
|
var inputTypes = string.Join(", ", Enum.GetNames(typeof(InputManager.LNEHPBFDEGG)));
|
||||||
|
|
||||||
|
VRInputDeviceType = Config.Bind(
|
||||||
|
section: "Input",
|
||||||
|
key: "VRInputDeviceType",
|
||||||
|
defaultValue: InputManager.LNEHPBFDEGG.SteamVR_Vive,
|
||||||
|
description: $"Fixed input mode. Valid options are: {inputTypes}");
|
||||||
|
|
||||||
|
Log.LogInfo($"{MyPluginInfo.PLUGIN_GUID} loaded!");
|
||||||
|
#if DEBUG
|
||||||
|
Log.LogInfo(VRInputDeviceType.Value);
|
||||||
|
#endif
|
||||||
|
_harmony.PatchAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets GetVRInputMode (NACIMCNEHMP) of InputManager to whatever we desire!
|
||||||
|
/// </summary>
|
||||||
|
[HarmonyPatch(typeof(InputManager), "NACIMCNEHMP")]
|
||||||
|
public class InputManagerPatch()
|
||||||
|
{
|
||||||
|
private static bool Prefix(ref InputManager.LNEHPBFDEGG __result)
|
||||||
|
{
|
||||||
|
__result = Plugin.VRInputDeviceType.Value;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
Radium.InputManagerPatch.csproj
Normal file
28
Radium.InputManagerPatch.csproj
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<AssemblyName>Radium.InputManagerPatch</AssemblyName>
|
||||||
|
<Product>Awesome patch for InputManager in Radium's 2021 build to set the input type to whatever you desire!</Product>
|
||||||
|
<Version>1.0.0</Version>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
<RestoreAdditionalProjectSources>
|
||||||
|
https://api.nuget.org/v3/index.json;
|
||||||
|
https://nuget.bepinex.dev/v3/index.json;
|
||||||
|
https://nuget.samboy.dev/v3/index.json
|
||||||
|
</RestoreAdditionalProjectSources>
|
||||||
|
<RootNamespace>Radium.InputManagerPatch</RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
|
||||||
|
<PackageReference Include="BepInEx.PluginInfoProps" Version="2.*" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Assembly-CSharp">
|
||||||
|
<HintPath>AssemblyReferences\Assembly-CSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
Reference in New Issue
Block a user