fix: resolve AccessViolationException by removing problematic interface patch and using native game state management
This commit is contained in:
Binary file not shown.
@@ -23,10 +23,6 @@ internal static class HookIntegration
|
||||
// [GREG_SYNC_INSERT_PATCHES]
|
||||
|
||||
SafePatch(harmony, typeof(Il2Cpp.Player), nameof(Il2Cpp.Player.UpdateCoin), typeof(gregCore.GameLayer.Patches.Economy.PlayerPatch), nameof(gregCore.GameLayer.Patches.Economy.PlayerPatch.OnCoinUpdated));
|
||||
|
||||
// Block Pause-Menu when Console is open
|
||||
// NOTE: Interface patching via IUIActions might cause native crashes in Unity 6.
|
||||
// SafePatch(harmony, typeof(global::Il2Cpp.InputController.IUIActions), nameof(global::Il2Cpp.InputController.IUIActions.OnPause), typeof(gregCore.GameLayer.Patches.UI.InputPausePatch), nameof(gregCore.GameLayer.Patches.UI.InputPausePatch.Prefix), isPrefix: true);
|
||||
}
|
||||
|
||||
internal static void Emit(HookName hook, EventPayload payload)
|
||||
|
||||
@@ -37,9 +37,23 @@ internal sealed class GregDevConsole
|
||||
public void Toggle()
|
||||
{
|
||||
IsOpen = !IsOpen;
|
||||
|
||||
var mgm = global::Il2Cpp.MainGameManager.instance;
|
||||
|
||||
if (IsOpen)
|
||||
{
|
||||
_input = "";
|
||||
if (mgm != null) mgm.isPauseMenuDisallowed = true;
|
||||
|
||||
global::UnityEngine.Cursor.visible = true;
|
||||
global::UnityEngine.Cursor.lockState = global::UnityEngine.CursorLockMode.None;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mgm != null) mgm.isPauseMenuDisallowed = false;
|
||||
|
||||
global::UnityEngine.Cursor.visible = false;
|
||||
global::UnityEngine.Cursor.lockState = global::UnityEngine.CursorLockMode.Locked;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user