feat(dashboard): Mini Remote drawer on the RynthAi dashboard (2026.10.5.21)
A fourth left-edge drawer holds RynthAi's whole Mini Remote (rates, target and summon bars, item slots, toggles, bank, rebuff, Translate, Guardian) with its Options menu. Right-click Hub opens it, as right-click Patrol opens the Patrol drawer; popped out it shows the floating Mini Remote. New optional plugin export RynthPluginRenderEmbed: the plugin draws a named surface into the engine's current ImGui window on the render thread and reports the size it wants. No RynthCoreAPI change. Pairs with RynthAi 0.5.27. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6eb0d1e3bb
commit
d46cd9114b
9 changed files with 236 additions and 8 deletions
|
|
@ -0,0 +1,56 @@
|
||||||
|
# RynthCore 2026.10.5.21: Mini Remote drawer on the RynthAi dashboard
|
||||||
|
|
||||||
|
Released 2026-10-08. Previous release: 2026.10.5.20 (T11 item state tooltip).
|
||||||
|
Pairs with RynthAi 0.5.27-legacy-ui.
|
||||||
|
|
||||||
|
## What's new
|
||||||
|
|
||||||
|
- **Mini Remote drawer.** The RynthAi dashboard has a fourth left-edge drawer,
|
||||||
|
under Ranges, Loaded files and Patrol. It holds RynthAi's whole Mini Remote:
|
||||||
|
- session rates with Reset XP / Report
|
||||||
|
- the attack target and summon health bars, with the summon's time left
|
||||||
|
- the 5 x 6 item slots (click to use, right-click to assign, drag items in)
|
||||||
|
- the macro toggles, bank balances and rebuff buttons
|
||||||
|
- the Translate row and the Guardian answer
|
||||||
|
- **Options inside the drawer.** The remote's Options button, or a right-click on
|
||||||
|
it, opens the same menu as the floating window: which sections show, the ILT Hub
|
||||||
|
windows, horizontal layout, Inventory HUDs setup, and "Floating window too".
|
||||||
|
- **Opening it.** Use the drawer tab, or right-click the **Hub** launcher (as
|
||||||
|
right-clicking Patrol opens its drawer). Left-click Hub still toggles the floating
|
||||||
|
Mini Remote. On a popped-out dashboard (no drawers), right-click Hub shows the
|
||||||
|
floating Mini Remote.
|
||||||
|
- The drawer sizes itself to the remote: one column when stacked, three side by side
|
||||||
|
in horizontal layout. It is never taller than the screen; past that it scrolls.
|
||||||
|
- The drawer's open / closed state is saved with the dashboard, as line 11 of
|
||||||
|
`rynthai_avalonia.cache`.
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Right-click **Hub** no longer opens Inventory HUDs setup directly. It is in the
|
||||||
|
Mini Remote's Options menu (and `/ra huds`).
|
||||||
|
|
||||||
|
## Plugin API
|
||||||
|
|
||||||
|
- New optional plugin export:
|
||||||
|
`int RynthPluginRenderEmbed(const char* surface, float width, float height, float* wantWidth, float* wantHeight)`
|
||||||
|
(Cdecl).
|
||||||
|
- The engine calls it on the render thread, inside a child window of the size
|
||||||
|
given, in the main ImGui context.
|
||||||
|
- The plugin draws the named UTF-8 surface there and reports the content size it
|
||||||
|
wants.
|
||||||
|
- Returns 1 if it drew, 0 if it isn't ready or doesn't know the surface.
|
||||||
|
- The export is resolved at load, like `RynthPluginRenderOverlay`.
|
||||||
|
- A plugin without it shows a "needs RynthAi 0.5.27 or later" note in the drawer.
|
||||||
|
- If it throws, the export is switched off for the session; the plugin keeps
|
||||||
|
running.
|
||||||
|
- No `RynthCoreAPI` struct change; the API version is unchanged.
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
- `ImGui/Panels/RynthAiFace.Drawers.cs`: `RemoteDrawer`.
|
||||||
|
- `ImGui/Panels/RynthAiFace.cs`: the drawer added to the dashboard; Hub right-click.
|
||||||
|
- `ImGui/Panels/DashboardDrawers.cs`: header comment.
|
||||||
|
- `Plugins/PluginManager.cs`: `RenderEmbed` (render thread, login gated).
|
||||||
|
- `Plugins/LoadedPlugin.cs`, `Plugins/PluginLoader.cs`: `RenderEmbedPtr`.
|
||||||
|
- `Plugins/PluginContract.cs`: export documented.
|
||||||
|
- `UI/RynthAiDashboardState.cs`: `RemoteOpen` (cache line 11).
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
//
|
//
|
||||||
// The mechanics live here (tabs, slide, side, placement, the one window);
|
// The mechanics live here (tabs, slide, side, placement, the one window);
|
||||||
// each drawer only draws its panel (DashboardDrawer.DrawPanel) and says how
|
// each drawer only draws its panel (DashboardDrawer.DrawPanel) and says how
|
||||||
// big it is. Drawers today: Ranges (RangesSlideOut.cs), Loaded files and
|
// big it is. Drawers today: Ranges (RangesSlideOut.cs), Loaded files,
|
||||||
// Patrol (RynthAiFace.Drawers.cs).
|
// Patrol and Mini Remote (RynthAiFace.Drawers.cs).
|
||||||
//
|
//
|
||||||
// A top-level ImGui window of its own, begun from inside the dashboard's Draw
|
// A top-level ImGui window of its own, begun from inside the dashboard's Draw
|
||||||
// and placed against the dashboard's window every frame, so it follows the
|
// and placed against the dashboard's window every frame, so it follows the
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,19 @@
|
||||||
// recorded hazards and the saved routes. Was the Patrol
|
// recorded hazards and the saved routes. Was the Patrol
|
||||||
// launcher's right-click popup; right-click now opens this
|
// launcher's right-click popup; right-click now opens this
|
||||||
// drawer (popped out: still the popup).
|
// drawer (popped out: still the popup).
|
||||||
|
// Mini Remote RynthAi's Mini Remote (session rates, target, summon,
|
||||||
|
// item slots, toggles, bank, rebuff, Translate, Guardian)
|
||||||
|
// with its Options menu. The plugin draws it here through
|
||||||
|
// RynthPluginRenderEmbed("miniremote") and says how big it
|
||||||
|
// wants the panel; the Hub launcher's right-click opens it
|
||||||
|
// (popped out: the floating Mini Remote instead).
|
||||||
// AC thread only (inside the dashboard's Draw).
|
// AC thread only (inside the dashboard's Draw).
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
|
using RynthCore.Engine.Plugins;
|
||||||
using RynthCore.Engine.UI;
|
using RynthCore.Engine.UI;
|
||||||
using RynthCore.Engine.UI.Data;
|
using RynthCore.Engine.UI.Data;
|
||||||
|
|
||||||
|
|
@ -136,4 +143,81 @@ internal sealed partial class RynthAiFace
|
||||||
finally { ImGuiNET.ImGui.EndChild(); }
|
finally { ImGuiNET.ImGui.EndChild(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>RynthAi's Mini Remote, drawn by the plugin into this drawer (the Hub launcher's right-click).</summary>
|
||||||
|
private sealed class RemoteDrawer : DashboardDrawer
|
||||||
|
{
|
||||||
|
/// <summary>The plugin surface name, NUL-terminated for the export.</summary>
|
||||||
|
private static ReadOnlySpan<byte> Surface => "miniremote\0"u8;
|
||||||
|
|
||||||
|
// Content bounds in unscaled pixels; the plugin's wish is clamped to them.
|
||||||
|
private const float MinW = 200, MaxW = 760, MinH = 60, DefaultH = 120;
|
||||||
|
|
||||||
|
/// <summary>The content size the plugin last asked for (pixels); zero until it has drawn here.</summary>
|
||||||
|
private Vector2 _want;
|
||||||
|
|
||||||
|
public override string Key => "remote";
|
||||||
|
public override string Icon => PhosphorIcons.SquaresFour;
|
||||||
|
public override string Name => "Mini Remote drawer";
|
||||||
|
public override bool SavedOpen => RynthAiDashboardState.RemoteOpen;
|
||||||
|
public override void SaveOpen(bool open) => RynthAiDashboardState.SetRemoteOpen(open);
|
||||||
|
|
||||||
|
public override string TabTooltip(bool right) =>
|
||||||
|
"Mini Remote: session rates, attack target, summon, item slots, toggles, bank, rebuff, Translate.\n" +
|
||||||
|
"Its Options button picks the sections and opens the ILT Hub windows (also: right-click Hub).\n" +
|
||||||
|
(right ? "Click to slide it out (to the right: there's no room on the left)." : "Click to slide it out.");
|
||||||
|
|
||||||
|
public override float Width(float k) =>
|
||||||
|
Math.Clamp(_want.X > 0 ? _want.X : MinW * k, MinW * k, MaxW * k) + 2 * Pad * k;
|
||||||
|
|
||||||
|
public override float Height(float k)
|
||||||
|
{
|
||||||
|
float frame = (Pad + TitleH + 4 + Pad) * k;
|
||||||
|
// Never taller than the screen: the body scrolls instead.
|
||||||
|
float screen = ImGuiNET.ImGui.GetIO().DisplaySize.Y;
|
||||||
|
float maxBody = screen > 1 ? MathF.Max(MinH * k, screen - frame - 8 * k) : 900 * k;
|
||||||
|
return frame + Math.Clamp(_want.Y > 0 ? _want.Y : DefaultH * k, MinH * k, maxBody);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DrawPanel(Vector2 origin, float panelW, float panelH, float k)
|
||||||
|
{
|
||||||
|
float y = PanelFrame(origin, panelW, panelH, k, PhosphorIcons.SquaresFour, "MINI REMOTE", null, "Hide the Mini Remote drawer");
|
||||||
|
float x = origin.X + Pad * k;
|
||||||
|
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x, y));
|
||||||
|
Vector2 size = new(panelW - 2 * Pad * k, MathF.Max(1, origin.Y + panelH - Pad * k - y));
|
||||||
|
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
|
||||||
|
bool open = ImGuiNET.ImGui.BeginChild("##remote_body", size, ImGuiChildFlags.None, ImGuiWindowFlags.NoBackground);
|
||||||
|
ImGuiNET.ImGui.PopStyleVar();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!open) return;
|
||||||
|
// The plugin's widgets use the default UI font, as in its floating Mini Remote.
|
||||||
|
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui11));
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int result = PluginManager.RenderEmbed("RynthAi", Surface, size, out Vector2 want);
|
||||||
|
if (result == PluginManager.EmbedDrawn)
|
||||||
|
{
|
||||||
|
if (want.X > 0 && want.Y > 0) _want = want;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_want = Vector2.Zero;
|
||||||
|
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, DMute);
|
||||||
|
ImGuiNET.ImGui.TextWrapped(result switch
|
||||||
|
{
|
||||||
|
PluginManager.EmbedNoPlugin =>
|
||||||
|
"This RynthAi can't draw its Mini Remote here (it needs RynthAi 0.5.27 or later). Left-click Hub for the floating Mini Remote.",
|
||||||
|
PluginManager.EmbedFailed =>
|
||||||
|
"The Mini Remote failed to draw here (see the log). Left-click Hub for the floating Mini Remote.",
|
||||||
|
_ => "The Mini Remote shows here once RynthAi is ready: in the world, with plugin windows on (engine.json EnablePluginOverlayWindows).",
|
||||||
|
});
|
||||||
|
ImGuiNET.ImGui.PopStyleColor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally { ImGuiNET.ImGui.PopFont(); }
|
||||||
|
}
|
||||||
|
finally { ImGuiNET.ImGui.EndChild(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
// the buttons above it.
|
// the buttons above it.
|
||||||
// drawers tabs on the left edge (DashboardDrawers.cs), one open at a
|
// drawers tabs on the left edge (DashboardDrawers.cs), one open at a
|
||||||
// time, a window of their own beside the dashboard: Ranges
|
// time, a window of their own beside the dashboard: Ranges
|
||||||
// (RangesSlideOut.cs), Loaded files and Patrol
|
// (RangesSlideOut.cs), Loaded files, Patrol and Mini Remote
|
||||||
// (RynthAiFace.Drawers.cs). Everything that slides out goes
|
// (RynthAiFace.Drawers.cs). Everything that slides out goes
|
||||||
// left; only the bars stay at the bottom (Tom 2026-10-05).
|
// left; only the bars stay at the bottom (Tom 2026-10-05).
|
||||||
// Minimized keeps the title row, the control row and the bars. The window's
|
// Minimized keeps the title row, the control row and the bars. The window's
|
||||||
|
|
@ -76,6 +76,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
||||||
// The drawers on the dashboard's left edge (their own window, placed against this one).
|
// The drawers on the dashboard's left edge (their own window, placed against this one).
|
||||||
private readonly DashboardDrawers _drawers;
|
private readonly DashboardDrawers _drawers;
|
||||||
private readonly PatrolDrawer _patrol = new();
|
private readonly PatrolDrawer _patrol = new();
|
||||||
|
private readonly RemoteDrawer _remote = new();
|
||||||
// This frame's data, for the drawers.
|
// This frame's data, for the drawers.
|
||||||
private RynthAiView? _view;
|
private RynthAiView? _view;
|
||||||
private RynthAiSnapshot _raw = Empty;
|
private RynthAiSnapshot _raw = Empty;
|
||||||
|
|
@ -92,7 +93,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
||||||
public RynthAiFace()
|
public RynthAiFace()
|
||||||
{
|
{
|
||||||
// Tab order top to bottom; the first one saved open wins at load.
|
// Tab order top to bottom; the first one saved open wins at load.
|
||||||
_drawers = new DashboardDrawers(new RangesSlideOut(), new FilesDrawer(this), _patrol);
|
_drawers = new DashboardDrawers(new RangesSlideOut(), new FilesDrawer(this), _patrol, _remote);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2? MinSize => new Vector2(MinWidth, _contentHeight > 0 ? _contentHeight
|
public Vector2? MinSize => new Vector2(MinWidth, _contentHeight > 0 ? _contentHeight
|
||||||
|
|
@ -531,11 +532,18 @@ internal sealed partial class RynthAiFace : IImGuiPanel
|
||||||
ImGuiNET.ImGui.OpenPopup("##charmenu");
|
ImGuiNET.ImGui.OpenPopup("##charmenu");
|
||||||
}
|
}
|
||||||
x += bw + LauncherGap;
|
x += bw + LauncherGap;
|
||||||
|
// Right-click is the Mini Remote drawer, as Patrol's is its drawer; popped out there are
|
||||||
|
// no drawers, so it shows the floating Mini Remote. Inventory HUDs setup is in the
|
||||||
|
// Mini Remote's Options menu.
|
||||||
Launcher("##l_hub", PhosphorIcons.SquaresFour, "Hub",
|
Launcher("##l_hub", PhosphorIcons.SquaresFour, "Hub",
|
||||||
"Hub. Left-click: Mini Remote (/ra remote). Right-click: Inventory HUDs setup (/ra huds).",
|
popped ? "Hub. Left-click: floating Mini Remote (/ra remote). Right-click: show the floating Mini Remote."
|
||||||
|
: "Hub. Left-click: floating Mini Remote (/ra remote). Right-click: the Mini Remote drawer (left), with its Options.",
|
||||||
x, y, bw, labels, () => RynthAiCommands.ApplyRemoteCommand("remote", "toggle"));
|
x, y, bw, labels, () => RynthAiCommands.ApplyRemoteCommand("remote", "toggle"));
|
||||||
if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||||
RynthAiCommands.ApplyRemoteCommand("huds", "show");
|
{
|
||||||
|
if (popped) RynthAiCommands.ApplyRemoteCommand("remote", "show");
|
||||||
|
else _drawers.Toggle(_remote);
|
||||||
|
}
|
||||||
|
|
||||||
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x0, y + LauncherH));
|
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x0, y + LauncherH));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,13 @@ internal sealed class LoadedPlugin
|
||||||
/// <summary>Set after the first RenderOverlay call has been logged (render thread only).</summary>
|
/// <summary>Set after the first RenderOverlay call has been logged (render thread only).</summary>
|
||||||
public bool RenderOverlayLogged { get; set; }
|
public bool RenderOverlayLogged { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Optional <c>int RynthPluginRenderEmbed(const char* surface, float width, float height,
|
||||||
|
/// float* wantWidth, float* wantHeight)</c>, Cdecl: the plugin draws a named surface into the
|
||||||
|
/// engine's current ImGui window (PluginManager.RenderEmbed). Zeroed after it throws.
|
||||||
|
/// </summary>
|
||||||
|
public IntPtr RenderEmbedPtr { get; set; }
|
||||||
|
|
||||||
// ─── v77 UI exports (resolved lazily by PluginManager.ResolveUiExports) ───
|
// ─── v77 UI exports (resolved lazily by PluginManager.ResolveUiExports) ───
|
||||||
public bool UiExportsResolved { get; set; }
|
public bool UiExportsResolved { get; set; }
|
||||||
public IntPtr OnScreenChangedPtr { get; set; }
|
public IntPtr OnScreenChangedPtr { get; set; }
|
||||||
|
|
@ -129,5 +136,6 @@ internal sealed class LoadedPlugin
|
||||||
Tick = null;
|
Tick = null;
|
||||||
Render = null;
|
Render = null;
|
||||||
RenderOverlay = null;
|
RenderOverlay = null;
|
||||||
|
RenderEmbedPtr = IntPtr.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,13 @@
|
||||||
// off (Avalonia mode): only windows that have no
|
// off (Avalonia mode): only windows that have no
|
||||||
// Avalonia panel. Gated by engine.json
|
// Avalonia panel. Gated by engine.json
|
||||||
// "EnablePluginOverlayWindows" (default true).
|
// "EnablePluginOverlayWindows" (default true).
|
||||||
|
// int RynthPluginRenderEmbed(const char* surface, float width, float height,
|
||||||
|
// float* wantWidth, float* wantHeight)
|
||||||
|
// — draws a named surface (UTF-8, e.g. RynthAi's
|
||||||
|
// "miniremote") into the engine's current ImGui
|
||||||
|
// window on AC's render thread, inside a
|
||||||
|
// width x height child; reports the size it wants.
|
||||||
|
// 1 = drawn, 0 = not ready / unknown surface.
|
||||||
// void RynthPluginOnServerMessage(uint opcode, byte* data, int length)
|
// void RynthPluginOnServerMessage(uint opcode, byte* data, int length)
|
||||||
// — v78, reassembled server messages the plugin
|
// — v78, reassembled server messages the plugin
|
||||||
// asked for with SetServerMessageInterestFn
|
// asked for with SetServerMessageInterestFn
|
||||||
|
|
|
||||||
|
|
@ -513,6 +513,9 @@ internal static class PluginLoader
|
||||||
if (renderOverlayPtr != IntPtr.Zero)
|
if (renderOverlayPtr != IntPtr.Zero)
|
||||||
plugin.RenderOverlay = Marshal.GetDelegateForFunctionPointer<PluginRenderDelegate>(renderOverlayPtr);
|
plugin.RenderOverlay = Marshal.GetDelegateForFunctionPointer<PluginRenderDelegate>(renderOverlayPtr);
|
||||||
|
|
||||||
|
// Called through a function pointer (PluginManager.RenderEmbed), so no delegate here.
|
||||||
|
plugin.RenderEmbedPtr = GetProcAddress(handle, "RynthPluginRenderEmbed");
|
||||||
|
|
||||||
// Read name/version from the plugin if available
|
// Read name/version from the plugin if available
|
||||||
if (plugin.GetName != null)
|
if (plugin.GetName != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1242,6 +1242,51 @@ internal static partial class PluginManager
|
||||||
internal static string DescribeOverlayState()
|
internal static string DescribeOverlayState()
|
||||||
=> $"overlayCalls={_overlayCalls} loginSeen={_loginCompleteObserved} overlayPlugins={_overlayBound}";
|
=> $"overlayCalls={_overlayCalls} loginSeen={_loginCompleteObserved} overlayPlugins={_overlayBound}";
|
||||||
|
|
||||||
|
/// <summary>RenderEmbed results.</summary>
|
||||||
|
internal const int EmbedDrawn = 1, EmbedNotReady = 0, EmbedNoPlugin = -1, EmbedFailed = -2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Lets the plugin named <paramref name="pluginName"/> (display name contains it) draw the
|
||||||
|
/// surface <paramref name="surfaceUtf8"/> (NUL-terminated) into the current ImGui window,
|
||||||
|
/// through its optional RynthPluginRenderEmbed export. The caller has begun a child of
|
||||||
|
/// <paramref name="size"/> in the main ImGui context; the plugin draws only inside it and
|
||||||
|
/// reports the content size it wants in <paramref name="want"/> (zero when it didn't say).
|
||||||
|
/// Render thread only. Returns <see cref="EmbedDrawn"/>, <see cref="EmbedNotReady"/> (the
|
||||||
|
/// plugin isn't ready: before login, no ImGui context), <see cref="EmbedNoPlugin"/> (not
|
||||||
|
/// loaded, or too old to have the export) or <see cref="EmbedFailed"/> (it threw: the export
|
||||||
|
/// is switched off for this session; the plugin keeps running).
|
||||||
|
/// </summary>
|
||||||
|
internal static unsafe int RenderEmbed(string pluginName, ReadOnlySpan<byte> surfaceUtf8, System.Numerics.Vector2 size, out System.Numerics.Vector2 want)
|
||||||
|
{
|
||||||
|
want = System.Numerics.Vector2.Zero;
|
||||||
|
if (!_loginCompleteObserved) return EmbedNotReady; // same not-in-world guard as RenderAll
|
||||||
|
LoadedPlugin[] plugins = System.Threading.Volatile.Read(ref _pluginsRenderSnapshot);
|
||||||
|
for (int i = 0; i < plugins.Length; i++)
|
||||||
|
{
|
||||||
|
LoadedPlugin p = plugins[i];
|
||||||
|
if (!p.Initialized || p.Failed || !p.DisplayName.Contains(pluginName, StringComparison.OrdinalIgnoreCase))
|
||||||
|
continue;
|
||||||
|
IntPtr fn = p.RenderEmbedPtr;
|
||||||
|
if (fn == IntPtr.Zero) return EmbedNoPlugin;
|
||||||
|
float w = 0, h = 0;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
fixed (byte* s = surfaceUtf8)
|
||||||
|
r = ((delegate* unmanaged[Cdecl]<byte*, float, float, float*, float*, int>)fn)(s, size.X, size.Y, &w, &h);
|
||||||
|
want = new System.Numerics.Vector2(float.IsFinite(w) ? MathF.Max(0, w) : 0, float.IsFinite(h) ? MathF.Max(0, h) : 0);
|
||||||
|
return r == 1 ? EmbedDrawn : EmbedNotReady;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
p.RenderEmbedPtr = IntPtr.Zero;
|
||||||
|
RynthLog.Error($"PluginManager: {p.DisplayName} RenderEmbed threw {ex.GetType().Name}: {ex.Message} - embedded surfaces off for this session (plugin keeps running).");
|
||||||
|
return EmbedFailed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return EmbedNoPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
public static void ShutdownAll()
|
public static void ShutdownAll()
|
||||||
{
|
{
|
||||||
RynthLog.Plugin($"PluginManager: Shutting down {_plugins.Count} plugin(s)...");
|
RynthLog.Plugin($"PluginManager: Shutting down {_plugins.Count} plugin(s)...");
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
// minimized|expanded, line 2 unused, line 3 target|notarget, line 4
|
// minimized|expanded, line 2 unused, line 3 target|notarget, line 4
|
||||||
// vitals|novitals; line 5 filesopen|nofiles, the Loaded files drawer; line 9
|
// vitals|novitals; line 5 filesopen|nofiles, the Loaded files drawer; line 9
|
||||||
// ranges|noranges, the Ranges drawer; line 10 patrol|nopatrol, the Patrol
|
// ranges|noranges, the Ranges drawer; line 10 patrol|nopatrol, the Patrol
|
||||||
// drawer: the left-edge drawers, ImGui/Panels/DashboardDrawers.cs). Line 2
|
// drawer; line 11 remote|noremote, the Mini Remote drawer: the left-edge
|
||||||
|
// drawers, ImGui/Panels/DashboardDrawers.cs). Line 2
|
||||||
// was the Monsters button's Simple/Advanced mode, retired 2026-10-01 with the
|
// was the Monsters button's Simple/Advanced mode, retired 2026-10-01 with the
|
||||||
// basic Monsters panel: it is still written ("advanced") so the lines after
|
// basic Monsters panel: it is still written ("advanced") so the lines after
|
||||||
// it keep their places, and ignored on read. Lines 7 and 8 (the dashboard's
|
// it keep their places, and ignored on read. Lines 7 and 8 (the dashboard's
|
||||||
|
|
@ -37,6 +38,7 @@ internal static class RynthAiDashboardState
|
||||||
private static volatile bool _barCollapsed; // the RynthCore bar shows only its grip + expand
|
private static volatile bool _barCollapsed; // the RynthCore bar shows only its grip + expand
|
||||||
private static volatile bool _rangesOpen; // the Ranges drawer beside the dashboard is open
|
private static volatile bool _rangesOpen; // the Ranges drawer beside the dashboard is open
|
||||||
private static volatile bool _patrolOpen; // the Patrol drawer beside the dashboard is open
|
private static volatile bool _patrolOpen; // the Patrol drawer beside the dashboard is open
|
||||||
|
private static volatile bool _remoteOpen; // the Mini Remote drawer beside the dashboard is open
|
||||||
// Lines 7 and 8, unused since 2026-10-05: written back as read.
|
// Lines 7 and 8, unused since 2026-10-05: written back as read.
|
||||||
private static string _line7 = "-", _line8 = "-";
|
private static string _line7 = "-", _line8 = "-";
|
||||||
private static bool _loaded;
|
private static bool _loaded;
|
||||||
|
|
@ -140,6 +142,19 @@ internal static class RynthAiDashboardState
|
||||||
UiBackgroundWriter.Enqueue("rynthai dashboard state", Save);
|
UiBackgroundWriter.Enqueue("rynthai dashboard state", Save);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>The Mini Remote drawer (RynthAi's Mini Remote drawn by the plugin) is open beside the dashboard. Any thread.</summary>
|
||||||
|
public static bool RemoteOpen
|
||||||
|
{
|
||||||
|
get { EnsureLoaded(); return _remoteOpen; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetRemoteOpen(bool open)
|
||||||
|
{
|
||||||
|
EnsureLoaded();
|
||||||
|
_remoteOpen = open;
|
||||||
|
UiBackgroundWriter.Enqueue("rynthai dashboard state", Save);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Reads the file if it hasn't been read yet. Engine init calls this so AC's thread never does.</summary>
|
/// <summary>Reads the file if it hasn't been read yet. Engine init calls this so AC's thread never does.</summary>
|
||||||
public static void EnsureLoaded()
|
public static void EnsureLoaded()
|
||||||
{
|
{
|
||||||
|
|
@ -163,6 +178,7 @@ internal static class RynthAiDashboardState
|
||||||
if (lines.Length >= 8 && lines[7].Trim().Length > 0) _line8 = lines[7].Trim();
|
if (lines.Length >= 8 && lines[7].Trim().Length > 0) _line8 = lines[7].Trim();
|
||||||
_rangesOpen = lines.Length >= 9 && lines[8].Trim().Equals("ranges", StringComparison.OrdinalIgnoreCase);
|
_rangesOpen = lines.Length >= 9 && lines[8].Trim().Equals("ranges", StringComparison.OrdinalIgnoreCase);
|
||||||
_patrolOpen = lines.Length >= 10 && lines[9].Trim().Equals("patrol", StringComparison.OrdinalIgnoreCase);
|
_patrolOpen = lines.Length >= 10 && lines[9].Trim().Equals("patrol", StringComparison.OrdinalIgnoreCase);
|
||||||
|
_remoteOpen = lines.Length >= 11 && lines[10].Trim().Equals("remote", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch { /* corrupt cache: start expanded */ }
|
catch { /* corrupt cache: start expanded */ }
|
||||||
|
|
@ -180,7 +196,8 @@ internal static class RynthAiDashboardState
|
||||||
+ (_showTargetBar ? "target" : "notarget") + "\n" + (_showVitals ? "vitals" : "novitals") + "\n"
|
+ (_showTargetBar ? "target" : "notarget") + "\n" + (_showVitals ? "vitals" : "novitals") + "\n"
|
||||||
+ (_filesOpen ? "filesopen" : "nofiles") + "\n" + (_barCollapsed ? "barcollapsed" : "bar") + "\n"
|
+ (_filesOpen ? "filesopen" : "nofiles") + "\n" + (_barCollapsed ? "barcollapsed" : "bar") + "\n"
|
||||||
+ _line7 + "\n" + _line8 + "\n"
|
+ _line7 + "\n" + _line8 + "\n"
|
||||||
+ (_rangesOpen ? "ranges" : "noranges") + "\n" + (_patrolOpen ? "patrol" : "nopatrol") + "\n");
|
+ (_rangesOpen ? "ranges" : "noranges") + "\n" + (_patrolOpen ? "patrol" : "nopatrol") + "\n"
|
||||||
|
+ (_remoteOpen ? "remote" : "noremote") + "\n");
|
||||||
}
|
}
|
||||||
catch { /* best-effort */ }
|
catch { /* best-effort */ }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue