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:
BlankenshipG 2026-10-08 21:38:09 -04:00
commit 2ef0d432da
9 changed files with 254 additions and 9 deletions

View file

@ -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).

View file

@ -10,8 +10,8 @@
//
// The mechanics live here (tabs, slide, side, placement, the one window);
// each drawer only draws its panel (DashboardDrawer.DrawPanel) and says how
// big it is. Drawers today: Ranges (RangesSlideOut.cs), Loaded files and
// Patrol (RynthAiFace.Drawers.cs).
// big it is. Drawers today: Ranges (RangesSlideOut.cs), Loaded files,
// Patrol and Mini Remote (RynthAiFace.Drawers.cs).
//
// 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

View file

@ -12,12 +12,19 @@
// recorded hazards and the saved routes. Was the Patrol
// launcher's right-click popup; right-click now opens this
// 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).
// ============================================================================
using System;
using System.Numerics;
using ImGuiNET;
using RynthCore.Engine.Plugins;
using RynthCore.Engine.UI;
using RynthCore.Engine.UI.Data;
@ -136,4 +143,81 @@ internal sealed partial class RynthAiFace
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(); }
}
}
}

View file

@ -18,7 +18,7 @@
// the buttons above it.
// drawers tabs on the left edge (DashboardDrawers.cs), one open at a
// 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
// 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
@ -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).
private readonly DashboardDrawers _drawers;
private readonly PatrolDrawer _patrol = new();
private readonly RemoteDrawer _remote = new();
// This frame's data, for the drawers.
private RynthAiView? _view;
private RynthAiSnapshot _raw = Empty;
@ -92,7 +93,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
public RynthAiFace()
{
// 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
@ -531,11 +532,18 @@ internal sealed partial class RynthAiFace : IImGuiPanel
ImGuiNET.ImGui.OpenPopup("##charmenu");
}
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",
"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"));
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));
}

View file

@ -60,6 +60,13 @@ internal sealed class LoadedPlugin
/// <summary>Set after the first RenderOverlay call has been logged (render thread only).</summary>
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) ───
public bool UiExportsResolved { get; set; }
public IntPtr OnScreenChangedPtr { get; set; }
@ -129,5 +136,6 @@ internal sealed class LoadedPlugin
Tick = null;
Render = null;
RenderOverlay = null;
RenderEmbedPtr = IntPtr.Zero;
}
}

View file

@ -10,7 +10,18 @@
// const char* RynthPluginName() — human-readable name
// const char* RynthPluginVersion() — version string (e.g. "1.0.0")
// void RynthPluginTick() — per-frame logic (before render)
// void RynthPluginRender() — per-frame ImGui drawing
// void RynthPluginRender() — per-frame ImGui drawing (ImGui shell on)
// void RynthPluginRenderOverlay() — per-frame ImGui drawing while the ImGui shell is
// off (Avalonia mode): only windows that have no
// Avalonia panel. Gated by engine.json
// "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)
// — v78, reassembled server messages the plugin
// asked for with SetServerMessageInterestFn
@ -844,6 +855,15 @@ internal struct RynthCoreAPI
/// must equal that price; 0 skips the comparison. Same results and threading as Raise.
/// Requires API v79+.</summary>
public IntPtr TrainSkillFn;
/// <summary>v80: <c>int GetMergeStackResult(uint sourceObjectId, uint targetObjectId, int* amount, int* ageMs)</c>:
/// outcome of the latest MergeStackInternal(source, target) request: 0 none, 1 queued,
/// 2 sent (amount = units sent), 3 skipped because the target was already full,
/// 4 failed (invalid ids / AC rejected / threw), 5 dropped (main-thread queue full).
/// ageMs = how long ago the outcome was recorded. Either out pointer may be null.
/// The thunk is cdecl. Any thread. Requires API v80+ (it was v77 on QOL-items before
/// upstream's v77-v79 landed; plugins built against that SDK must be rebuilt).</summary>
public IntPtr GetMergeStackResultFn;
}
/// <summary>v79 <see cref="TrainingInfoNative.Flags"/> bits.</summary>
@ -1634,6 +1654,10 @@ internal unsafe delegate uint VendorSellCallbackDelegate(uint vendorId, uint* it
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetVendorTradeStatusCallbackDelegate(VendorTradeStatusNative* status);
// Cdecl is mandatory on every API delegate: without it x86 marshals a stdcall thunk, the callee and
// the cdecl caller both pop the args, and the plugin's stack drifts on every call.
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetMergeStackResultCallbackDelegate(uint sourceObjectId, uint targetObjectId, int* amount, int* ageMs);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal unsafe delegate int GetVTankStateCallbackDelegate(int* sequence);

View file

@ -513,6 +513,9 @@ internal static class PluginLoader
if (renderOverlayPtr != IntPtr.Zero)
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
if (plugin.GetName != null)
{

View file

@ -1241,6 +1241,51 @@ internal static partial class PluginManager
internal static string DescribeOverlayState()
=> $"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()
{
RynthLog.Plugin($"PluginManager: Shutting down {_plugins.Count} plugin(s)...");

View file

@ -6,7 +6,8 @@
// minimized|expanded, line 2 unused, line 3 target|notarget, line 4
// vitals|novitals; line 5 filesopen|nofiles, the Loaded files drawer; line 9
// 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
// 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
@ -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 _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 _remoteOpen; // the Mini Remote drawer beside the dashboard is open
// Lines 7 and 8, unused since 2026-10-05: written back as read.
private static string _line7 = "-", _line8 = "-";
private static bool _loaded;
@ -140,6 +142,19 @@ internal static class RynthAiDashboardState
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>
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();
_rangesOpen = lines.Length >= 9 && lines[8].Trim().Equals("ranges", 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 */ }
@ -180,7 +196,8 @@ internal static class RynthAiDashboardState
+ (_showTargetBar ? "target" : "notarget") + "\n" + (_showVitals ? "vitals" : "novitals") + "\n"
+ (_filesOpen ? "filesopen" : "nofiles") + "\n" + (_barCollapsed ? "barcollapsed" : "bar") + "\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 */ }
}