diff --git a/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs b/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs index e373bee7..ecc2fb4e 100644 --- a/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs +++ b/Master/NucleusGaming/Coop/ProtoInput/ProtoInput.cs @@ -254,6 +254,9 @@ public static extern void SetDinputDeviceGUID(uint instanceHandle, [DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAdjustWindowRectSettings(uint instanceHandle, int posx, int posy, int width, int height); + + [DllImport("ProtoInputLoader32.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableGuiWindow(uint instanceHandle, bool enable); } private static class ProtoInput64 @@ -427,6 +430,9 @@ public static extern void SetDinputDeviceGUID(uint instanceHandle, [DllImport("ProtoInputLoader64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] public static extern void SetAdjustWindowRectSettings(uint instanceHandle, int posx, int posy, int width, int height); + + [DllImport("ProtoInputLoader64.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Cdecl)] + public static extern void DisableGuiWindow(uint instanceHandle, bool enable); } public uint LockInput(bool lockInput) @@ -1128,6 +1134,17 @@ public void SetAdjustWindowRectSettings(uint instanceHandle, int posx, int posy, ProtoInput64.SetAdjustWindowRectSettings(instanceHandle, posx, posy, width, height); } } - + + public void DisableGuiWindow(uint instanceHandle, bool enable) + { + if (IntPtr.Size == 4) + { + ProtoInput32.DisableGuiWindow(instanceHandle, enable); + } + else + { + ProtoInput64.DisableGuiWindow(instanceHandle, enable); + } + } } } diff --git a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs index 9c515b33..d12d050e 100644 --- a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs +++ b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputLauncher.cs @@ -157,6 +157,8 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi ProtoInput.protoInput.SetupState(instanceHandle, instanceIndex); + ProtoInput.protoInput.DisableGuiWindow(instanceHandle, gen.ProtoInput.DisableGuiWindow); + if (gen.ProtoInput.RegisterRawInputHook) { ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.RegisterRawInputHookID); @@ -265,7 +267,7 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi ProtoInput.protoInput.SetSetWindowPosDontResize(instanceHandle, gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontResize); ProtoInput.protoInput.SetSetWindowPosDontReposition(instanceHandle, gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontReposition); ProtoInput.protoInput.SetSetWindowPosSettings(instanceHandle, player.MonitorBounds.X, player.MonitorBounds.Y, player.MonitorBounds.Width, player.MonitorBounds.Height); - + if (gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontResize || gen.ProtoInput.SetWindowPosHook == SetWindowPosHook.DontReposition || gen.ProtoInput.SetWindowPosHook != 0) { ProtoInput.protoInput.InstallHook(instanceHandle, ProtoInput.ProtoHookIDs.SetWindowPosHookID); @@ -360,11 +362,11 @@ private static void SetupInstance(uint instanceHandle, int instanceIndex, Generi gen.ProtoInput.FocusLoop_WM_MOUSEACTIVATE); } - ProtoInput.protoInput.SetDrawFakeCursorFix(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix); - ProtoInput.protoInput.SetDrawFakeCursor(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix || gen.ProtoInput.DrawFakeCursor != 0); ProtoInput.protoInput.SetDefaultTopLeftMouseBounds(instanceHandle, gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreTopLeft); ProtoInput.protoInput.SetDefaultBottomRightMouseBounds(instanceHandle, gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreBottomRight); ProtoInput.protoInput.SetPutMouseInsideWindow(instanceHandle, gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreTopLeft || gen.ProtoInput.PutMouseInsideWindow == PutMouseInsideWindow.IgnoreBottomRight || gen.ProtoInput.PutMouseInsideWindow != 0); + ProtoInput.protoInput.SetDrawFakeCursorFix(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix); + ProtoInput.protoInput.SetDrawFakeCursor(instanceHandle, gen.ProtoInput.DrawFakeCursor == DrawFakeCursor.Fix || gen.ProtoInput.DrawFakeCursor != 0); ProtoInput.protoInput.AllowFakeCursorOutOfBounds(instanceHandle, gen.ProtoInput.AllowFakeCursorOutOfBounds, gen.ProtoInput.ExtendFakeCursorBounds); ProtoInput.protoInput.SetToggleFakeCursorVisibilityShortcut(instanceHandle, gen.ProtoInput.EnableToggleFakeCursorVisibilityShortcut, diff --git a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs index e959b248..c91bd66e 100644 --- a/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs +++ b/Master/NucleusGaming/Coop/ProtoInput/ProtoInputOptions.cs @@ -78,6 +78,8 @@ public class ProtoInputOptions public bool DinputHookAlsoHooksGetDeviceState; public bool FreezeExternalInputWhenInputNotLocked; + + public bool DisableGuiWindow; public Action OnInputLocked; public Action OnInputUnlocked;