Cancel pending generic when edit button pressed

This commit is contained in:
Sinai 2022-04-24 01:58:27 +10:00
parent e92556805b
commit 14f46ade6a
2 changed files with 5 additions and 0 deletions

View File

@ -39,6 +39,8 @@ namespace UnityExplorer.Hooks
internal static Type pendingGenericDefinition;
internal static MethodInfo pendingGenericMethod;
public static bool PendingGeneric => pendingGenericDefinition != null || pendingGenericMethod != null;
// Hook Source Editor UI
public static GameObject EditorRoot { get; private set; }
public static Text EditingHookLabel { get; private set; }

View File

@ -47,6 +47,9 @@ namespace UnityExplorer.Hooks
public static void EditPatchClicked(int index)
{
if (HookCreator.PendingGeneric)
HookManagerPanel.genericArgsHandler.Cancel();
HookManagerPanel.Instance.SetPage(HookManagerPanel.Pages.HookSourceEditor);
HookInstance hook = (HookInstance)currentHooks[index];
HookCreator.SetEditedHook(hook);