Work on handling inputs
We still need to intercept SharpDX inputs
This commit is contained in:
@@ -21,32 +21,4 @@ public class RenderHookPatch
|
||||
{
|
||||
ImGuiHandler.Instance?.HookWindow((HWND)__instance.Handle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HarmonyPatch]
|
||||
public static class RenderMessagePatches
|
||||
{
|
||||
[HarmonyTargetMethods]
|
||||
private static IEnumerable<MethodInfo> TargetMethods()
|
||||
{
|
||||
yield return AccessTools.Method(typeof(MyGameForm), nameof(MyGameWindow.WndProc));
|
||||
yield return AccessTools.Method(typeof(RenderForm), "WndProc");
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
private static bool WndProcPrefix(MyGameForm __instance, ref Message m)
|
||||
{
|
||||
if (ImGuiHandler.Instance is not { } handler)
|
||||
return true;
|
||||
|
||||
if (m.Msg is >= 256 and <= 265)
|
||||
return !handler.Io.WantTextInput;
|
||||
|
||||
if (__instance.ShowCursor && m.Msg is >= 512 and <= 526)
|
||||
return !handler.Io.WantCaptureMouse;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user