
All checks were successful
Build / Compute Version (push) Successful in 4s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 2m47s
Build / Build Nuget package (CringePlugins) (push) Successful in 5m31s
Build / Build Nuget package (NuGet) (push) Successful in 6m2s
Build / Build Nuget package (SharedCringe) (push) Successful in 7m25s
Build / Build Launcher (push) Successful in 9m11s
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);
|
|
}
|
|
} |