
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 4m1s
Build / Build Nuget package (CringePlugins) (push) Successful in 4m1s
Build / Build Nuget package (SharedCringe) (push) Successful in 3m59s
Build / Build Launcher (push) Successful in 5m3s
Build / Build Nuget package (NuGet) (push) Successful in 8m58s
22 lines
569 B
C#
22 lines
569 B
C#
using Windows.Win32.Foundation;
|
|
using HarmonyLib;
|
|
using SharpDX.DXGI;
|
|
using VRage.Platform.Windows.Forms;
|
|
|
|
namespace CringeLauncher.Patches;
|
|
|
|
[HarmonyPatch]
|
|
public static 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);
|
|
}
|
|
} |