From 477a6859d724f4561b4bb33fa7dd10336d8c34b4 Mon Sep 17 00:00:00 2001 From: sinaioutlander <49360850+sinaioutlander@users.noreply.github.com> Date: Mon, 14 Sep 2020 17:07:52 +1000 Subject: [PATCH] Update README.md --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 90af844..3522dc8 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,23 @@ CppExplorer can force the mouse to be visible and unlocked when the menu is open * For Hellpoint, use [HPExplorerMouseControl](https://github.com/sinai-dev/Hellpoint-Mods/tree/master/HPExplorerMouseControl/HPExplorerMouseControl) * You can create your own plugin using one of the two plugins above as an example. Usually only a few simple Harmony patches are needed to fix the problem. +For example: +```csharp +using Explorer; +using Harmony; +// ... +[HarmonyPatch(typeof(MyGame.MenuClass), nameof(MyGame.MenuClass.CursorUpdate)] +public class MenuClass_CursorUpdate +{ + [HarmonyPrefix] + public static bool Prefix() + { + // prevent method running if menu open, let it run if not. + return !CppExplorer.ShowMenu; + } +} +``` + ## Building If you'd like to build this yourself, everything you need (other than MelonLoader) is included with this repository, there is no need for recursive cloning etc.