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

View File

@@ -31,16 +31,20 @@ namespace DevourClient
if (Input.GetKeyDown(KeyCode.Insert))
{
GameUI gameUI = UnityEngine.Object.FindObjectOfType<GameUI>();
try
{
GameUI gameUI = UnityEngine.Object.FindObjectOfType<GameUI>();
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;
}