-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.cs
More file actions
52 lines (48 loc) · 1.75 KB
/
Plugin.cs
File metadata and controls
52 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using BepInEx;
using HarmonyLib;
using UnityEngine;
using UnityEngine.VR;
[BepInPlugin("com.ctm.patchdebugcameracontrol", "patch.DebugCameraControl", "1.0.1")]
public class CtmPatchDebugCameraControl : BaseUnityPlugin
{
private void Awake()
{
Logger.LogInfo("DebugCameraControl patch - https://github.com/CoachsTimeMachine/patch.debugcameracontrol");
var harmony = new Harmony("com.ctm.patchdebugcameracontrol");
harmony.PatchAll();
Logger.LogInfo("Patched all methods!");
}
}
//Always return true on VRDevice.isPresent to make the game think a VR headset is always connected.
[HarmonyPatch(typeof(VRDevice), nameof(VRDevice.isPresent), MethodType.Getter)]
public class Patch_VRDevice_isPresent
{
static bool Prefix(ref bool __result)
{
__result = true;
return false;
}
}
//Always return ControllerIO.DNOKPKDGGKB.Debug when OLCOCPIALFA is called
[HarmonyPatch(typeof(ControllerIO), nameof(ControllerIO.OLCOCPIALFA), MethodType.Getter)]
public class Patch_ControllerIO_Debug
{
static bool Prefix(ref ControllerIO.DNOKPKDGGKB __result)
{
__result = ControllerIO.DNOKPKDGGKB.Debug;
return false;
}
}
// Force set DebugCameraControl.Awake flag to be true to prevent it from destroying itself (enabling DebugCameraControl).
[HarmonyPatch(typeof(DebugCameraControl), "Awake")]
public class Patch_DebugCameraControl_Awake
{
static bool Prefix(DebugCameraControl __instance)
{
// Skip the original Awake (which would Destroy the component).
// Set IBFMMGKIJME = true so the free-cam starts enabled immediately.
AccessTools.Property(typeof(DebugCameraControl), "IBFMMGKIJME")
.SetValue(__instance, true, null);
return false;
}
}