first
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

This commit is contained in:
zznty
2022-10-28 01:58:54 +07:00
commit e5c4f0c07c
81 changed files with 6162 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
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);
}
}