Implement Migration of PluginLoader configs (UI is temporary atm)
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
This commit is contained in:
2024-11-09 18:23:40 -05:00
parent 2e4c7f5e15
commit c25bf3bb3d
9 changed files with 126 additions and 16 deletions

View File

@@ -45,7 +45,7 @@ internal class ImGuiHandler : IDisposable
_init = true;
}
public void HookWindow(HWND windowHandle)
public static void HookWindow(HWND windowHandle)
{
_wndproc = PInvoke.GetWindowLongPtr(windowHandle, WINDOW_LONG_PTR_INDEX.GWL_WNDPROC);
@@ -96,8 +96,8 @@ internal class ImGuiHandler : IDisposable
var blockMessage = (msg is >= 256 and <= 265 && io.WantTextInput)
|| (msg is >= 512 and <= 526 && io.WantCaptureMouse);
if (!blockMessage)
Console.WriteLine($"{msg} - M:{io.WantCaptureMouse}, K:{io.WantTextInput}");
/*if (!blockMessage)
Console.WriteLine($"{msg} - M:{io.WantCaptureMouse}, K:{io.WantTextInput}");*/
return blockMessage ? hookResult : CallWindowProc(_wndproc, hWnd, msg, wParam, lParam);
}

View File

@@ -73,7 +73,7 @@ public class Launcher : ICorePlugin
var splash = new Splash();
splash.DefineStage(_lifetime = new PluginsLifetime());
splash.DefineStage(_lifetime = new PluginsLifetime(Path.GetDirectoryName(args[0])!));
InitTexts();
SpaceEngineersGame.SetupBasicGameInfo();

View File

@@ -19,6 +19,6 @@ public class RenderHookPatch
[HarmonyPostfix, HarmonyPatch(typeof(MyGameForm), "OnLoad")]
private static void LoadPostfix(MyGameForm __instance)
{
ImGuiHandler.Instance?.HookWindow((HWND)__instance.Handle);
ImGuiHandler.HookWindow((HWND)__instance.Handle);
}
}