From 8f44025dd464f97b7370a3c4834298282fa4433f Mon Sep 17 00:00:00 2001 From: Ilyaki Date: Tue, 31 Aug 2021 16:09:16 +0100 Subject: [PATCH] Added DontShowCursorWhenImageUpdated option from Proto Input --- Master/NucleusCoopTool/Forms/MainForm.cs | 2 +- .../Coop/Generic/GenericGameHandler.cs | 2 +- Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs | 14 ++++++++++++++ .../Coop/ProtoInput/ProtoInputLauncher.cs | 2 ++ .../Coop/ProtoInput/ProtoInputOptions.cs | 1 + Submodules/ProtoInput | 2 +- 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Master/NucleusCoopTool/Forms/MainForm.cs b/Master/NucleusCoopTool/Forms/MainForm.cs index b417c05f..0b890f32 100644 --- a/Master/NucleusCoopTool/Forms/MainForm.cs +++ b/Master/NucleusCoopTool/Forms/MainForm.cs @@ -28,7 +28,7 @@ namespace Nucleus.Coop /// public partial class MainForm : BaseForm { - public string version = "v1.1.1"; + public string version = "v1.1.2"; private Settings settingsForm = null; diff --git a/Master/NucleusGaming/Coop/Generic/GenericGameHandler.cs b/Master/NucleusGaming/Coop/Generic/GenericGameHandler.cs index a868f32b..383a735c 100644 --- a/Master/NucleusGaming/Coop/Generic/GenericGameHandler.cs +++ b/Master/NucleusGaming/Coop/Generic/GenericGameHandler.cs @@ -1757,7 +1757,7 @@ public string Play() if(isDebug) { - Log("NucleusCoop mod version: 1.1.1"); + Log("NucleusCoop mod version: 1.1.2"); Log("########## START OF SCRIPT ##########"); string line; diff --git a/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs b/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs index 54948187..cd5899f4 100644 --- a/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs +++ b/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs @@ -156,6 +156,9 @@ public static extern void StartFocusMessageLoop(uint instanceHandle, int millise [DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern void SetUseOpenXinput(uint instanceHandle, bool useOpenXinput); + [DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void SetShowCursorWhenImageUpdated(uint instanceHandle, bool enable); + // Both of these functions require RenameHandlesHookHookID hook [DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern void AddHandleToRename(uint instanceHandle, string name); @@ -333,6 +336,9 @@ public static extern void SetDinputDeviceGUID(uint instanceHandle, [DllImport("ProtoInputLoader64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern void SetRawInputBypass(uint instanceHandle, bool enabled); + [DllImport("ProtoInputLoader64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void SetShowCursorWhenImageUpdated(uint instanceHandle, bool enable); + [DllImport("ProtoInputUtilDynamic64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern uint LockInput(bool lockInput); @@ -597,6 +603,14 @@ public void SetUseOpenXinput(uint instanceHandle, bool useOpenXinput) ProtoInput64.SetUseOpenXinput(instanceHandle, useOpenXinput); } + public void SetShowCursorWhenImageUpdated(uint instanceHandle, bool enable) + { + if (IntPtr.Size == 4) + ProtoInput32.SetShowCursorWhenImageUpdated(instanceHandle, enable); + else + ProtoInput64.SetShowCursorWhenImageUpdated(instanceHandle, enable); + } + /// /// Require RenameHandlesHookHookID hook /// diff --git a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs index dae766b8..36f06472 100644 --- a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs +++ b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs @@ -106,6 +106,8 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi if (gen.ProtoInput.GetKeyStateHook) ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.GetKeyStateHookID); if (gen.ProtoInput.GetAsyncKeyStateHook) ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.GetAsyncKeyStateHookID); if (gen.ProtoInput.GetKeyboardStateHook) ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.GetKeyboardStateHookID); + + ProtoInput.protoInput.SetShowCursorWhenImageUpdated(instanceHandle, !gen.ProtoInput.DontShowCursorWhenImageUpdated); if (gen.ProtoInput.CursorVisibilityHook) ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.CursorVisibilityStateHookID); ProtoInput.protoInput.SetCursorClipOptions(instanceHandle, gen.ProtoInput.ClipCursorHookCreatesFakeClip); diff --git a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs index 23930b75..13c87d7e 100644 --- a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs +++ b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs @@ -67,6 +67,7 @@ public class ProtoInputOptions public bool ExtendFakeCursorBounds; public bool EnableToggleFakeCursorVisibilityShortcut; public uint ToggleFakeCursorVisibilityShortcutVkey = 0x24; // VK_HOME + public bool DontShowCursorWhenImageUpdated; public bool UseDinputRedirection; diff --git a/Submodules/ProtoInput b/Submodules/ProtoInput index 10b1e9e8..9e62bf12 160000 --- a/Submodules/ProtoInput +++ b/Submodules/ProtoInput @@ -1 +1 @@ -Subproject commit 10b1e9e88a3e8876d982ad411cc5563cd9fe01d3 +Subproject commit 9e62bf1285537a6bcad7208677b7a465abb53651