Unlock cursor crashing the game fixed

This commit is contained in:
ALittlePatate
2022-05-08 18:43:21 +02:00
parent 06c6b1e334
commit a7e3ee435e
3 changed files with 29 additions and 20 deletions

View File

@@ -136,18 +136,6 @@ namespace DevourClient.Hacks
public PlayRandomAudioClip laughClips; public PlayRandomAudioClip laughClips;
*/ */
/*
NolanBehaviour[] Nolan_t = UnityEngine.Object.FindObjectsOfType<NolanBehaviour>();
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<PlayRandomAudioClip>(); PlayRandomAudioClip playRandomAudioClip = UnityEngine.Object.FindObjectOfType<PlayRandomAudioClip>();
NolanVoiceOvers nolanVoiceOvers = UnityEngine.Object.FindObjectOfType<NolanVoiceOvers>(); NolanVoiceOvers nolanVoiceOvers = UnityEngine.Object.FindObjectOfType<NolanVoiceOvers>();

View File

@@ -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(typeof(Horror.Menu))]
[HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs. [HarmonyPatch(nameof(Horror.Menu.SetupPerk))] //annotation boiler plate to tell Harmony what to patch. Refer to docs.

View File

@@ -30,6 +30,8 @@ namespace DevourClient
boltconfig.serverConnectionLimit = 20; boltconfig.serverConnectionLimit = 20;
if (Input.GetKeyDown(KeyCode.Insert)) if (Input.GetKeyDown(KeyCode.Insert))
{
try
{ {
GameUI gameUI = UnityEngine.Object.FindObjectOfType<GameUI>(); GameUI gameUI = UnityEngine.Object.FindObjectOfType<GameUI>();
@@ -41,6 +43,8 @@ namespace DevourClient
{ {
gameUI.ShowMouseCursor(); gameUI.ShowMouseCursor();
} }
}
catch { }
Settings.Settings.menu_enable = !Settings.Settings.menu_enable; Settings.Settings.menu_enable = !Settings.Settings.menu_enable;
} }