From 6d10d39a5e1834342df3f0a31ebd965a1e3adf29 Mon Sep 17 00:00:00 2001 From: thojm Date: Sat, 7 Aug 2021 00:51:47 -0400 Subject: [PATCH] removed unused hooks --- KK_VREnhancement/KK_VREnhancement.csproj | 1 - KK_VREnhancement/VRController.Hooks.cs | 52 ------------------------ 2 files changed, 53 deletions(-) delete mode 100644 KK_VREnhancement/VRController.Hooks.cs diff --git a/KK_VREnhancement/KK_VREnhancement.csproj b/KK_VREnhancement/KK_VREnhancement.csproj index ec65815..5003817 100644 --- a/KK_VREnhancement/KK_VREnhancement.csproj +++ b/KK_VREnhancement/KK_VREnhancement.csproj @@ -82,7 +82,6 @@ - diff --git a/KK_VREnhancement/VRController.Hooks.cs b/KK_VREnhancement/VRController.Hooks.cs deleted file mode 100644 index 799c0c6..0000000 --- a/KK_VREnhancement/VRController.Hooks.cs +++ /dev/null @@ -1,52 +0,0 @@ -using HarmonyLib; -using UnityEngine; -using System.Reflection.Emit; -using System.Collections.Generic; -using KKAPI.MainGame; -using VRGIN.Controls.Tools; - -namespace KK_VREnhancement -{ - public static class VRControllerHooks - { - public static Harmony harmonyInstance; - - internal static void InitHooks(Harmony _harmonyInstance = null) - { - if (_harmonyInstance != null) harmonyInstance = _harmonyInstance; - - if (harmonyInstance == null) return; - harmonyInstance.PatchAll(typeof(VRControllerHooks)); - } - - internal static void UnInitHooks(string harmonyGUID) - { - if (harmonyInstance == null) return; - harmonyInstance.UnpatchAll(harmonyGUID); - } - - //Prevent controller grip from taking MenuTool back (since it does rotation now) - [HarmonyTranspiler] - [HarmonyPatch(typeof(MenuTool), "OnUpdate")] - internal static IEnumerable PreventTakeMenuTook_Transpiler(IEnumerable instructions) - { - List instructionsList = new List(instructions); - - for (var i = 0; i < instructionsList.Count; i++) - { - if (VRPlugin.debugLog) VRPlugin.Logger.LogInfo($" {instructionsList[i].operand} "); - - if (instructionsList[i].opcode == OpCodes.Ldc_I4_4) - { - if (VRPlugin.debugLog) VRPlugin.Logger.LogInfo($" Transpiler matching operand found "); - instructionsList[i].opcode = OpCodes.Ldc_I4_7; - break; - } - } - - return instructionsList; - } - - - } -} \ No newline at end of file