Snapshot for release 2026.10.23.1 (internal 4204305)

This commit is contained in:
Tom Bohar 2026-10-23 16:34:00 -04:00
commit 539a7a3e64
69 changed files with 5385 additions and 107 deletions

View file

@ -185,6 +185,20 @@ public struct RynthCoreApiNative
public IntPtr GetUiColorFn; // uint GetUiColor(int token) -> ABGR, 0 unknown
public IntPtr GetUiFontFn; // void* GetUiFont(int font) -> ImFont*, null unknown / off AC's thread
public IntPtr SetPanelOpenFn; // int SetPanelOpen(const char* key, int mode) -> 1 open, 0 closed, -1 no such panel
// v90: plugin windows that draw their own frame ("chrome": "none")
public IntPtr PanelDragWithLastItemFn; // void PanelDragWithLastItem(void): the panel being drawn follows a drag of ImGui's last item
public IntPtr SetPanelPopOutFn; // int SetPanelPopOut(const char* key, int mode) -> 1 popped out, 0 docked, -1 no such open panel
public IntPtr PanelTextSizeFn; // int PanelTextSize(const char* key, int delta) -> text size in % (100..250), -1 no such panel
public IntPtr RenderSettingsDrawerFn; // float RenderSettingsDrawer(const char* key, float width, float room, int flags) -> wanted height, -1 unknown
public IntPtr GetShortcutsFn; // int GetShortcuts(uint* objectIds, uint* spellIds, int max) -> 18, or 0 out of the world
public IntPtr ShortcutActionFn; // int ShortcutAction(int op, int slot, uint objectId) -> 1 queued, 0 refused
public IntPtr GetActionKeysFn; // int GetActionKeys(const char* action, char* buffer, int length) -> bytes needed, -1 bad call
public IntPtr GetIconTextureFn; // void* GetIconTexture(int kind, uint id) -> ImGui texture id, null while it is made
public IntPtr KeyCaptureFn; // int KeyCapture(int op, char* buffer, int length) -> 0 waiting, 1 key (name in buffer), 2 cancelled
public IntPtr SetActionKeyFn; // int SetActionKey(const char* action, const char* key, int op, char* message, int length)
public IntPtr AcPanelFn; // int AcPanel(int id, int op) -> op 0: 1 open, 0 closed, -1 none; else 1 queued, -1 refused
public IntPtr PanelScaleFn; // int PanelScale(const char* key, int percent) -> percent now, 0 = follows the text size
public IntPtr DropTargetFn; // uint DropTarget(const char* window, float x0, y0, x1, y1, int flags, int* dragging) -> dropped object, 0 none
}
/// <summary>

View file

