
Some checks failed
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m12s
Build / Build Nuget package (NuGet) (push) Successful in 1m55s
Build / Build Nuget package (SharedCringe) (push) Has been cancelled
Build / Build Nuget package (CringePlugins) (push) Has been cancelled
Build / Build Launcher (push) Has been cancelled
22 lines
572 B
C#
22 lines
572 B
C#
using Windows.Win32.Foundation;
|
|
using HarmonyLib;
|
|
using SharpDX.DXGI;
|
|
using VRage.Platform.Windows.Forms;
|
|
|
|
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.Instance?.HookWindow((HWND)__instance.Handle);
|
|
}
|
|
} |