Add power bar suppression API, pin imgui.ini, bump SDK to v56

- New PowerbarHooks scaffold hooking gmPowerbarUI's RecvNotice_Begin/Level/
  Finish trio. SetPowerbarSuppressed exposed via the plugin contract; current
  implementation no-ops the notices (a deeper SetVisible/HidePowerBar path
  crashed on the captured pointer, so full hide is parked for later).
- ImGuiController pins io.IniFilename to a stable absolute path
  (C:\Games\RynthSuite\RynthAi\imgui.ini) so window positions, sizes, and
  dock layout persist across RL hot-reload and AC restarts. Default ImGui
  behavior wrote into the host process working dir which varied per launch.
- PluginContract version bumped to 56 with SetPowerbarSuppressedFn added to
  RynthCoreAPI; SDK exposes Has/Set methods on RynthCoreHost.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
tombohar 2026-04-25 10:03:58 -04:00
commit cd3ccfd550
7 changed files with 276 additions and 3 deletions

View file

@ -497,6 +497,12 @@ internal struct RynthCoreAPI
/// gmMainChatUI each frame, hiding the retail chatbox entirely.
/// Requires API v55+.</summary>
public IntPtr SetChatSuppressedFn;
/// <summary>Function pointer: void SetPowerbarSuppressed(int enabled)
/// When enabled=1, the engine no-ops gmPowerbarUI's RecvNotice_(Begin/
/// Level/Finish), so the retail attack/magic power bar never renders.
/// Requires API v56+.</summary>
public IntPtr SetPowerbarSuppressedFn;
}
@ -504,7 +510,7 @@ internal struct RynthCoreAPI
/// <summary>Current API version. Bump when adding fields to RynthCoreAPI.</summary>
internal static class PluginContractVersion
{
public const uint Current = 55;
public const uint Current = 56;
}
internal static class ClientActionHookFlags
@ -907,5 +913,8 @@ internal unsafe delegate int GetRadarRectCallbackDelegate(int* x0, int* y0, int*
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetRadarSuppressedCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetPowerbarSuppressedCallbackDelegate(int enabled);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void SetChatSuppressedCallbackDelegate(int enabled);

View file

@ -119,6 +119,7 @@ internal static class PluginManager
private static GetRadarRectCallbackDelegate? _getRadarRectCallback;
private static SetRadarSuppressedCallbackDelegate? _setRadarSuppressedCallback;
private static SetChatSuppressedCallbackDelegate? _setChatSuppressedCallback;
private static SetPowerbarSuppressedCallbackDelegate? _setPowerbarSuppressedCallback;
private static SetMotionCallbackDelegate? _setMotionCallback;
private static StopCompletelyCallbackDelegate? _stopCompletelyCallback;
private static TurnToHeadingCallbackDelegate? _turnToHeadingCallback;
@ -1683,6 +1684,7 @@ internal static class PluginManager
_getRadarRectCallback ??= GetRadarRect;
_setRadarSuppressedCallback ??= SetRadarSuppressed;
_setChatSuppressedCallback ??= SetChatSuppressed;
_setPowerbarSuppressedCallback ??= SetPowerbarSuppressed;
_setMotionCallback ??= SetMotion;
_stopCompletelyCallback ??= StopCompletely;
_turnToHeadingCallback ??= TurnToHeading;
@ -1857,6 +1859,7 @@ internal static class PluginManager
_api.GetRadarRectFn = Marshal.GetFunctionPointerForDelegate(_getRadarRectCallback);
_api.SetRadarSuppressedFn = Marshal.GetFunctionPointerForDelegate(_setRadarSuppressedCallback);
_api.SetChatSuppressedFn = Marshal.GetFunctionPointerForDelegate(_setChatSuppressedCallback);
_api.SetPowerbarSuppressedFn = Marshal.GetFunctionPointerForDelegate(_setPowerbarSuppressedCallback);
}
private static void ProbeClientHooks()
@ -2238,6 +2241,15 @@ internal static class PluginManager
ChatHooks.SuppressOriginalChat = enabled != 0;
}
private static void SetPowerbarSuppressed(int enabled)
{
bool was = PowerbarHooks.SuppressOriginalDraw;
bool now = enabled != 0;
PowerbarHooks.SuppressOriginalDraw = now;
if (was != now)
RynthLog.Compat($"Compat: powerbar suppress -> {now}");
}
private static int SetMotion(uint motion, int enabled)
{
return ToAbiBool(ClientActionHooks.SetMotion(motion, enabled != 0));