public void EditPatchClicked(int index) { Panel.SetPage(HookManagerPanel.Pages.HookSourceEditor); var hook = (HookInstance)currentHooks[index]; currentEditedHook = hook; Panel.EditorInput.Text = hook.PatchSourceCode; }
public void EditorInputSave() { var input = Panel.EditorInput.Text; bool wasEnabled = currentEditedHook.Enabled; if (currentEditedHook.CompileAndGenerateProcessor(input)) { if (wasEnabled) { currentEditedHook.Patch(); } currentEditedHook.PatchSourceCode = input; currentEditedHook = null; Panel.SetPage(HookManagerPanel.Pages.CurrentHooks); } }
public void AddHook(MethodInfo method) { var sig = method.FullDescription(); if (hookedSignatures.Contains(sig)) { return; } var hook = new HookInstance(method); if (hook.Enabled) { hookedSignatures.Add(sig); currentHooks.Add(sig, hook); } }
public void EditorInputCancel() { currentEditedHook = null; Panel.SetPage(HookManagerPanel.Pages.CurrentHooks); }