From a7e3ee435e9e24c94ed8ecac69389c8fff03b017 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Sun, 8 May 2022 18:43:21 +0200 Subject: [PATCH] Unlock cursor crashing the game fixed --- DevourClient/Hacks/Misc.cs | 12 ------------ DevourClient/Hooks/Hooks.cs | 17 +++++++++++++++++ DevourClient/MelonMain.cs | 20 ++++++++++++-------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index e9a67c1..f50ede8 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -136,18 +136,6 @@ namespace DevourClient.Hacks public PlayRandomAudioClip laughClips; */ - /* - NolanBehaviour[] Nolan_t = UnityEngine.Object.FindObjectsOfType(); - - for (int i = 0; i < Nolan_t.Length; i++) - { - NolanBehaviour Nolan = Nolan_t[i]; - - MelonLogger.Msg("-------------------------"); - MelonLogger.Msg("isClient : " + Nolan.gameUI.isClient); - MelonLogger.Msg("senderName : " + Nolan.gameUI.name); - } - */ PlayRandomAudioClip playRandomAudioClip = UnityEngine.Object.FindObjectOfType(); NolanVoiceOvers nolanVoiceOvers = UnityEngine.Object.FindObjectOfType(); diff --git a/DevourClient/Hooks/Hooks.cs b/DevourClient/Hooks/Hooks.cs index 4d9785d..994a908 100644 --- a/DevourClient/Hooks/Hooks.cs +++ b/DevourClient/Hooks/Hooks.cs @@ -18,6 +18,23 @@ namespace DevourClient.Hooks } } */ + /* + [HarmonyPatch(typeof(RankHelpers))] + [HarmonyPatch(nameof(RankHelpers.CalculateExpGain))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. + static class RankHelpers_CalculateExpGain + { + static void Postfix(ref RankHelpers.ExpGainInfo __result) + { + __result.baseExp = 200; + __result.winBonus = 200; + __result.awardsBonus = 200; + __result.totalExp = 200; + __result.gameModeBonus = 200; + MelonLoader.MelonLogger.Msg("called"); + return; + } + } + */ [HarmonyPatch(typeof(Horror.Menu))] [HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. diff --git a/DevourClient/MelonMain.cs b/DevourClient/MelonMain.cs index 3fceafd..1dfc489 100644 --- a/DevourClient/MelonMain.cs +++ b/DevourClient/MelonMain.cs @@ -31,16 +31,20 @@ namespace DevourClient if (Input.GetKeyDown(KeyCode.Insert)) { - GameUI gameUI = UnityEngine.Object.FindObjectOfType(); + try + { + GameUI gameUI = UnityEngine.Object.FindObjectOfType(); - if (Settings.Settings.menu_enable) - { - gameUI.HideMouseCursor(); - } - else - { - gameUI.ShowMouseCursor(); + if (Settings.Settings.menu_enable) + { + gameUI.HideMouseCursor(); + } + else + { + gameUI.ShowMouseCursor(); + } } + catch { } Settings.Settings.menu_enable = !Settings.Settings.menu_enable; }