@ -150,6 +150,17 @@ public readonly unsafe struct RynthCoreHost
public bool HasUiTheme => _api.Version >= 89 && _api.GetUiColorFn != IntPtr.Zero && _api.GetUiFontFn != IntPtr.Zero;
/// <summary>v89: <see cref="SetPanelOpen"/> (open, close or toggle a panel by its key, a plugin window's title included).</summary>
public bool HasSetPanelOpen => _api.Version >= 89 && _api.SetPanelOpenFn != IntPtr.Zero;
/// <summary>v90: windows that draw their own frame: the manifest's "chrome": "none" and "fitHeight",
/// <see cref="PanelDragWithLastItem"/>, <see cref="SetPanelPopOut"/>, <see cref="PanelTextSize"/>, and the
/// v90 colours (Muted, KeyFace, Hairline, Inset, Faint) and fonts (Dash*, Narrow*).</summary>
public bool HasFramelessWindows => _api.Version >= 90 && _api.PanelDragWithLastItemFn != IntPtr.Zero
&& _api.SetPanelPopOutFn != IntPtr.Zero && _api.PanelTextSizeFn != IntPtr.Zero;
/// <summary>v90: <see cref="RenderSettingsDrawer"/> (the dashboard drawers that show Settings rows).</summary>
public bool HasSettingsDrawers => _api.Version >= 90 && _api.RenderSettingsDrawerFn != IntPtr.Zero;
/// <summary>v90: the player's AC shortcut slots (<see cref="GetShortcuts"/>, <see cref="ShortcutAction"/>),
/// AC's key bindings (<see cref="GetActionKeys"/>) and item pictures (<see cref="GetIconTexture"/>).</summary>
public bool HasShortcuts => _api.Version >= 90 && _api.GetShortcutsFn != IntPtr.Zero && _api.ShortcutActionFn != IntPtr.Zero
&& _api.GetActionKeysFn != IntPtr.Zero && _api.GetIconTextureFn != IntPtr.Zero;
/// <summary>v76: <see cref="CloseContainer"/> (close a corpse or chest like the client's window close).</summary>
public bool HasCloseContainer => _api.Version >= 76 && _api.CloseContainerFn != IntPtr.Zero;
/// <summary>v77: <see cref="GetScreenMode"/>, <see cref="GetUiHookFlags"/> and the UI callbacks
@ -1543,6 +1554,258 @@ public readonly unsafe struct RynthCoreHost
return ((delegate* unmanaged[Cdecl]<byte*, int, int>)_api.SetPanelOpenFn)(p, (int)mode);
}
/// <summary>
/// v90: while ImGui's last item is held and dragged, the panel being drawn follows the mouse (a
/// frameless window's own title row: call it right after that row's InvisibleButton). Docked, the
/// window moves within the game view; popped out, its OS window. Only from RynthPluginRenderEmbed
/// on AC's render thread; does nothing elsewhere or on an older engine.
/// </summary>
public void PanelDragWithLastItem()
{
if (!HasFramelessWindows) return;
((delegate* unmanaged[Cdecl]<void>)_api.PanelDragWithLastItemFn)();
}
/// <summary>
/// v90: pops the open panel <paramref name="key"/> out into its own window, docks it back, toggles,
/// or asks. Returns 1 popped out / 0 docked afterwards (the change lands on the next frame), -1 for
/// no such open panel or an older engine. Any thread.
/// </summary>
public int SetPanelPopOut(string key, RynthPanelPopOut mode) => CallWithKey(_api.SetPanelPopOutFn, key, (int)mode);
/// <summary>
/// v90: steps the panel <paramref name="key"/>'s text size by <paramref name="delta"/> (0 = just ask)
/// and returns it as a percentage of normal (100 to 250); -1 for no such panel or an older engine.
/// The fonts re-bake a moment later. Any thread.
/// </summary>
public int PanelTextSize(string key, int delta) => CallWithKey(_api.PanelTextSizeFn, key, delta);
/// <summary>
/// v90: how big the frameless window <paramref name="key"/> draws itself, in percent of normal
/// (30-250; Settings > UI > Toolbar sets it too): <paramref name="percent"/> 0 asks, -1 goes back to
/// following the text size, 30-250 sets it. Returns it now: 0 = follow the text size (draw at the
/// fonts' size), -1 on an older engine. Any thread; cheap to ask every frame.
/// </summary>
public int PanelScale(string key, int percent = 0) =>
_api.Version >= 90 && _api.PanelScaleFn != IntPtr.Zero ? CallWithKey(_api.PanelScaleFn, key, percent) : -1;
/// <summary>
/// v90: draws the body of one of the dashboard drawers that show Settings rows, which are still
/// RynthCore's (the Settings panel hasn't moved to RynthAi): "ranges" (the selected monster and the
/// key ranges), "patrol" (the Dungeon Patrol settings, hazards and routes) or "pinned" (My settings;
/// <paramref name="openPinList"/> opens its list of settings to pin). At ImGui's cursor in the window
/// being drawn, <paramref name="width"/> pixels wide and at most <paramref name="room"/> tall (0 = its
/// own height). Returns the height it wants (pixels), or -1 for another key, an older engine, or a
/// call outside a docked window's RynthPluginRenderEmbed on AC's render thread.
/// </summary>
public float RenderSettingsDrawer(string key, float width, float room, bool openPinList = false)
{
if (!HasSettingsDrawers || string.IsNullOrEmpty(key) || key.Length > 64) return -1f;
Span<byte> utf8 = stackalloc byte[260];
int n = System.Text.Encoding.UTF8.GetBytes(key, utf8[..^1]);
utf8[n] = 0;
fixed (byte* p = utf8)
return ((delegate* unmanaged[Cdecl]<byte*, float, float, int, float>)_api.RenderSettingsDrawerFn)(p, width, room, openPinList ? 1 : 0);
}
/// <summary>
/// v90: the player's 18 shortcut slots (AC's own: what the retail toolbar shows and its keys
/// use): each slot's object id (0 = empty) and spell id. Returns 18, or 0 out of the world or on
/// an older engine. Any thread.
/// </summary>
public int GetShortcuts(Span<uint> objectIds, Span<uint> spellIds)
{
if (!HasShortcuts) return 0;
int max = Math.Min(objectIds.Length, spellIds.Length);
fixed (uint* o = objectIds)
fixed (uint* s = spellIds)
return ((delegate* unmanaged[Cdecl]<uint*, uint*, int, int>)_api.GetShortcutsFn)(o, s, max);
}
/// <summary>
/// v90: uses shortcut slot <paramref name="slot"/> (0-17) as its key would, puts
/// <paramref name="objectId"/> in it, or empties it: through the retail toolbar's own functions
/// on AC's game thread, so the server, the retail toolbar and the keys all follow. True when
/// queued. Any thread.
/// </summary>
public bool ShortcutAction(RynthShortcutOp op, int slot, uint objectId = 0)
{
if (!HasShortcuts) return false;
return ((delegate* unmanaged[Cdecl]<int, int, uint, int>)_api.ShortcutActionFn)((int)op, slot, objectId) == 1;
}
/// <summary>
/// v90: AC's keys for keymap action <paramref name="action"/> (e.g. "UseQuickSlot_1") as the player
/// reads them, "1, Ctrl+1", or the engine hotkeys running a chat command ("/rdef use 2"); "" when
/// unbound, unknown, or on an older engine. Any thread.
/// </summary>
public string GetActionKeys(string action)
{
if (!HasShortcuts || string.IsNullOrEmpty(action) || action.Length > 64) return string.Empty;
Span<byte> name = stackalloc byte[260];
int n = System.Text.Encoding.UTF8.GetBytes(action, name[..^1]);
name[n] = 0;
Span<byte> text = stackalloc byte[256];
int len;
fixed (byte* a = name)
fixed (byte* t = text)
len = ((delegate* unmanaged[Cdecl]<byte*, byte*, int, int>)_api.GetActionKeysFn)(a, t, text.Length);
if (len <= 0) return string.Empty;
return System.Text.Encoding.UTF8.GetString(text[..Math.Min(len, text.Length - 1)]);
}
/// <summary>
/// v90: an item's (kind Object: its icon with underlay and overlay), a spell's or an icon id's
/// picture as an ImGui texture id for ImGui.Image; IntPtr.Zero while it is being made (ask again
/// next frame). AC's render thread, inside a docked window's draw.
/// </summary>
public IntPtr GetIconTexture(RynthIconKind kind, uint id)
{
if (!HasShortcuts || id == 0) return IntPtr.Zero;
return ((delegate* unmanaged[Cdecl]<int, uint, IntPtr>)_api.GetIconTextureFn)((int)kind, id);
}
/// <summary>v90: changing keys: <see cref="BeginKeyCapture"/> ("press a key") and <see cref="BindActionKey"/>.</summary>
public bool HasKeyBinding => _api.Version >= 90 && _api.KeyCaptureFn != IntPtr.Zero && _api.SetActionKeyFn != IntPtr.Zero;
/// <summary>
/// v90: waits for the next key the player presses (with Ctrl/Alt/Shift held); it never reaches AC, and
/// Esc cancels. Ask with <see cref="PollKeyCapture"/> each frame. AC's main thread (a window's draw).
/// </summary>
public void BeginKeyCapture()
{
if (HasKeyBinding) ((delegate* unmanaged[Cdecl]<int, byte*, int, int>)_api.KeyCaptureFn)(0, null, 0);
}
/// <summary>v90: stops waiting for a key.</summary>
public void CancelKeyCapture()
{
if (HasKeyBinding) ((delegate* unmanaged[Cdecl]<int, byte*, int, int>)_api.KeyCaptureFn)(2, null, 0);
}
/// <summary>
/// v90: the key capture: still waiting (<paramref name="text"/>: why the last key couldn't be taken, or
/// ""), pressed (<paramref name="text"/>: its name, "Ctrl+F5") or cancelled. AC's main thread.
/// </summary>
public RynthKeyCapture PollKeyCapture(out string text)
{
text = string.Empty;
if (!HasKeyBinding) return RynthKeyCapture.Cancelled;
Span<byte> buf = stackalloc byte[128];
int r;
fixed (byte* b = buf)
r = ((delegate* unmanaged[Cdecl]<int, byte*, int, int>)_api.KeyCaptureFn)(1, b, buf.Length);
int n = buf.IndexOf((byte)0);
text = System.Text.Encoding.UTF8.GetString(buf[..(n < 0 ? buf.Length : n)]);
return r switch { 1 => RynthKeyCapture.Pressed, 0 => RynthKeyCapture.Waiting, _ => RynthKeyCapture.Cancelled };
}
/// <summary>
/// v90: what binding <paramref name="key"/> ("Ctrl+F5") to <paramref name="action"/> would take from
/// others. The action is AC's keymap action ("UseQuickSlot_5": AC's own keys, the retail toolbar's) or a
/// chat command for an engine hotkey ("/rdef use 2"). <paramref name="message"/> names what has the key
/// now, or why it can't be bound. Any thread.
/// </summary>
public RynthKeyCheck CheckActionKey(string action, string key, out string message) =>
(RynthKeyCheck)Math.Clamp(CallSetActionKey(action, key, 0, out message), -1, 1);
/// <summary>
/// v90: binds <paramref name="key"/> to <paramref name="action"/> (see <see cref="CheckActionKey"/>): it
/// comes off everything else that had it, in AC's keymap and RynthCore's hotkeys, and every running
/// client follows within a second. Done on AC's game thread; the result goes to chat. False (why in
/// <paramref name="message"/>) when it can't be. Any thread.
/// </summary>
public bool BindActionKey(string action, string key, out string message) => CallSetActionKey(action, key, 1, out message) == 1;
/// <summary>
/// v90: removes <paramref name="key"/> from <paramref name="action"/>; the key may be one of the names
/// <see cref="GetActionKeys"/> gave ("Ctrl+1", "Mouse4"). Queued like <see cref="BindActionKey"/>.
/// </summary>
public bool UnbindActionKey(string action, string key, out string message) => CallSetActionKey(action, key, 2, out message) == 1;
/// <summary>v90: items dragged out of AC's UI can be dropped on a plugin window (<see cref="DropTarget"/>).</summary>
public bool HasDropTargets => _api.Version >= 90 && _api.DropTargetFn != IntPtr.Zero;
/// <summary>
/// v90: the plugin window <paramref name="window"/> (its panel title) takes items dragged out of AC's
/// UI (a pack, the inventory) and let go over <paramref name="min"/>-<paramref name="max"/> (ImGui
/// screen coordinates). Call it every frame the window draws; <paramref name="accepting"/> false =
/// drawn but a drop isn't wanted now (it goes to AC as usual). A drop taken never reaches AC: the item
/// stays where it was. Returns the object dropped since the last call (0 = none);
/// <paramref name="dragging"/>: an item is being dragged now. AC's main thread, in the window's draw.
/// </summary>
public uint DropTarget(string window, System.Numerics.Vector2 min, System.Numerics.Vector2 max, bool accepting, out bool dragging)
{
dragging = false;
if (!HasDropTargets || string.IsNullOrEmpty(window) || window.Length > 64) return 0;
Span<byte> utf8 = stackalloc byte[260];
int n = System.Text.Encoding.UTF8.GetBytes(window, utf8[..^1]);
utf8[n] = 0;
int drag = 0;
uint item;
fixed (byte* p = utf8)
item = ((delegate* unmanaged[Cdecl]<byte*, float, float, float, float, int, int*, uint>)_api.DropTargetFn)(
p, min.X, min.Y, max.X, max.Y, accepting ? 1 : 0, &drag);
dragging = drag != 0;
return item;
}
/// <summary>v90: AC's own panels (<see cref="IsAcPanelOpen"/>, <see cref="AcPanel"/>).</summary>
public bool HasAcPanels => _api.Version >= 90 && _api.AcPanelFn != IntPtr.Zero;
/// <summary>
/// v90: whether AC's panel is open: true, false, or null when this client has no such panel or the
/// engine can't tell. AC's main thread (a window's draw); cheap to ask every frame.
/// </summary>
public bool? IsAcPanelOpen(RynthAcPanel panel)
{
if (!HasAcPanels) return null;
int r = ((delegate* unmanaged[Cdecl]<int, int, int>)_api.AcPanelFn)((int)panel, 0);
return r < 0 ? null : r == 1;
}
/// <summary>
/// v90: opens, closes or toggles AC's own panel, the way AC's toolbar buttons and keys do (one main
/// panel shows at a time, as in AC). Done on AC's game thread; true when queued. Any thread.
/// </summary>
public bool AcPanel(RynthAcPanel panel, RynthAcPanelOp op = RynthAcPanelOp.Toggle)
{
if (!HasAcPanels) return false;
return ((delegate* unmanaged[Cdecl]<int, int, int>)_api.AcPanelFn)((int)panel, (int)op) == 1;
}
private int CallSetActionKey(string action, string key, int op, out string message)
{
message = string.Empty;
if (!HasKeyBinding) { message = "This RynthCore can't change keys."; return -1; }
if (string.IsNullOrEmpty(action) || action.Length > 64 || string.IsNullOrEmpty(key) || key.Length > 40) { message = "No action or key."; return -1; }
Span<byte> a = stackalloc byte[260];
Span<byte> k = stackalloc byte[164];
Span<byte> msg = stackalloc byte[512];
int an = System.Text.Encoding.UTF8.GetBytes(action, a[..^1]);
a[an] = 0;
int kn = System.Text.Encoding.UTF8.GetBytes(key, k[..^1]);
k[kn] = 0;
int r;
fixed (byte* ap = a)
fixed (byte* kp = k)
fixed (byte* mp = msg)
r = ((delegate* unmanaged[Cdecl]<byte*, byte*, int, byte*, int, int>)_api.SetActionKeyFn)(ap, kp, op, mp, msg.Length);
int n = msg.IndexOf((byte)0);
message = System.Text.Encoding.UTF8.GetString(msg[..(n < 0 ? msg.Length : n)]);
return r;
}
private int CallWithKey(IntPtr fn, string key, int arg)
{
if (!HasFramelessWindows || fn == IntPtr.Zero || string.IsNullOrEmpty(key) || key.Length > 64) return -1;
Span<byte> utf8 = stackalloc byte[260];
int n = System.Text.Encoding.UTF8.GetBytes(key, utf8[..^1]);
utf8[n] = 0;
fixed (byte* p = utf8)
return ((delegate* unmanaged[Cdecl]<byte*, int, int>)fn)(p, arg);
}
public bool InvokeChatParser(string text)
{
if (_api.InvokeChatParserFn == IntPtr.Zero || string.IsNullOrEmpty(text))

View file

@ -20,6 +20,16 @@ public enum RynthUiColor
/// <summary>Fixed, whatever the theme: good / bad.</summary>
Green = 16, Red = 17,
TitleBar = 18, WindowBorder = 19,
/// <summary>v90: the theme's own muted text (<see cref="TextMuted"/> is a lighter mix of it and the text).</summary>
Muted = 20,
/// <summary>v90, the instrument look (worked out from the theme's eight colours): a key's face, a step up from the background.</summary>
KeyFace = 21,
/// <summary>v90: hairlines and key borders.</summary>
Hairline = 22,
/// <summary>v90: inset wells (an activity line, bar tracks), darker than the background.</summary>
Inset = 23,
/// <summary>v90: faint text (units, secondary numbers).</summary>
Faint = 24,
}
/// <summary>A font the engine bakes (RynthCoreHost.GetUiFont): sizes in pixels at 100% text size.</summary>
@ -30,6 +40,12 @@ public enum RynthUiFont
Ui11 = 2,
Ui14 = 3, Ui18 = 4, UiBold11 = 5, UiBold14 = 6,
Mono9 = 7, Mono10 = 8, Mono12 = 9, Chat10 = 10, Chat12 = 11, Chat14 = 12,
/// <summary>v90: Cascadia Mono (Consolas without it): numbers that line up.</summary>
Dash9 = 13, Dash10 = 14, Dash11 = 15, Dash14 = 16,
/// <summary>v90: Barlow Semi Condensed SemiBold, narrow labels.</summary>
Narrow9 = 17, Narrow10 = 18, Narrow11 = 19,
/// <summary>v90: Barlow Semi Condensed Bold.</summary>
NarrowBold11 = 20, NarrowBold13 = 21,
}
/// <summary>What RynthCoreHost.SetPanelOpen does.</summary>
@ -37,3 +53,90 @@ public enum RynthPanelOpen
{
Ask = -1, Close = 0, Open = 1, Toggle = 2,
}
/// <summary>What RynthCoreHost.SetPanelPopOut does (v90).</summary>
public enum RynthPanelPopOut
{
Ask = -1, Dock = 0, PopOut = 1, Toggle = 2,
}
/// <summary>What RynthCoreHost.ShortcutAction does to an AC shortcut slot (v90).</summary>
public enum RynthShortcutOp
{
Use = 0, Set = 1, Clear = 2,
}
/// <summary>What RynthCoreHost.GetIconTexture draws (v90).</summary>
public enum RynthIconKind
{
/// <summary>An icon (0x06 texture) id.</summary>
Icon = 0,
/// <summary>An object id: the item's icon with its underlay and overlay.</summary>
Object = 1,
/// <summary>A spell id: the spell's icon.</summary>
Spell = 2,
}
/// <summary>Where RynthCoreHost.PollKeyCapture is (v90).</summary>
public enum RynthKeyCapture
{
/// <summary>Still waiting for a key (the text, if any, says why the last one couldn't be taken).</summary>
Waiting = 0,
/// <summary>A key was pressed: its name ("Ctrl+F5") is the text.</summary>
Pressed = 1,
/// <summary>Esc, the time ran out, or it was stopped.</summary>
Cancelled = 2,
}
/// <summary>
/// AC's own panels for RynthCoreHost.AcPanel (v90): the ids AC's panel notice uses
/// (CM_UI::SendNotice_SetPanelVisibility), read from the client 2026-10-22.
/// </summary>
public enum RynthAcPanel
{
/// <summary>Book (gmBookUI).</summary>
Book = 2,
/// <summary>Character information: titles, birth, deaths (gmCharacterInfoUI).</summary>
CharacterInfo = 3,
/// <summary>Beneficial spells in effect.</summary>
HelpfulSpells = 4,
/// <summary>Harmful spells in effect.</summary>
HarmfulSpells = 5,
/// <summary>The pack: paper doll and backpack (gmInventoryUI).</summary>
Inventory = 7,
/// <summary>Link status.</summary>
LinkStatus = 8,
/// <summary>Options: gameplay and configuration (gmGameplayOptionsUI, gmConfigUI).</summary>
Options = 10,
/// <summary>Attributes and skills (gmAttributeUI, gmSkillUI).</summary>
Character = 11,
/// <summary>Allegiance, fellowship, friends and squelch, one tabbed panel.</summary>
Social = 12,
/// <summary>The spellbook and spell components (gmSpellbookUI).</summary>
Spellbook = 13,
/// <summary>Urgent assistance (help).</summary>
Help = 14,
/// <summary>Vitae.</summary>
Vitae = 15,
/// <summary>The map (gmMapUI).</summary>
Map = 16,
/// <summary>Contracts, journal and page list (quests).</summary>
Quests = 25,
}
/// <summary>What RynthCoreHost.AcPanel does (v90).</summary>
public enum RynthAcPanelOp
{
Toggle = 1, Open = 2, Close = 3,
}
/// <summary>What RynthCoreHost.CheckActionKey found (v90).</summary>
public enum RynthKeyCheck
{
/// <summary>The key can't be bound to it (the message says why).</summary>
Invalid = -1,
/// <summary>Nothing else uses the key.</summary>
Free = 0,
/// <summary>Binding it takes it from what the message names.</summary>
Taken = 1,
}

View file

@ -36,7 +36,7 @@
<PropertyGroup>
<!-- The engine API this SDK knows; tools\PluginManifestTests checks it equals PluginContractVersion.Current. -->
<RynthCoreSdkApiVersion>89</RynthCoreSdkApiVersion>
<RynthCoreSdkApiVersion>90</RynthCoreSdkApiVersion>
<!-- The first engine API that loads managed plugins and gives them Runtime\PluginShared (2026.10.19.1). -->
<RynthCoreManagedPluginApi>88</RynthCoreManagedPluginApi>
<_RynthPluginManifestOn Condition="'$(RynthPluginMinEngineApi)' != '' and '$(RynthPluginManifest)' != 'false'">true</_RynthPluginManifestOn>