All checks were successful
Build / Compute Version (push) Successful in 5s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 1m24s
Build / Build Nuget package (NuGet) (push) Successful in 2m8s
Build / Build Nuget package (CringePlugins) (push) Successful in 3m21s
Build / Build Nuget package (SharedCringe) (push) Successful in 2m32s
Build / Build Launcher (push) Successful in 3m31s
Add profiles to Config Error handling for package resolution Remove debug code from wndproc hook
24 lines
610 B
C#
24 lines
610 B
C#
using Windows.Win32.Foundation;
|
|
using HarmonyLib;
|
|
using SharpDX.DXGI;
|
|
using VRage.Platform.Windows.Forms;
|
|
using SharpDX.Windows;
|
|
using System.Reflection;
|
|
|
|
namespace CringeLauncher.Patches;
|
|
|
|
[HarmonyPatch]
|
|
public class RenderHookPatch
|
|
{
|
|
[HarmonyPrefix, HarmonyPatch(typeof(SwapChain), nameof(SwapChain.Present))]
|
|
private static void PresentPrefix()
|
|
{
|
|
ImGuiHandler.Instance?.DoRender();
|
|
}
|
|
|
|
[HarmonyPostfix, HarmonyPatch(typeof(MyGameForm), "OnLoad")]
|
|
private static void LoadPostfix(MyGameForm __instance)
|
|
{
|
|
ImGuiHandler.HookWindow((HWND)__instance.Handle);
|
|
}
|
|
} |