diff --git a/src/RynthCore.Engine/ImGui/Panels/ChatFiltersFace.cs b/src/RynthCore.Engine/ImGui/Panels/ChatFiltersFace.cs
index 5eb4e05..e07110c 100644
--- a/src/RynthCore.Engine/ImGui/Panels/ChatFiltersFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/ChatFiltersFace.cs
@@ -79,6 +79,8 @@ internal sealed class ChatFiltersFace : IImGuiPanel
"Colour only: no routing; the rule just colours.",
};
private static readonly string[] ColorLabels = { "No colour", "Colour line", "Colour match" };
+ /// Indexed by .
+ private static readonly string[] ModeLabels = { "Regex", "Contains", "Starts with", "Ends with" };
public void Draw()
{
@@ -118,6 +120,7 @@ internal sealed class ChatFiltersFace : IImGuiPanel
Label("No rules yet. Click \"Add rule\", or right-click a line in the chat", Mute);
Label("and pick \"Move them to\", \"Hide them\" or \"Colour them\".", Mute);
}
+ DrawStandardFilters(rowW);
ImGuiNET.ImGui.PopStyleColor(2);
ImGuiNET.ImGui.EndChild();
@@ -156,6 +159,58 @@ internal sealed class ChatFiltersFace : IImGuiPanel
edit?.Invoke(); // after drawing: the rows above drew from the old list
}
+ // ── Standard filters (RynthChatPresets) ──────────────────────────────
+
+ ///
+ /// The canned filters, by group: tick to hide, or pick a tab to move the lines there.
+ /// The router checks them after the rules, for lines no rule moved or hid.
+ ///
+ private void DrawStandardFilters(float rowW)
+ {
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 6));
+ if (!ImGuiNET.ImGui.CollapsingHeader("Standard filters##std")) return;
+ ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.Ui9));
+ Label("Checked after the rules above, only for lines no rule moved or hid.", Mute);
+ Label("Tick to hide the lines; pick a tab to move them there instead.", Mute);
+ ImGuiNET.ImGui.PopFont();
+ foreach (string group in UI.Panels.RynthChatPresets.Groups)
+ {
+ int on = 0, total = 0;
+ foreach (var p in UI.Panels.RynthChatPresets.All)
+ if (p.Group == group) { total++; if (p.Enabled) on++; }
+ if (!ImGuiNET.ImGui.TreeNode($"{group} ({on}/{total})###grp_{group}")) continue;
+ foreach (var p in UI.Panels.RynthChatPresets.All)
+ {
+ if (p.Group != group) continue;
+ ImGuiNET.ImGui.PushID(p.Id);
+ bool enabled = p.Enabled;
+ if (ImGuiNET.ImGui.Checkbox(p.Label, ref enabled)) { p.Enabled = enabled; ChatModel.FiltersChanged(); }
+ ImGuiNET.ImGui.SetItemTooltip(p.Description + "\nExample: " + p.Example);
+ ImGuiNET.ImGui.SameLine(Math.Max(ImGuiNET.ImGui.GetCursorPosX() + 8, rowW * 0.6f));
+ string tabText = (p.Tab.Length == 0 ? "hide" : "to " + p.Tab) + Caret;
+ if (ImGuiNET.ImGui.SmallButton(tabText))
+ OpenPresetTabPicker(p, new Vector2(ImGuiNET.ImGui.GetItemRectMin().X, ImGuiNET.ImGui.GetItemRectMax().Y + 2));
+ ImGuiNET.ImGui.SetItemTooltip("Where its lines go: hidden, or moved to a tab");
+ ImGuiNET.ImGui.PopID();
+ }
+ ImGuiNET.ImGui.TreePop();
+ }
+ }
+
+ private void OpenPresetTabPicker(UI.Panels.RynthChatPresets.Preset preset, Vector2 below)
+ {
+ string[] tabs = ChatModel.TargetTabs();
+ var items = new string[tabs.Length + 1];
+ items[0] = "Hide";
+ Array.Copy(tabs, 0, items, 1, tabs.Length);
+ int selected = preset.Tab.Length == 0 ? 0 : Math.Max(0, Array.FindIndex(tabs, t => string.Equals(t, preset.Tab, StringComparison.OrdinalIgnoreCase)) + 1);
+ _picker.Open(below, items, selected, k =>
+ {
+ preset.Tab = k <= 0 ? "" : items[k];
+ ChatModel.FiltersChanged();
+ }, 160);
+ }
+
private void Flash(string message)
{
_flash = message;
@@ -216,6 +271,18 @@ internal sealed class ChatFiltersFace : IImGuiPanel
float left = p.X + 42, right = card.X + rowW - 4;
var flow = new Flow(left, p.Y + rowH + 4, right, rowH);
+ int matchMode = (int)r.Mode;
+ string modeText = ModeLabels[matchMode] + Caret;
+ Vector2 mPos = flow.Place(ButtonWidth(modeText));
+ if (Button("##mode", modeText, mPos, new Vector2(ButtonWidth(modeText), rowH), Text, BtnFill))
+ _picker.Open(mPos + new Vector2(0, rowH + 2), ModeLabels, matchMode, k =>
+ {
+ rule.Mode = (ChatMatchMode)k;
+ rule.Recompile();
+ ChatModel.FiltersChanged();
+ }, 120);
+ ImGuiNET.ImGui.SetItemTooltip("How the pattern matches: a regex, or plain text anywhere / at the start / at the end of the line.");
+
string whenText = "When: " + ChatModel.ConditionLabel(r.When) + Caret;
Vector2 wp = flow.Place(Math.Min(ButtonWidth(whenText), 240));
if (Button("##when", whenText, wp, new Vector2(Math.Min(ButtonWidth(whenText), 240), rowH), Text, BtnFill, leftAlign: true))
@@ -484,7 +551,12 @@ internal sealed class ChatFiltersFace : IImGuiPanel
var trace = new List();
ChatRoute route = ChatModel.TestRouter().Evaluate(text, channel, type, trace);
foreach (ChatRouter.Step step in trace)
- _testResult.Add(((step.Rule < 0 ? "Your name" : $"Rule {step.Rule + 1}") + ": " + step.What, Text));
+ _testResult.Add((step.Rule switch
+ {
+ ChatRouter.StandardFilterStep => "Standard",
+ < 0 => "Your name",
+ _ => $"Rule {step.Rule + 1}",
+ } + ": " + step.What, Text));
if (trace.Count == 0) _testResult.Add(("No rule matches.", Faded(Mute)));
string where;
diff --git a/src/RynthCore.Engine/ImGui/Panels/DungeonMapFace.cs b/src/RynthCore.Engine/ImGui/Panels/DungeonMapFace.cs
index 42b1e9f..558e47b 100644
--- a/src/RynthCore.Engine/ImGui/Panels/DungeonMapFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/DungeonMapFace.cs
@@ -44,7 +44,7 @@ internal sealed class DungeonMapFace : IImGuiPanel
{
DungeonMapSettingsStore.Load(); // engine init thread: the file read stays off AC's thread
ImGuiPanelHost.Register(Title,
- new PanelSpec(new Vector2(480, 520), new Vector2(240, 200), Background: 0, EdgeToEdge: true),
+ new PanelSpec(new Vector2(480, 520), new Vector2(240, 200), Background: 0, EdgeToEdge: true, OpenCentered: true),
() => new DungeonMapFace());
}
diff --git a/src/RynthCore.Engine/ImGui/Panels/InventoryFace.Classic.cs b/src/RynthCore.Engine/ImGui/Panels/InventoryFace.Classic.cs
index 807801e..ab31f00 100644
--- a/src/RynthCore.Engine/ImGui/Panels/InventoryFace.Classic.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/InventoryFace.Classic.cs
@@ -620,7 +620,7 @@ internal sealed partial class InventoryFace
_hover = it;
if (ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Left))
{
- _selected = it.Id;
+ SelectItem(it);
_pressItem = it;
_pressAt = ImGuiNET.ImGui.GetMousePos();
}
diff --git a/src/RynthCore.Engine/ImGui/Panels/InventoryFace.cs b/src/RynthCore.Engine/ImGui/Panels/InventoryFace.cs
index 8203e1d..065b6b4 100644
--- a/src/RynthCore.Engine/ImGui/Panels/InventoryFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/InventoryFace.cs
@@ -122,6 +122,7 @@ internal sealed partial class InventoryFace : IImGuiPanel
InventoryModel.Hover(0);
InventoryModel.Unsubscribe();
_dragItem = _pressItem = null;
+ ItemDragBridge.EndPopOutDrag();
_lootAdd.Cancel();
}
@@ -475,7 +476,7 @@ internal sealed partial class InventoryFace : IImGuiPanel
if (hot != null && ImGuiNET.ImGui.IsMouseClicked(ImGuiMouseButton.Left))
{
- _selected = hot.Id;
+ SelectItem(hot);
_pressItem = hot;
_pressAt = mouse;
}
@@ -749,6 +750,7 @@ internal sealed partial class InventoryFace : IImGuiPanel
_dragItem = null;
_pressItem = null;
if (item == null) return;
+ ItemDragBridge.EndPopOutDrag();
Vector2 m = ImGuiNET.ImGui.GetMousePos();
foreach (Target t in _targets)
{
@@ -759,13 +761,50 @@ internal sealed partial class InventoryFace : IImGuiPanel
}
}
- private void DrawDragGhost()
+ ///
+ /// ImGui drag-and-drop payload type for one item (uint object id), published while an item is
+ /// dragged so other ImGui windows (RynthAi's Mini Remote slots) can accept the drop. Must
+ /// match MiniRemoteHud.ItemPayloadType in RynthAi.
+ ///
+ public const string ItemPayloadType = "RYNTH_INV_ITEM";
+
+ ///
+ /// Selects here and in the game, like a click in the retail inventory, so
+ /// "selected item" features (Mini Remote slots, item info, loot rules) see it too.
+ ///
+ private void SelectItem(InventoryItem it)
+ {
+ _selected = it.Id;
+ // Queued, not called inline: Draw runs inside EndScene, and AC's SetSelectedObject rebuilds
+ // UI elements, so it runs at the main-thread queue's drain point instead.
+ if (ClientHelperHooks.GetSelectedItemId() != it.Id)
+ AcMainThreadQueue.EnqueueSetSelectedObject(it.Id);
+ }
+
+ private unsafe void DrawDragGhost()
{
if (_dragItem == null) return;
var fg = ImGuiNET.ImGui.GetForegroundDrawList();
Vector2 m = ImGuiNET.ImGui.GetMousePos() - new Vector2(Icon * 0.5f, Icon * 0.5f);
DrawItemIcon(fg, _dragItem.Id, m, Icon, 0xD0FFFFFF);
ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
+
+ // A popped-out Inventory draws in its own ImGui context: the client's drop targets
+ // only see the drag through the bridge, which republishes it in the main context.
+ if (ImGuiPopOuts.InPopOutFrame)
+ {
+ ItemDragBridge.NotePopOutDrag(_dragItem.Id);
+ return;
+ }
+
+ // Re-submitted every frame of the drag (an extern source expires when it isn't); the
+ // ghost above is the preview, so no ImGui tooltip.
+ if (ImGuiNET.ImGui.BeginDragDropSource(ImGuiDragDropFlags.SourceExtern | ImGuiDragDropFlags.SourceNoPreviewTooltip))
+ {
+ uint id = _dragItem.Id;
+ ImGuiNET.ImGui.SetDragDropPayload(ItemPayloadType, (IntPtr)(&id), sizeof(uint));
+ ImGuiNET.ImGui.EndDragDropSource();
+ }
}
// ── Tooltip ─────────────────────────────────────────────────────────
@@ -892,6 +931,11 @@ internal sealed partial class InventoryFace : IImGuiPanel
_lootAdd.Open(it.Id, it.Name, toOpenProfile: false);
if (ImGuiNET.ImGui.IsItemHovered())
ImGuiNET.ImGui.SetTooltip("Make a RynthAi loot rule for this item (preview first)");
+ if (!it.IsPack && ImGuiNET.ImGui.MenuItem("Add to item count HUD"))
+ UI.Data.RynthAiCommands.ApplyRemoteCommand("itemhudadd", it.Name);
+ if (ImGuiNET.ImGui.IsItemHovered())
+ ImGuiNET.ImGui.SetTooltip("Track how many of these you carry on RynthAi's floating item count HUD (/ra itemhud add)");
+ if (!it.IsPack) MiniRemoteMenu(it);
if (!idle)
ImGuiNET.ImGui.TextDisabled("(an item action is waiting)");
}
@@ -902,6 +946,36 @@ internal sealed partial class InventoryFace : IImGuiPanel
}
}
+ /// RynthAi Mini Remote quick-use grid size (HudState.MiniRemoteSlotCount, 6 rows of 5).
+ private const int MiniRemoteSlots = 30, MiniRemoteColumns = 5;
+
+ ///
+ /// "Add to Mini Remote" submenu: first empty slot, or a numbered grid laid out like the
+ /// remote's own slots. RynthAi validates the item and reports the result in chat.
+ ///
+ private static void MiniRemoteMenu(InventoryItem it)
+ {
+ if (!ImGuiNET.ImGui.BeginMenu("Add to Mini Remote")) return;
+ if (ImGuiNET.ImGui.MenuItem("First empty slot"))
+ UI.Data.RynthAiCommands.ApplyRemoteCommand("remoteslot", "first " + it.Id.ToString(CultureInfo.InvariantCulture));
+ ImGuiNET.ImGui.Separator();
+ ImGuiNET.ImGui.TextDisabled("Or pick a slot (replaces what's there):");
+ for (int i = 0; i < MiniRemoteSlots; i++)
+ {
+ if (i % MiniRemoteColumns != 0) ImGuiNET.ImGui.SameLine();
+ string label = (i + 1).ToString("00", CultureInfo.InvariantCulture);
+ if (ImGuiNET.ImGui.Button(label, new Vector2(28, 0)))
+ {
+ UI.Data.RynthAiCommands.ApplyRemoteCommand("remoteslot",
+ (i + 1).ToString(CultureInfo.InvariantCulture) + " " + it.Id.ToString(CultureInfo.InvariantCulture));
+ ImGuiNET.ImGui.CloseCurrentPopup();
+ }
+ }
+ ImGuiNET.ImGui.Separator();
+ ImGuiNET.ImGui.TextDisabled("Tip: you can also drag the item onto a slot.");
+ ImGuiNET.ImGui.EndMenu();
+ }
+
// ── Split dialog ────────────────────────────────────────────────────
private void SplitDialog(InventoryView view)
diff --git a/src/RynthCore.Engine/ImGui/Panels/NavFace.cs b/src/RynthCore.Engine/ImGui/Panels/NavFace.cs
index baa21e6..36d4235 100644
--- a/src/RynthCore.Engine/ImGui/Panels/NavFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/NavFace.cs
@@ -1,21 +1,28 @@
// ============================================================================
// RynthCore.Engine - ImGui/Panels/NavFace.cs
// ImGui face of the Nav panel (UI/Panels/NavPanel.cs): active nav + status,
-// Start/Stop, route type and insert mode, Add Waypoint / Portal (not yet) /
-// Recall / Clear / Save / Dungeon Patrol, a chat waypoint, Save As, the nav
-// file picker, the nav point reach (RynthAi's FollowNavMin, the same row as
-// Settings > Navigation), and the waypoint list (click selects the insert
-// point, X deletes, => marks the active one).
+// Start/Stop, route type and insert mode, the Breadcrumbs and Route overlay
+// toggles, Add Waypoint / Portal (selected object) /
+// Recall / Clear / Save / Dungeon Patrol, the route editor (move / duplicate /
+// delete / set active / move here on the selection; nearest, reverse, snap to
+// path, point at selection, pause, simplify; recording and trail -> route),
+// a chat waypoint, Save As, the nav file picker, the nav point reach
+// (RynthAi's FollowNavMin, the same row as Settings > Navigation), and the
+// waypoint list (click selects, Ctrl/Shift-click multi-selects, double-click
+// sets active, right-click edits, X or Delete deletes, => marks the active one).
//
// Data: UiSources.Nav (hub) and NavCommands. Button actions change a private
// copy at once; the plugin applies commands immediately, so the next
-// snapshot (requested right after) replaces the copy. The reach row reads
-// UiSources.Settings and saves through SettingsCommands, like the Settings face.
+// snapshot (requested right after) replaces the copy. Edits send indices into
+// the route this face shows, so the selection is remapped locally as the copy
+// changes. The reach row reads UiSources.Settings and saves through
+// SettingsCommands, like the Settings face.
// ============================================================================
using System;
using System.Collections.Generic;
using System.Globalization;
+using System.Linq;
using System.Numerics;
using ImGuiNET;
using RynthCore.Engine.UI.Data;
@@ -28,7 +35,7 @@ internal sealed class NavFace : IImGuiPanel
public const string Title = "Nav";
public static void Register() => ImGuiPanelHost.Register(Title,
- new PanelSpec(new Vector2(400, 560), new Vector2(360, 380), EdgeToEdge: true),
+ new PanelSpec(new Vector2(400, 680), new Vector2(360, 440), EdgeToEdge: true),
() => new NavFace());
private static readonly string[] Actions =
@@ -38,12 +45,30 @@ internal sealed class NavFace : IImGuiPanel
};
private const string StartNav = PhosphorIcons.Play + " Start Navigation", StopNav = PhosphorIcons.Stop + " Stop Navigation";
private const string AddChat = PhosphorIcons.Plus + " Add Chat", SaveAs = PhosphorIcons.FloppyDisk + " Save As";
- private static readonly bool[] ActionsEnabled = { true, false, true, true, true, true };
+
+ // Route editor rows. Edit acts on the selected waypoints; Tools on the route.
+ private static readonly string[] EditActions =
+ {
+ PhosphorIcons.ArrowUp + " Up", PhosphorIcons.ArrowDown + " Down", PhosphorIcons.Copy + " Duplicate",
+ PhosphorIcons.Trash + " Delete", PhosphorIcons.Target + " Set Active", PhosphorIcons.Crosshair + " Move Here",
+ };
+ private static readonly string[] ToolActions =
+ {
+ PhosphorIcons.NavigationArrow + " Nearest", PhosphorIcons.ArrowsClockwise + " Reverse", PhosphorIcons.Path + " Snap to Path",
+ PhosphorIcons.MapPin + " Point at Selected", PhosphorIcons.Hourglass + " Add Pause", PhosphorIcons.Scissors + " Simplify",
+ };
+ private static readonly string[] RowMenu =
+ { "Set Active", "Move Here", "Move Up", "Move Down", "Duplicate", "Delete" };
+ private const string FromTrail = PhosphorIcons.Footprints + " Route from Trail...";
+ private readonly bool[] _editEnabled = new bool[6];
private NavPayload _data = new();
private long _seenVersion = -1;
private readonly List _pointText = new();
- private int _selected = -1, _addMode;
+ // _selected is the focus row (insert point, chat editing); _multi is every selected row,
+ // always containing _selected when it is set. _anchor starts Shift-click ranges.
+ private int _selected = -1, _anchor = -1, _addMode;
+ private readonly HashSet _multi = new();
private bool _typing;
private string _routeLabel = "Route: Once", _insertLabel = "Insert: End", _activeLabel = "Active Nav: None (Unsaved)";
private string _fileLabel = "Select nav file...";
@@ -130,13 +155,32 @@ internal sealed class NavFace : IImGuiPanel
});
NextLine(p, 26);
+ // Breadcrumbs | Route overlay (RynthAi's NavOverlaySettings; saved per character)
+ p = ImGuiNET.ImGui.GetCursorScreenPos();
+ if (OverlayToggle("##crumbs", "Breadcrumbs", _data.TrackBreadcrumbs, p, half,
+ "Record the trail you walk and draw it on the ground (/ra navtrail on|off).\nTurning it off hides the trail; /ra navtrail clear wipes it."))
+ {
+ bool on = !_data.TrackBreadcrumbs;
+ NavCommands.Send(new NavCmd { Cmd = "setBreadcrumbs", On = on });
+ _data.TrackBreadcrumbs = on;
+ }
+ if (OverlayToggle("##routeovl", "Route overlay", _data.ShowRouteOverlay, new Vector2(p.X + half + 4, p.Y), half,
+ "Draw the route in the world: waypoint rings and lines, waypoint labels and the guide line\nto the active waypoint (/ra navoverlay on|off). The waypoint HUD window is separate."))
+ {
+ bool on = !_data.ShowRouteOverlay;
+ NavCommands.Send(new NavCmd { Cmd = "setRouteOverlay", On = on });
+ _data.ShowRouteOverlay = on;
+ }
+ NextLine(p, 26);
+
typing |= ReachRow(w);
// Actions
- int action = WrapButtons("nav_act", Actions, w, 24, ActionsEnabled);
+ int action = WrapButtons("nav_act", Actions, w, 24);
switch (action)
{
case 0: NavCommands.Send(new NavCmd { Cmd = "addWaypoint", AddMode = _addMode, InsertAt = _selected }); break;
+ case 1: NavCommands.Send(new NavCmd { Cmd = "addPortal", AddMode = _addMode, InsertAt = _selected }); break;
case 2:
_picker.Open(ImGuiNET.ImGui.GetIO().MousePos, NavCommands.RecallLabels, -1, i =>
NavCommands.Send(new NavCmd { Cmd = "addRecall", SpellId = NavCommands.RecallIds[i], AddMode = _addMode, InsertAt = _selected }));
@@ -144,13 +188,15 @@ internal sealed class NavFace : IImGuiPanel
case 3:
NavCommands.Send(new NavCmd { Cmd = "clearRoute" });
_data.Points.Clear();
- _selected = -1;
+ ClearSelection();
RebuildPointText();
break;
case 4: NavCommands.Send(new NavCmd { Cmd = "saveRoute" }); break;
case 5: NavCommands.Send(new NavCmd { Cmd = "dunPatrol" }); break;
}
+ RouteEditor(w);
+
// Chat waypoint: sent as if typed when the route reaches it. Selecting an
// existing chat waypoint loads its command here; Update saves the edit.
bool chatSelected = _selected >= 0 && _selected < _data.Points.Count
@@ -230,6 +276,9 @@ internal sealed class NavFace : IImGuiPanel
ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0, 1));
ImGuiNET.ImGui.BeginChild("##nav_points", new Vector2(w, listH));
Waypoints(ImGuiNET.ImGui.GetContentRegionAvail().X);
+ if (!typing && _multi.Count > 0 && ImGuiNET.ImGui.IsKeyPressed(ImGuiKey.Delete, false)
+ && (ImGuiNET.ImGui.IsWindowHovered() || ImGuiNET.ImGui.IsWindowFocused()))
+ DeleteSelected();
ImGuiNET.ImGui.EndChild();
ImGuiNET.ImGui.PopStyleVar();
ImGuiNET.ImGui.PopStyleColor();
@@ -239,6 +288,18 @@ internal sealed class NavFace : IImGuiPanel
_picker.Draw();
}
+ ///
+ /// A checkbox-style toggle button: ticked box and teal text when on, empty box and muted
+ /// text when off. Returns true when clicked (the caller flips the value).
+ ///
+ private static bool OverlayToggle(string id, string label, bool on, Vector2 pos, float width, string tooltip)
+ {
+ string text = (on ? PhosphorIcons.CheckSquare : PhosphorIcons.Square) + " " + label;
+ bool clicked = Button(id, text, pos, new Vector2(width, 22), on ? Teal : Mute, BtnFill, leftAlign: true);
+ if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetTooltip(tooltip);
+ return clicked;
+ }
+
///
/// Nav point reach (yd): how close nav gets to each nav point before moving on. Label,
/// [-] value [+]; the typed value commits on Enter or when the box loses focus. Saves the
@@ -303,20 +364,24 @@ internal sealed class NavFace : IImGuiPanel
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
const float h = 22;
if (p.Y + h < clipMin.Y || p.Y > clipMax.Y) { ImGuiNET.ImGui.Dummy(new Vector2(w, h)); continue; }
- bool active = i == _data.ActiveNavIndex, selected = i == _selected;
+ bool active = i == _data.ActiveNavIndex, selected = _multi.Contains(i);
ImGuiNET.ImGui.PushID(i);
// Row click selects (drawn first so the X button on top wins).
ImGuiNET.ImGui.SetCursorScreenPos(p);
ImGuiNET.ImGui.SetNextItemAllowOverlap(); // the X button on top gets its clicks
- if (ImGuiNET.ImGui.InvisibleButton("##row", new Vector2(w, h))) _selected = i;
+ if (ImGuiNET.ImGui.InvisibleButton("##row", new Vector2(w, h))) ClickRow(i);
+ if (ImGuiNET.ImGui.IsItemHovered() && ImGuiNET.ImGui.IsMouseDoubleClicked(ImGuiMouseButton.Left))
+ SetActive(i);
+ if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
+ {
+ if (!selected) SelectOnly(i);
+ _picker.Open(ImGuiNET.ImGui.GetIO().MousePos, RowMenu, -1, RowMenuPick, width: 140);
+ }
dl.AddRectFilled(p, p + new Vector2(w, h), selected ? Selected : i % 2 == 0 ? PanelBg : RowAlt);
if (IconButton("##del", PhosphorIcons.X, new Vector2(p.X + 2, p.Y + 2), new Vector2(18, 18), Text, DeleteBg, font: UiFont.Ui11))
{
NavCommands.Send(new NavCmd { Cmd = "deletePoint", Index = i });
- if (_selected == i) _selected = -1;
- else if (_selected > i) _selected--;
- _data.Points.RemoveAt(i);
- RebuildPointText();
+ RemoveLocal(new HashSet { i });
ImGuiNET.ImGui.PopID();
return;
}
@@ -331,6 +396,216 @@ internal sealed class NavFace : IImGuiPanel
}
}
+ ///
+ /// Route editor: Edit row (on the selection), Tools row (on the route), the Record toggle
+ /// with "Route from Trail...", and the last edit's result. Picker-backed buttons (pause,
+ /// simplify, trail) double as the confirmation for edits that can't be undone.
+ ///
+ private void RouteEditor(float w)
+ {
+ int n = _multi.Count, count = _data.Points.Count;
+ bool one = n == 1 && _selected >= 0;
+ _editEnabled[0] = n > 0 && _multi.Min() > 0;
+ _editEnabled[1] = n > 0 && _multi.Max() < count - 1;
+ _editEnabled[2] = _editEnabled[3] = n > 0;
+ _editEnabled[4] = _editEnabled[5] = one;
+ Label(n > 1 ? $"Edit ({n} selected)" : "Edit", Mute);
+ switch (WrapButtons("nav_edit", EditActions, w, 22, _editEnabled))
+ {
+ case 0: MoveSelected(-1); break;
+ case 1: MoveSelected(+1); break;
+ case 2: DuplicateSelected(); break;
+ case 3: DeleteSelected(); break;
+ case 4: SetActive(_selected); break;
+ case 5: NavCommands.Send(new NavCmd { Cmd = "movePointHere", Index = _selected }); break;
+ }
+
+ Vector2 at = ImGuiNET.ImGui.GetIO().MousePos;
+ switch (WrapButtons("nav_tools", ToolActions, w, 22))
+ {
+ case 0: NavCommands.Send(new NavCmd { Cmd = "nearestActive" }); break;
+ case 1:
+ if (count < 2) break;
+ NavCommands.Send(new NavCmd { Cmd = "reverseRoute" });
+ ReverseLocal();
+ break;
+ case 2: NavCommands.Send(new NavCmd { Cmd = "snapToPath" }); break;
+ case 3: NavCommands.Send(new NavCmd { Cmd = "addPointAtSelected", AddMode = _addMode, InsertAt = _selected }); break;
+ case 4:
+ _picker.Open(at, NavCommands.PauseLabels, -1, i => NavCommands.Send(new NavCmd
+ { Cmd = "addPause", Seconds = NavCommands.PauseSeconds[i], AddMode = _addMode, InsertAt = _selected }), width: 140);
+ break;
+ case 5:
+ _picker.Open(at, NavCommands.SimplifyLabels, -1, i =>
+ NavCommands.Send(new NavCmd { Cmd = "simplifyRoute", Yards = NavCommands.SimplifyYards[i] }), width: 300);
+ break;
+ }
+
+ // Record | Route from Trail...
+ Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
+ float half = (w - 4) / 2;
+ if (OverlayToggle("##record", "Record route", _data.IsRecording, p, half,
+ "Add a point every few yards as you walk, and portal steps as you use portals\n(/ra navrec on|off). Points go into the current route."))
+ {
+ bool on = !_data.IsRecording;
+ NavCommands.Send(new NavCmd { Cmd = "setRecording", On = on });
+ _data.IsRecording = on;
+ }
+ Vector2 tp = new(p.X + half + 4, p.Y);
+ if (Button("##fromtrail", FromTrail, tp, new Vector2(half, 22), Text, BtnFill, enabled: _data.TrailPoints >= 2))
+ _picker.Open(new Vector2(tp.X, tp.Y + 22), NavCommands.TrailChoices, -1, i =>
+ NavCommands.Send(new NavCmd { Cmd = "trailToRoute", Reverse = i == 1 }), width: 300);
+ if (ImGuiNET.ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
+ ImGuiNET.ImGui.SetTooltip(_data.TrailPoints >= 2
+ ? $"Breadcrumb trail: {_data.TrailPoints} crumbs, {_data.TrailYards:0} yd.\nThe new route is unsaved; the loaded nav file is not changed."
+ : "Turn on Breadcrumbs and walk a while to build a trail.");
+ NextLine(p, 26);
+
+ if (_data.EditStatus.Length > 0) Label(_data.EditStatus, Amber);
+ }
+
+ /// Plain click selects one row, Ctrl toggles a row, Shift selects from the anchor.
+ private void ClickRow(int i)
+ {
+ var io = ImGuiNET.ImGui.GetIO();
+ if (io.KeyShift && _anchor >= 0)
+ {
+ if (!io.KeyCtrl) _multi.Clear();
+ for (int k = Math.Min(_anchor, i); k <= Math.Max(_anchor, i); k++) _multi.Add(k);
+ _selected = i;
+ }
+ else if (io.KeyCtrl)
+ {
+ if (!_multi.Remove(i)) { _multi.Add(i); _selected = i; }
+ else if (_selected == i) _selected = _multi.Count > 0 ? _multi.Min() : -1;
+ _anchor = i;
+ }
+ else SelectOnly(i);
+ }
+
+ private void SelectOnly(int i)
+ {
+ _multi.Clear();
+ _multi.Add(i);
+ _selected = _anchor = i;
+ }
+
+ private void ClearSelection()
+ {
+ _multi.Clear();
+ _selected = _anchor = -1;
+ }
+
+ private List SelectedIndices()
+ {
+ var list = new List(_multi);
+ list.Sort();
+ return list;
+ }
+
+ private void RowMenuPick(int item)
+ {
+ switch (item)
+ {
+ case 0: if (_selected >= 0) SetActive(_selected); break;
+ case 1: if (_selected >= 0) NavCommands.Send(new NavCmd { Cmd = "movePointHere", Index = _selected }); break;
+ case 2: MoveSelected(-1); break;
+ case 3: MoveSelected(+1); break;
+ case 4: DuplicateSelected(); break;
+ case 5: DeleteSelected(); break;
+ }
+ }
+
+ private void SetActive(int i)
+ {
+ if (i < 0 || i >= _data.Points.Count) return;
+ NavCommands.Send(new NavCmd { Cmd = "setActive", Index = i });
+ _data.ActiveNavIndex = i;
+ }
+
+ /// Moves the selected rows one slot, the way the plugin does (NavRouteEditing.Move).
+ private void MoveSelected(int delta)
+ {
+ if (_multi.Count == 0) return;
+ NavCommands.Send(new NavCmd { Cmd = "movePoints", Indices = SelectedIndices(), Delta = delta });
+ var pts = _data.Points;
+ var sel = new HashSet();
+ foreach (int i in _multi) sel.Add(pts[i]);
+ NavPoint? focus = _selected >= 0 ? pts[_selected] : null, anchor = _anchor >= 0 && _anchor < pts.Count ? pts[_anchor] : null;
+ if (delta < 0)
+ {
+ for (int i = 1; i < pts.Count; i++)
+ if (sel.Contains(pts[i]) && !sel.Contains(pts[i - 1])) (pts[i - 1], pts[i]) = (pts[i], pts[i - 1]);
+ }
+ else
+ {
+ for (int i = pts.Count - 2; i >= 0; i--)
+ if (sel.Contains(pts[i]) && !sel.Contains(pts[i + 1])) (pts[i + 1], pts[i]) = (pts[i], pts[i + 1]);
+ }
+ _multi.Clear();
+ for (int i = 0; i < pts.Count; i++) if (sel.Contains(pts[i])) _multi.Add(i);
+ _selected = focus != null ? pts.IndexOf(focus) : -1;
+ _anchor = anchor != null ? pts.IndexOf(anchor) : _selected;
+ RebuildPointText();
+ }
+
+ /// Each selected row gets a copy right after it (as the plugin does); the copies end up selected.
+ private void DuplicateSelected()
+ {
+ if (_multi.Count == 0) return;
+ NavCommands.Send(new NavCmd { Cmd = "duplicatePoints", Indices = SelectedIndices() });
+ var result = new List(_data.Points.Count + _multi.Count);
+ var copies = new HashSet();
+ for (int i = 0; i < _data.Points.Count; i++)
+ {
+ NavPoint pt = _data.Points[i];
+ result.Add(pt);
+ if (!_multi.Contains(i)) continue;
+ copies.Add(result.Count);
+ result.Add(new NavPoint { Type = pt.Type, Desc = pt.Desc, Text = pt.Text, NS = pt.NS, EW = pt.EW, Z = pt.Z });
+ }
+ _data.Points = result;
+ _multi.Clear();
+ _multi.UnionWith(copies);
+ _selected = _anchor = _multi.Count > 0 ? _multi.Min() : -1;
+ RebuildPointText();
+ }
+
+ private void DeleteSelected()
+ {
+ if (_multi.Count == 0) return;
+ NavCommands.Send(new NavCmd { Cmd = "deletePoints", Indices = SelectedIndices() });
+ RemoveLocal(new HashSet(_multi));
+ }
+
+ /// Drops rows from the local copy and shifts the selection past them.
+ private void RemoveLocal(HashSet removed)
+ {
+ int Shift(int i) { int s = 0; foreach (int r in removed) if (r < i) s++; return i - s; }
+ var keep = new List();
+ foreach (int i in _multi) if (!removed.Contains(i)) keep.Add(Shift(i));
+ _selected = _selected >= 0 && !removed.Contains(_selected) ? Shift(_selected) : -1;
+ _anchor = _anchor >= 0 && !removed.Contains(_anchor) ? Shift(_anchor) : _selected;
+ _multi.Clear();
+ _multi.UnionWith(keep);
+ if (_selected < 0 && _multi.Count > 0) _selected = _multi.Min();
+ for (int i = _data.Points.Count - 1; i >= 0; i--) if (removed.Contains(i)) _data.Points.RemoveAt(i);
+ RebuildPointText();
+ }
+
+ private void ReverseLocal()
+ {
+ int last = _data.Points.Count - 1;
+ _data.Points.Reverse();
+ var flipped = new List();
+ foreach (int i in _multi) flipped.Add(last - i);
+ _multi.Clear();
+ _multi.UnionWith(flipped);
+ if (_selected >= 0) _selected = last - _selected;
+ if (_anchor >= 0) _anchor = last - _anchor;
+ RebuildPointText();
+ }
+
private void TakeSnapshot()
{
var snap = UiSources.Nav.Current;
@@ -338,7 +613,11 @@ internal sealed class NavFace : IImGuiPanel
_seenVersion = snap.Version;
_data = snap.Value.Clone();
_navFiles = _data.NavFiles.ToArray();
- if (_selected >= _data.Points.Count) _selected = -1;
+ int count = _data.Points.Count;
+ _multi.RemoveWhere(i => i >= count);
+ if (_selected >= count) _selected = -1;
+ if (_selected < 0 && _multi.Count > 0) _selected = _multi.Min();
+ if (_anchor >= count) _anchor = _selected;
RebuildPointText();
UpdateLabels();
}
diff --git a/src/RynthCore.Engine/ImGui/Panels/RynthAiFace.cs b/src/RynthCore.Engine/ImGui/Panels/RynthAiFace.cs
index 6e0bb4b..d0f493a 100644
--- a/src/RynthCore.Engine/ImGui/Panels/RynthAiFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/RynthAiFace.cs
@@ -145,6 +145,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
}
Bars(view, raw, x0, width, boxBg);
PatrolPopup();
+ CharMenu();
MeasureAndFit(start.Y);
// Last: a window of its own, placed against this one's rect (hidden popped out).
_drawers.Draw();
@@ -477,7 +478,7 @@ internal sealed partial class RynthAiFace : IImGuiPanel
private void Launchers(float x0, float width)
{
float y = ImGuiNET.ImGui.GetCursorScreenPos().Y;
- const int buttons = 8;
+ const int buttons = 10;
float bw = MathF.Floor((width - buttons * LauncherGap) / buttons);
// Short labels only when every button has room for its icon and label.
bool labels = bw >= 68;
@@ -516,6 +517,25 @@ internal sealed partial class RynthAiFace : IImGuiPanel
}
else _drawers.Toggle(_patrol);
}
+ x += bw + LauncherGap;
+
+ // Char and Hub open RynthAi's own ImGui overlay windows (Mini Remote, which is the ILT
+ // Hub, its section windows, Inventory HUDs). They draw only when the engine hands plugins
+ // its ImGui context.
+ Launcher("##l_char", PhosphorIcons.User, "Char",
+ "Char. Left-click: ILT Hub / Mini Remote (/ra hub show). Right-click: Hub windows, Progression (Skills panel).",
+ x, y, bw, labels, () => RynthAiCommands.ApplyRemoteCommand("hub", "show"));
+ if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
+ {
+ ImGuiNET.ImGui.SetNextWindowPos(ImGuiNET.ImGui.GetItemRectMin(), ImGuiCond.Always, new Vector2(0, 1));
+ ImGuiNET.ImGui.OpenPopup("##charmenu");
+ }
+ x += bw + LauncherGap;
+ Launcher("##l_hub", PhosphorIcons.SquaresFour, "Hub",
+ "Hub. Left-click: Mini Remote (/ra remote). Right-click: Inventory HUDs setup (/ra huds).",
+ x, y, bw, labels, () => RynthAiCommands.ApplyRemoteCommand("remote", "toggle"));
+ if (ImGuiNET.ImGui.IsItemClicked(ImGuiMouseButton.Right))
+ RynthAiCommands.ApplyRemoteCommand("huds", "show");
ImGuiNET.ImGui.SetCursorScreenPos(new Vector2(x0, y + LauncherH));
}
@@ -682,6 +702,46 @@ internal sealed partial class RynthAiFace : IImGuiPanel
dl.AddText(font, font.FontSize, new Vector2(x + 4 + CalcWidth(font, icon) + 3, ty), White, bar.Text ?? "");
}
+ // ── Char menu (right-click Char): RynthAi's character windows ──────────
+
+ /// ILT Hub section windows: menu label and the "/ra hub open" section name RynthAi parses.
+ private static readonly (string Label, string Section)[] HubSections =
+ {
+ ("Character", "character"), ("Quests", "quests"), ("Pets", "pets"),
+ ("Banking", "banking"), ("Gear", "gear"), ("Games", "games"), ("Guardian", "guardian"),
+ };
+
+ private static void CharMenu()
+ {
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.PopupBg, ShellBg);
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Border, BtnBord);
+ ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(8, 8));
+ bool open = ImGuiNET.ImGui.BeginPopup("##charmenu");
+ ImGuiNET.ImGui.PopStyleVar();
+ ImGuiNET.ImGui.PopStyleColor(2);
+ if (!open) return;
+ try
+ {
+ // The Mini Remote is the ILT Hub; each former Hub tab is its own window (toggled).
+ if (ImGuiNET.ImGui.MenuItem("Mini Remote (ILT Hub)", "/ra hub"))
+ RynthAiCommands.ApplyRemoteCommand("hub", "toggle");
+ ImGuiNET.ImGui.Separator();
+ foreach ((string label, string section) in HubSections)
+ {
+ if (ImGuiNET.ImGui.MenuItem(label, "/ra hub open " + section))
+ RynthAiCommands.ApplyRemoteCommand("hub", "open " + section + " toggle");
+ }
+ ImGuiNET.ImGui.Separator();
+ if (ImGuiNET.ImGui.MenuItem("Progression (Skills panel)"))
+ SkillsFace.ShowProgression();
+ ImGuiNET.ImGui.SetItemTooltip("XP planner, augmentations and enlightenment (ILT worlds)");
+ }
+ finally
+ {
+ ImGuiNET.ImGui.EndPopup();
+ }
+ }
+
// ── Patrol popup (right-click Patrol, popped out; docked it's the Patrol drawer) ──
private void PatrolPopup()
diff --git a/src/RynthCore.Engine/ImGui/Panels/SettingsFace.cs b/src/RynthCore.Engine/ImGui/Panels/SettingsFace.cs
index bdf3135..ef35e07 100644
--- a/src/RynthCore.Engine/ImGui/Panels/SettingsFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/SettingsFace.cs
@@ -54,13 +54,24 @@ internal sealed class SettingsFace : IImGuiPanel
}
private readonly Dictionary _edits = new();
+ /// Extra sidebar tab after the schema tabs; drawn from UiSources.Charms, not settings rows.
+ private const string CharmsTabName = "Charms Tracking";
+ private static int CharmsTab => SettingsSchema.Tabs.Length;
+ private const string CharmsHeader = "Advanced Settings > " + CharmsTabName;
+
public void OnShown()
{
UiSources.Settings.Subscribe();
UiSources.Settings.RequestRefresh();
+ UiSources.Charms.Subscribe();
+ UiSources.Charms.RequestRefresh();
}
- public void OnHidden() => UiSources.Settings.Unsubscribe();
+ public void OnHidden()
+ {
+ UiSources.Settings.Unsubscribe();
+ UiSources.Charms.Unsubscribe();
+ }
public void Draw()
{
@@ -100,9 +111,9 @@ internal sealed class SettingsFace : IImGuiPanel
var dl = ImGuiNET.ImGui.GetWindowDrawList();
float w = ImGuiNET.ImGui.GetContentRegionAvail().X;
SettingsTab[] tabs = SettingsSchema.Tabs;
- for (int i = 0; i < tabs.Length; i++)
+ for (int i = 0; i <= tabs.Length; i++)
{
- string tabName = tabs[i].Name;
+ string tabName = i < tabs.Length ? tabs[i].Name : CharmsTabName;
ImGuiNET.ImGui.Dummy(new Vector2(0, 1));
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
ImGuiNET.ImGui.PushID(i);
@@ -133,14 +144,23 @@ internal sealed class SettingsFace : IImGuiPanel
float w = ImGuiNET.ImGui.GetContentRegionAvail().X;
ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
- if (_tab >= SettingsSchema.Tabs.Length) _tab = 0;
- ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFF26D9E6), Headers[_tab]);
+ if (_tab > CharmsTab) _tab = 0;
+ bool charms = _tab == CharmsTab;
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFF26D9E6), charms ? CharmsHeader : Headers[_tab]);
ImGuiNET.ImGui.PopFont();
ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
Vector2 lp = ImGuiNET.ImGui.GetCursorScreenPos();
dl.AddLine(lp, lp + new Vector2(w, 0), BtnBord);
ImGuiNET.ImGui.Dummy(new Vector2(0, 6));
+ if (charms)
+ {
+ CharmsTabContent(w);
+ ImGuiNET.ImGui.PopStyleVar();
+ ImGuiNET.ImGui.EndChild();
+ return;
+ }
+
SettingRow[] rows = SettingsSchema.Tabs[_tab].Rows;
for (int i = 0; i < rows.Length; i++)
{
@@ -168,9 +188,77 @@ internal sealed class SettingsFace : IImGuiPanel
case SettingKind.Spacer: ImGuiNET.ImGui.Dummy(new Vector2(0, 6)); break;
case SettingKind.Note: Note(row.Label, w); break;
case SettingKind.CraftingStatus: CraftingStatus(row); break;
+ case SettingKind.Button: ButtonRow(row, w); break;
+ case SettingKind.TraceCategories: TraceCategoriesRow(row, w); break;
}
}
+ // [All on] [All off] [ILT Hub on], then a 3-column grid of square toggles, one per
+ // RynthAi trace category. Edits the copy's DiagCategories and saves like any other row.
+ private void TraceCategoriesRow(SettingRow row, float w)
+ {
+ var cats = TraceCategoryLevels.Parse(_data.DiagCategories);
+ if (cats.Count == 0)
+ {
+ Note("Waiting for RynthAi...", w);
+ return;
+ }
+
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
+ if (ImGuiNET.ImGui.Button("All on")) SaveCategories(TraceCategoryLevels.Set(_data.DiagCategories, "", true));
+ ImGuiNET.ImGui.SameLine(0, 6);
+ if (ImGuiNET.ImGui.Button("All off")) SaveCategories(TraceCategoryLevels.Set(_data.DiagCategories, "", false));
+ ImGuiNET.ImGui.SameLine(0, 6);
+ if (ImGuiNET.ImGui.Button("ILT Hub on")) SaveCategories(TraceCategoryLevels.Set(_data.DiagCategories, "", true, "Ilt"));
+ Tooltip(row);
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
+
+ var dl = ImGuiNET.ImGui.GetWindowDrawList();
+ float colW = Math.Max(80f, w / 3f);
+ int perRow = Math.Max(1, (int)(w / colW));
+ Vector2 start = ImGuiNET.ImGui.GetCursorScreenPos();
+ for (int i = 0; i < cats.Count; i++)
+ {
+ var (name, level) = cats[i];
+ bool on = level != TraceCategoryLevels.Off;
+ string label = TraceCategoryLevels.Label(name, level);
+ var p = start + new Vector2(i % perRow * colW, i / perRow * 18f);
+ ImGuiNET.ImGui.SetCursorScreenPos(p);
+ ImGuiNET.ImGui.PushID(name);
+ if (ImGuiNET.ImGui.InvisibleButton("##cat", new Vector2(colW - 4, 16)))
+ SaveCategories(TraceCategoryLevels.Set(_data.DiagCategories, name, !on));
+ if (ImGuiNET.ImGui.IsItemHovered()) ImGuiNET.ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
+ ImGuiNET.ImGui.PopID();
+ dl.AddRectFilled(p + new Vector2(0, 2), p + new Vector2(12, 14), on ? ToggleOn : ToggleOff, 2);
+ dl.PushClipRect(p, p + new Vector2(colW - 4, 16), true);
+ dl.AddText(p + new Vector2(18, (16 - ImGuiNET.ImGui.GetFontSize()) * 0.5f), TextDim, label);
+ dl.PopClipRect();
+ }
+ int rowsUsed = (cats.Count + perRow - 1) / perRow;
+ ImGuiNET.ImGui.SetCursorScreenPos(start + new Vector2(0, rowsUsed * 18f));
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
+ }
+
+ private void SaveCategories(string levels)
+ {
+ _data.DiagCategories = levels;
+ SettingsCommands.Save(_data.Clone());
+ }
+
+ // Label | [caption]; Click posts its own work (never runs plugin code on AC's thread).
+ private static void ButtonRow(SettingRow row, float w)
+ {
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 2));
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, TextDim);
+ ImGuiNET.ImGui.AlignTextToFramePadding();
+ ImGuiNET.ImGui.TextUnformatted(row.Label);
+ ImGuiNET.ImGui.PopStyleColor();
+ ImGuiNET.ImGui.SameLine(Math.Max(ImGuiNET.ImGui.GetCursorPosX() + 8, w * 0.45f));
+ if (ImGuiNET.ImGui.Button(row.ButtonText ?? row.Label))
+ row.Click?.Invoke();
+ Tooltip(row);
+ }
+
private void Changed(SettingRow row, double value)
{
row.Set!(_data, value);
@@ -382,6 +470,130 @@ internal sealed class SettingsFace : IImGuiPanel
}
}
+ // ── Charms Tracking tab ───────────────────────────────────────────────
+
+ private static readonly uint CharmOn = C(0xFF33FF33), CharmDisabled = C(0xFFFF5555);
+
+ /// Summary line, one table row per ACECustom registry charm, then how each column is known.
+ private static void CharmsTabContent(float w)
+ {
+ var snap = UiSources.Charms.Current;
+ if (snap == null)
+ {
+ Note("Waiting for RynthAi...", w);
+ return;
+ }
+ CharmsInfo info = snap.Value;
+ if (!info.Available)
+ {
+ Note("Charm tracking is for ILT (Infinite Leaftide / ACECustom) worlds."
+ + (info.World.Length > 0 ? " Current world: " + info.World + "." : ""), w);
+ Note("Use /ra hub force on to treat this world as ILT.", w);
+ return;
+ }
+
+ ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFE8B333),
+ $"{info.AcquiredCount} of {info.Total} acquired | {info.ActiveCount} active");
+ ImGuiNET.ImGui.PopFont();
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 4));
+
+ ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.CellPadding, new Vector2(4, 3));
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.TableRowBg, PanelBg);
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.TableRowBgAlt, ShellBg);
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.TableHeaderBg, TabActive);
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.TableBorderLight, BtnBord);
+ const ImGuiTableFlags flags = ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.SizingFixedFit;
+ if (ImGuiNET.ImGui.BeginTable("##charms", 5, flags, new Vector2(w, 0)))
+ {
+ ImGuiNET.ImGui.TableSetupColumn("Charm", ImGuiTableColumnFlags.WidthStretch);
+ ImGuiNET.ImGui.TableSetupColumn("Acquired", ImGuiTableColumnFlags.WidthFixed, 70);
+ ImGuiNET.ImGui.TableSetupColumn("Status", ImGuiTableColumnFlags.WidthFixed, 44);
+ ImGuiNET.ImGui.TableSetupColumn("Tier", ImGuiTableColumnFlags.WidthFixed, 32);
+ ImGuiNET.ImGui.TableSetupColumn("Server", ImGuiTableColumnFlags.WidthFixed, 56);
+ ImGuiNET.ImGui.TableHeadersRow();
+
+ CharmRow[] rows = info.Charms;
+ for (int i = 0; i < rows.Length; i++)
+ {
+ CharmRow r = rows[i];
+ ImGuiNET.ImGui.PushID(i);
+ ImGuiNET.ImGui.TableNextRow();
+
+ ImGuiNET.ImGui.TableNextColumn();
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFF2F7FC), r.Name);
+ if (r.Effect.Length > 0) ImGuiNET.ImGui.SetItemTooltip(r.Effect);
+
+ ImGuiNET.ImGui.TableNextColumn();
+ switch (r.Acquired)
+ {
+ case "carried":
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFF26D9E6), r.Count > 1 ? $"Carried x{r.Count}" : "Carried");
+ ImGuiNET.ImGui.SetItemTooltip("In your pack or equipped.");
+ break;
+ case "seen":
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFE8B333), "Stored");
+ ImGuiNET.ImGui.SetItemTooltip("Owned but not carried"
+ + (r.LastSeen.Length > 0 ? " (last carried " + r.LastSeen + ")" : "")
+ + ". The client only sees items you carry.");
+ break;
+ default:
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFB8C8D8), "Not yet");
+ break;
+ }
+
+ ImGuiNET.ImGui.TableNextColumn();
+ if (r.Acquired != "carried")
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFB8C8D8), "-");
+ else if (r.Active == "on")
+ ColoredText(CharmOn, "ON");
+ else if (r.Active == "off")
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFB8C8D8), "OFF");
+ else
+ {
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFE8B333), "?");
+ ImGuiNET.ImGui.SetItemTooltip("Waiting for the charm's appraisal (requested automatically).");
+ }
+
+ ImGuiNET.ImGui.TableNextColumn();
+ string tier = r.Tier <= 0 ? "-" : r.MaxTier > 0 ? $"{r.Tier}/{r.MaxTier}" : r.Tier.ToString(CultureInfo.InvariantCulture);
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFF2F7FC), tier);
+
+ ImGuiNET.ImGui.TableNextColumn();
+ if (r.Server == "off")
+ {
+ ColoredText(CharmDisabled, "Disabled");
+ ImGuiNET.ImGui.SetItemTooltip("The server refused or reported this charm as disabled.");
+ }
+ else if (r.Server == "on")
+ ColoredText(CharmOn, "Enabled");
+ else
+ {
+ ImGuiNET.ImGui.TextColored(RynthTheme.Vec(0xFFB8C8D8), "-");
+ ImGuiNET.ImGui.SetItemTooltip("Not reported. The server only tells players when a charm is refused.");
+ }
+
+ ImGuiNET.ImGui.PopID();
+ }
+ ImGuiNET.ImGui.EndTable();
+ }
+ ImGuiNET.ImGui.PopStyleColor(4);
+ ImGuiNET.ImGui.PopStyleVar();
+
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 6));
+ Note("Double-click a carried charm in your pack to toggle it. Status comes from the charm's appraisal "
+ + "(Status: ON/OFF) or your character's ability flag. Charms not carried are inactive.", w);
+ Note("Stored = carried by this character before; RynthAi remembers it per character.", w);
+ }
+
+ /// TextUnformatted in a packed ImGui colour.
+ private static void ColoredText(uint abgr, string text)
+ {
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Text, abgr);
+ ImGuiNET.ImGui.TextUnformatted(text);
+ ImGuiNET.ImGui.PopStyleColor();
+ }
+
private static bool StepButton(string id, Vector2 pos, string glyph)
{
var dl = ImGuiNET.ImGui.GetWindowDrawList();
@@ -409,6 +621,8 @@ internal sealed class SettingsFace : IImGuiPanel
["Crafting"] = PhosphorIcons.Hammer,
["Looting"] = PhosphorIcons.Bag,
["Vendoring"] = PhosphorIcons.Storefront,
+ ["Diagnostics"] = PhosphorIcons.Wrench,
+ [CharmsTabName] = PhosphorIcons.Gift,
};
private static readonly System.Collections.Generic.Dictionary TabLabels = new();
diff --git a/src/RynthCore.Engine/ImGui/Panels/SkillsFace.Progression.cs b/src/RynthCore.Engine/ImGui/Panels/SkillsFace.Progression.cs
new file mode 100644
index 0000000..774dd03
--- /dev/null
+++ b/src/RynthCore.Engine/ImGui/Panels/SkillsFace.Progression.cs
@@ -0,0 +1,326 @@
+// ============================================================================
+// RynthCore.Engine - ImGui/Panels/SkillsFace.Progression.cs
+// The Skills panel's Progression tab, shown on ILT-like worlds only:
+// - XP planner: exact XP for the next N raises of every attribute and vital,
+// from the client's XP tables (raising stays on the Attributes & Vitals tab).
+// - Augmentations / Enlightenment: RynthAi's ILT Hub planners. RynthAi owns the
+// math and the saved inputs (UiSources.Progression snapshot); edits and
+// actions go back as "prog ..." remote commands. /enl and arming
+// auto-enlighten ask here first; the server still shows its own dialog.
+// ============================================================================
+
+using System;
+using System.Globalization;
+using System.Numerics;
+using ImGuiNET;
+using RynthCore.Engine.UI;
+using RynthCore.Engine.UI.Data;
+using static RynthCore.Engine.ImGuiBackend.Panels.FaceKit;
+
+namespace RynthCore.Engine.ImGuiBackend.Panels;
+
+internal sealed partial class SkillsFace
+{
+ private const string ProgConfirmId = "##skills_prog_confirm";
+
+ private int _planLevels = 10; // XP planner: raises to price per row
+ private bool _progSubscribed;
+
+ // The confirm the Progression tab asked for; the command is sent only on its Yes button.
+ private string _progConfirmTitle = "", _progConfirmText = "", _progConfirmYes = "", _progConfirmCommand = "";
+ private bool _progConfirmOpenRequested;
+
+ // Set by ShowProgression (any panel, AC thread); the tab is selected once RynthAi's snapshot
+ // says it exists (the first poll lands a step after the panel opens).
+ private static bool _progressionRequested;
+
+ /// RynthAi reports an ILT-like world (its ILT Hub exists and the server has ILT features).
+ private static bool ProgressionTabVisible => UiSources.Progression.Current?.Value.Available == true;
+
+ /// Opens the Skills panel (if closed) on the Progression tab. AC thread.
+ public static void ShowProgression()
+ {
+ _progressionRequested = true;
+ if (!ImGuiPanelHost.IsOpen(Title)) PanelRouter.Toggle(Title);
+ }
+
+ /// Draw: applies a pending ShowProgression once the tab exists.
+ private void ApplyProgressionRequest()
+ {
+ if (!_progressionRequested || !ProgressionTabVisible) return;
+ _progressionRequested = false;
+ _tab = 2;
+ }
+
+ private void ProgressionShown()
+ {
+ if (_progSubscribed) return;
+ _progSubscribed = true;
+ UiSources.Progression.Subscribe();
+ UiSources.Progression.RequestRefresh();
+ }
+
+ private void ProgressionHidden()
+ {
+ _progressionRequested = false;
+ if (!_progSubscribed) return;
+ _progSubscribed = false;
+ UiSources.Progression.Unsubscribe();
+ }
+
+ /// Sends "prog <value>" to RynthAi; the snapshot re-polls after its next tick applies it.
+ private static void SendProg(string value)
+ {
+ RynthAiCommands.ApplyRemoteCommand("prog", value);
+ UiSources.Progression.RequestRefreshAfterPluginTick();
+ }
+
+ private void AskProgConfirm(string title, string text, string yes, string command)
+ {
+ _progConfirmTitle = title;
+ _progConfirmText = text;
+ _progConfirmYes = yes;
+ _progConfirmCommand = command;
+ _progConfirmOpenRequested = true;
+ }
+
+ // ── Body ────────────────────────────────────────────────────────────
+
+ private void DrawProgression(float w)
+ {
+ ProgressionInfo? info = UiSources.Progression.Current?.Value;
+ ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(6, 4));
+ try
+ {
+ DrawXpPlanner(w);
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 6));
+ if (info == null || !info.Available)
+ {
+ Message("Augmentations and Enlightenment need RynthAi's ILT Hub on an ILT world.", w);
+ return;
+ }
+ DrawAugPlanner(info.Aug, w);
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 6));
+ DrawEnlPlanner(info.Enl, w);
+ ImGuiNET.ImGui.Dummy(new Vector2(0, 8));
+ }
+ finally
+ {
+ ImGuiNET.ImGui.PopStyleVar();
+ }
+ }
+
+ private void DrawXpPlanner(float w)
+ {
+ Section("XP planner", w);
+ if (_snap == null || _dat == null || _attributes.Count == 0)
+ {
+ Message("Waiting for your character's data...", w);
+ return;
+ }
+ ImGuiNET.ImGui.Indent(8);
+ long have = _snap.UnassignedXp;
+ Label($"Unassigned XP: {have:N0}", have > 0 ? Teal : Mute);
+ ImGuiNET.ImGui.SetNextItemWidth(160);
+ ImGuiNET.ImGui.SliderInt("Raises to plan##prog_lv", ref _planLevels, 1, 100);
+
+ if (ImGuiNET.ImGui.BeginTable("##prog_xp", 4, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV | ImGuiTableFlags.SizingStretchProp,
+ new Vector2(w - 16, 0)))
+ {
+ ImGuiNET.ImGui.TableSetupColumn("Stat");
+ ImGuiNET.ImGui.TableSetupColumn("Base", ImGuiTableColumnFlags.WidthFixed, 50);
+ ImGuiNET.ImGui.TableSetupColumn("Next raise", ImGuiTableColumnFlags.WidthFixed, 100);
+ ImGuiNET.ImGui.TableSetupColumn($"Next {_planLevels}", ImGuiTableColumnFlags.WidthFixed, 120);
+ ImGuiNET.ImGui.TableHeadersRow();
+ foreach (Row r in _attributes) PlannerRow(r, have);
+ foreach (Row r in _vitals) PlannerRow(r, have);
+ ImGuiNET.ImGui.EndTable();
+ }
+ Label("Exact costs from the client's XP tables. Raise on the Attributes & Vitals tab.", Dim);
+ ImGuiNET.ImGui.Unindent(8);
+ }
+
+ private void PlannerRow(Row r, long have)
+ {
+ ImGuiNET.ImGui.TableNextRow();
+ ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(r.Name);
+ ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(r.Base.ToString(CultureInfo.InvariantCulture));
+ uint[]? table = r.Table;
+ int left = table == null ? 0 : Math.Max(0, table.Length - 1 - (int)Math.Min(r.Ranks, (uint)int.MaxValue));
+ ImGuiNET.ImGui.TableNextColumn();
+ if (table == null || left == 0) { Label(table == null ? "-" : "max", Dim); ImGuiNET.ImGui.TableNextColumn(); Label("-", Dim); return; }
+ long one = SkillDat.CostOf(table, r.Ranks, r.Spent, 1);
+ Label(one >= 0 ? one.ToString("N0", CultureInfo.InvariantCulture) : "-", one >= 0 && one <= have ? Teal : Dim);
+ ImGuiNET.ImGui.TableNextColumn();
+ int n = Math.Min(_planLevels, left);
+ long many = SkillDat.CostOf(table, r.Ranks, r.Spent, n);
+ string text = many >= 0 ? many.ToString("N0", CultureInfo.InvariantCulture) : "-";
+ if (n < _planLevels) text += $" ({n} to max)";
+ Label(text, many >= 0 && many <= have ? Teal : Dim);
+ }
+
+ private void DrawAugPlanner(AugPlanner a, float w)
+ {
+ Section("Augmentations", w);
+ ImGuiNET.ImGui.Indent(8);
+ try
+ {
+ if (a.Off) { Label("/aug is not available on this server.", Mute); return; }
+ if (ImGuiNET.ImGui.SmallButton("Load /aug##prog")) SendProg("augload");
+ ImGuiNET.ImGui.SameLine();
+ Label(a.Status, Dim);
+
+ string lpc = a.LumPerCoin.ToString(CultureInfo.InvariantCulture);
+ ImGuiNET.ImGui.SetNextItemWidth(160);
+ if (ImGuiNET.ImGui.InputTextWithHint("Lum per Enlightened Coin##prog_lpc", "0 = don't price coins", ref lpc, 24u))
+ SendProg("lumpercoin " + lpc.Replace(" ", "", StringComparison.Ordinal));
+
+ if (ImGuiNET.ImGui.BeginTable("##prog_augs", 5, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerV | ImGuiTableFlags.SizingStretchProp,
+ new Vector2(w - 16, 0)))
+ {
+ ImGuiNET.ImGui.TableSetupColumn("Aug");
+ ImGuiNET.ImGui.TableSetupColumn("Current", ImGuiTableColumnFlags.WidthFixed, 56);
+ ImGuiNET.ImGui.TableSetupColumn("Target", ImGuiTableColumnFlags.WidthFixed, 86);
+ ImGuiNET.ImGui.TableSetupColumn("Luminance", ImGuiTableColumnFlags.WidthFixed, 80);
+ ImGuiNET.ImGui.TableSetupColumn("Coins", ImGuiTableColumnFlags.WidthFixed, 60);
+ ImGuiNET.ImGui.TableHeadersRow();
+ foreach (AugRow row in a.Rows)
+ {
+ ImGuiNET.ImGui.TableNextRow();
+ ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(row.Label);
+ ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(row.Current.ToString(CultureInfo.InvariantCulture));
+ ImGuiNET.ImGui.TableNextColumn();
+ int tgt = row.Target;
+ ImGuiNET.ImGui.SetNextItemWidth(80);
+ if (ImGuiNET.ImGui.InputInt("##prog_tgt_" + row.Key, ref tgt, 0))
+ SendProg($"augtarget {row.Key} {Math.Clamp(tgt, 0, Math.Max(row.Cap, 0))}");
+ ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(row.Lum);
+ ImGuiNET.ImGui.TableNextColumn(); ImGuiNET.ImGui.TextUnformatted(row.Coins > 0 ? row.Coins.ToString(CultureInfo.InvariantCulture) : "-");
+ }
+ ImGuiNET.ImGui.EndTable();
+ }
+ Label(a.Total, Amber);
+ if (a.Short.Length > 0) Label(a.Short, Text);
+ Label(a.Banked, Dim);
+ }
+ finally
+ {
+ ImGuiNET.ImGui.Unindent(8);
+ }
+ }
+
+ private void DrawEnlPlanner(EnlPlanner e, float w)
+ {
+ Section("Enlightenment", w);
+ ImGuiNET.ImGui.Indent(8);
+ float wrap = ImGuiNET.ImGui.GetCursorPosX() + w - 24; // window-local x
+ ImGuiNET.ImGui.PushTextWrapPos(wrap);
+ try
+ {
+ if (e.Off) { Label("/enl is not available on this server.", Mute); return; }
+ Label(e.Header, Text);
+ Label(e.Next, Teal);
+
+ int target = e.Target;
+ ImGuiNET.ImGui.SetNextItemWidth(100);
+ if (ImGuiNET.ImGui.InputInt("Plan to level##prog_enlt", ref target))
+ SendProg("enltarget " + Math.Max(e.Level + 1, target).ToString(CultureInfo.InvariantCulture));
+ foreach (string line in e.Plan) ImGuiNET.ImGui.BulletText(line);
+
+ int coinsPerToken = e.CoinsPerToken;
+ ImGuiNET.ImGui.SetNextItemWidth(100);
+ if (ImGuiNET.ImGui.InputInt("Coins per token (shop price)##prog_cpt", ref coinsPerToken))
+ SendProg("coinspertoken " + Math.Max(0, coinsPerToken).ToString(CultureInfo.InvariantCulture));
+ if (e.TokensShort.Length > 0) Label(e.TokensShort, Dim);
+
+ ImGuiNET.ImGui.Separator();
+ if (e.Blockers.Length == 0) Label("Client-side checks pass.", Green);
+ foreach (string b in e.Blockers) Label(b, Amber);
+ Label(e.ServerChecks, Dim);
+
+ Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
+ if (Button("##prog_enl", "Enlighten now...", p, new Vector2(150, 24), Text, BtnFill, border: Teal))
+ AskProgConfirm("Enlighten",
+ "Send /enl now?\n\nEnlightening resets your level and wipes unassigned XP.\n"
+ + "The server will show its own Yes/No dialog - you must click Yes there.",
+ "Send /enl", "enlighten");
+ NextLine(p, 28);
+
+ ImGuiNET.ImGui.Separator();
+ bool auto = e.Auto;
+ if (ImGuiNET.ImGui.Checkbox("Auto-enlighten when ready##prog_auto", ref auto))
+ {
+ if (auto)
+ AskProgConfirm("Arm auto-enlighten",
+ "Auto-enlighten will send /enl whenever the checks pass (peace mode, level, materials).\n"
+ + "You still have to click Yes in the AC dialog each time.\n\nArm it for this session?",
+ "Arm", "autoenl on");
+ else
+ SendProg("autoenl off");
+ }
+ if (e.Auto && !e.Armed)
+ {
+ ImGuiNET.ImGui.SameLine();
+ if (ImGuiNET.ImGui.SmallButton("Arm for this session...##prog_arm"))
+ AskProgConfirm("Arm auto-enlighten", "Arm auto-enlighten for this session?", "Arm", "autoenl arm");
+ }
+ bool spend = e.SpendFirst;
+ if (ImGuiNET.ImGui.Checkbox("Spend unassigned XP on attributes first##prog_spend", ref spend))
+ SendProg("spendfirst " + (spend ? "on" : "off"));
+ int every = e.CheckEvery;
+ ImGuiNET.ImGui.SetNextItemWidth(100);
+ if (ImGuiNET.ImGui.InputInt("Check every (s)##prog_every", ref every))
+ SendProg("checkevery " + Math.Max(10, every).ToString(CultureInfo.InvariantCulture));
+ Label(e.Armed ? "Armed." : "Disarmed.", e.Armed ? Amber : Dim);
+ if (e.Status.Length > 0) ImGuiNET.ImGui.TextWrapped(e.Status);
+ }
+ finally
+ {
+ ImGuiNET.ImGui.PopTextWrapPos();
+ ImGuiNET.ImGui.Unindent(8);
+ }
+ }
+
+ // ── Confirm ─────────────────────────────────────────────────────────
+
+ /// The Progression tab's Yes/No popup (outside the body child, like DrawConfirm).
+ private void DrawProgressionConfirm()
+ {
+ if (_progConfirmOpenRequested)
+ {
+ _progConfirmOpenRequested = false;
+ ImGuiNET.ImGui.OpenPopup(ProgConfirmId);
+ }
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.PopupBg, ShellBg);
+ ImGuiNET.ImGui.PushStyleColor(ImGuiCol.Border, Teal);
+ ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.PopupRounding, 4f);
+ ImGuiNET.ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, new Vector2(10, 8));
+ bool open = ImGuiNET.ImGui.BeginPopup(ProgConfirmId);
+ ImGuiNET.ImGui.PopStyleVar(2);
+ ImGuiNET.ImGui.PopStyleColor(2);
+ if (!open) return;
+ try
+ {
+ ImGuiNET.ImGui.PushFont(ImGuiFonts.Get(UiFont.UiBold11));
+ Label(_progConfirmTitle, Amber);
+ ImGuiNET.ImGui.PopFont();
+ ImGuiNET.ImGui.PushTextWrapPos(ImGuiNET.ImGui.GetCursorPosX() + 320);
+ Label(_progConfirmText, Text);
+ ImGuiNET.ImGui.PopTextWrapPos();
+
+ Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos() + new Vector2(0, 4);
+ if (Button("##prog_yes", _progConfirmYes, p, new Vector2(120, 24), Text, StartBg))
+ {
+ SendProg(_progConfirmCommand);
+ ImGuiNET.ImGui.CloseCurrentPopup();
+ }
+ if (Button("##prog_no", "Cancel", new Vector2(p.X + 126, p.Y), new Vector2(90, 24), Text, BtnFill))
+ ImGuiNET.ImGui.CloseCurrentPopup();
+ NextLine(p, 28);
+ }
+ finally
+ {
+ ImGuiNET.ImGui.EndPopup();
+ }
+ }
+}
diff --git a/src/RynthCore.Engine/ImGui/Panels/SkillsFace.cs b/src/RynthCore.Engine/ImGui/Panels/SkillsFace.cs
index d4b55a0..beb9412 100644
--- a/src/RynthCore.Engine/ImGui/Panels/SkillsFace.cs
+++ b/src/RynthCore.Engine/ImGui/Panels/SkillsFace.cs
@@ -45,7 +45,7 @@ using static RynthCore.Engine.ImGuiBackend.Panels.FaceKit;
namespace RynthCore.Engine.ImGuiBackend.Panels;
-internal sealed class SkillsFace : IImGuiPanel
+internal sealed partial class SkillsFace : IImGuiPanel
{
public const string Title = "Skills";
@@ -127,7 +127,7 @@ internal sealed class SkillsFace : IImGuiPanel
}
// ── State ───────────────────────────────────────────────────────────
- private int _tab; // 0 skills, 1 attributes & vitals
+ private int _tab; // 0 skills, 1 attributes & vitals, 2 progression (ILT worlds)
private SortKey _sort = SortKey.Name;
private bool _descending;
private readonly bool[] _collapsed = { false, false, false, true };
@@ -193,18 +193,23 @@ internal sealed class SkillsFace : IImGuiPanel
SkillDat.EnsureLoadQueued();
PortalSpellTable.EnsureLoadQueued();
MasteryFeed.PanelOpened(); // asks only on Aelrynth, and only if the last reply is stale
+ ProgressionShown();
}
+ public void OnHidden() => ProgressionHidden();
+
public void Draw()
{
PlayerProgressHooks.Want();
Refresh();
+ ApplyProgressionRequest();
+ if (_tab == 2 && !ProgressionTabVisible) _tab = 0;
float w = Begin(out Vector2 origin, out Vector2 size);
DrawSummary(w);
DrawTabs(w);
if (_tab == 0) DrawToolbar(w);
- DrawColumnHeader(w, _tab == 0 ? "Skill" : "Attribute");
+ if (_tab != 2) DrawColumnHeader(w, _tab == 0 ? "Skill" : "Attribute");
float bodyH = Math.Max(60, Remaining(origin, size) - GripOverlap());
ImGuiNET.ImGui.PushStyleColor(ImGuiCol.ChildBg, PanelBg);
@@ -212,7 +217,9 @@ internal sealed class SkillsFace : IImGuiPanel
ImGuiNET.ImGui.BeginChild("##skills_body", new Vector2(w, bodyH));
float bw = ImGuiNET.ImGui.GetContentRegionAvail().X;
EnsureWidths();
- if (_snap == null || !_snap.SkillTableRead && !_snap.AttributeCacheRead)
+ if (_tab == 2)
+ DrawProgression(bw);
+ else if (_snap == null || !_snap.SkillTableRead && !_snap.AttributeCacheRead)
Message("Waiting for your character's data...", bw);
else if (_dat == null)
Message("Loading skill names from the client's portal.dat: " + SkillDat.Status, bw);
@@ -228,6 +235,7 @@ internal sealed class SkillsFace : IImGuiPanel
_picker.Draw();
DrawMulti();
DrawConfirm();
+ DrawProgressionConfirm();
}
// ── Data ────────────────────────────────────────────────────────────
@@ -691,13 +699,18 @@ internal sealed class SkillsFace : IImGuiPanel
private void DrawTabs(float w)
{
Vector2 p = ImGuiNET.ImGui.GetCursorScreenPos();
- float half = (w - 4) * 0.5f;
- if (Button("##tab_skills", "Skills", p, new Vector2(half, 22), _tab == 0 ? Teal : Text, _tab == 0 ? Selected : BtnFill,
+ // The Progression tab only exists on ILT-like worlds (RynthAi's snapshot says so).
+ int count = ProgressionTabVisible ? 3 : 2;
+ float tabW = (w - 4 * (count - 1)) / count;
+ if (Button("##tab_skills", "Skills", p, new Vector2(tabW, 22), _tab == 0 ? Teal : Text, _tab == 0 ? Selected : BtnFill,
border: _tab == 0 ? Teal : 0))
_tab = 0;
- if (Button("##tab_attrs", "Attributes & Vitals", new Vector2(p.X + half + 4, p.Y), new Vector2(half, 22),
+ if (Button("##tab_attrs", "Attributes & Vitals", new Vector2(p.X + tabW + 4, p.Y), new Vector2(tabW, 22),
_tab == 1 ? Teal : Text, _tab == 1 ? Selected : BtnFill, border: _tab == 1 ? Teal : 0))
_tab = 1;
+ if (count == 3 && Button("##tab_prog", "Progression", new Vector2(p.X + 2 * (tabW + 4), p.Y), new Vector2(tabW, 22),
+ _tab == 2 ? Teal : Text, _tab == 2 ? Selected : BtnFill, border: _tab == 2 ? Teal : 0))
+ _tab = 2;
NextLine(p, 26);
}
diff --git a/src/RynthCore.Engine/UI/Data/CharmsData.cs b/src/RynthCore.Engine/UI/Data/CharmsData.cs
new file mode 100644
index 0000000..3d3cac4
--- /dev/null
+++ b/src/RynthCore.Engine/UI/Data/CharmsData.cs
@@ -0,0 +1,78 @@
+// ============================================================================
+// RynthCore.Engine - UI/Data/CharmsData.cs
+// RynthAi's ACECustom charm tracker for the Settings panel's "Charms
+// Tracking" tab. RynthAi owns the charm registry (WCIDs, ability flags) and
+// the per-character "seen" memory; this side only shows the snapshot.
+// ============================================================================
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using RynthCore.Engine.Plugins;
+
+namespace RynthCore.Engine.UI.Data;
+
+/// RynthPluginGetCharmsJson's payload.
+internal sealed class CharmsInfo
+{
+ /// False off ILT-like worlds (or before RynthAi's ILT Hub exists).
+ [JsonPropertyName("available")] public bool Available { get; set; }
+ [JsonPropertyName("world")] public string World { get; set; } = "";
+ [JsonPropertyName("total")] public int Total { get; set; }
+ [JsonPropertyName("acquiredCount")] public int AcquiredCount { get; set; }
+ [JsonPropertyName("activeCount")] public int ActiveCount { get; set; }
+ [JsonPropertyName("charms")] public CharmRow[] Charms { get; set; } = Array.Empty();
+}
+
+internal sealed class CharmRow
+{
+ [JsonPropertyName("name")] public string Name { get; set; } = "";
+ [JsonPropertyName("effect")] public string Effect { get; set; } = "";
+ /// "carried" (in pack / equipped now), "seen" (carried before, now elsewhere) or "no".
+ [JsonPropertyName("acquired")] public string Acquired { get; set; } = "no";
+ /// Copies carried right now.
+ [JsonPropertyName("count")] public int Count { get; set; }
+ /// Best tier carried or last seen; 0 until an appraisal reports it.
+ [JsonPropertyName("tier")] public int Tier { get; set; }
+ [JsonPropertyName("maxTier")] public int MaxTier { get; set; }
+ /// Ability toggled on: "on", "off" or "unknown".
+ [JsonPropertyName("active")] public string Active { get; set; } = "unknown";
+ /// Server-side global switch as far as the client has learned it: "on", "off" or "unknown".
+ [JsonPropertyName("server")] public string Server { get; set; } = "unknown";
+ /// yyyy-MM-dd the charm was last carried (empty when never).
+ [JsonPropertyName("lastSeen")] public string LastSeen { get; set; } = "";
+}
+
+[JsonSerializable(typeof(CharmsInfo))]
+internal sealed partial class CharmsJsonContext : JsonSerializerContext { }
+
+///
+/// RynthPluginGetCharmsJson (single static buffer: one caller only) while the Settings panel
+/// is open. Every 2 s is plenty: charm state only changes when one is picked up or toggled.
+///
+internal sealed unsafe class CharmsSource : UiSource
+{
+ private delegate* unmanaged[Cdecl] _getCharmsJson;
+
+ public CharmsSource() : base("Charms", periodMs: 2000) { }
+
+ protected internal override void Poll()
+ {
+ if (_getCharmsJson == null)
+ _getCharmsJson = (delegate* unmanaged[Cdecl])PluginExportBinder.Resolve("RynthAi", "RynthPluginGetCharmsJson");
+ if (_getCharmsJson == null) return;
+ IntPtr p = _getCharmsJson();
+ string json = p == IntPtr.Zero ? "{}" : Marshal.PtrToStringAnsi(p) ?? "{}";
+ CharmsInfo info;
+ try { info = JsonSerializer.Deserialize(json, CharmsJsonContext.Default.CharmsInfo) ?? new CharmsInfo(); }
+ catch (JsonException) { info = new CharmsInfo(); }
+ Publish(info);
+ }
+
+ protected internal override void Reset()
+ {
+ _getCharmsJson = null;
+ ClearSnapshot();
+ }
+}
diff --git a/src/RynthCore.Engine/UI/Data/ChatData.cs b/src/RynthCore.Engine/UI/Data/ChatData.cs
index e34b9d2..fc452d6 100644
--- a/src/RynthCore.Engine/UI/Data/ChatData.cs
+++ b/src/RynthCore.Engine/UI/Data/ChatData.cs
@@ -158,6 +158,19 @@ internal enum ChatRuleAction
internal enum ChatColorMode { None, Line, Match }
+/// How a rule's Pattern is matched against the raw message text.
+internal enum ChatMatchMode
+{
+ /// The pattern is a regex (case-insensitive).
+ Regex,
+ /// Plain text anywhere in the message.
+ Contains,
+ /// Plain text at the start of the message.
+ StartsWith,
+ /// Plain text at the end of the message (trailing spaces ignored).
+ EndsWith,
+}
+
///
/// One rule. Its fields are edited in place by a rule editor (then
/// ChatModel.FiltersChanged); the pump reads each field once per line, and a
@@ -173,6 +186,8 @@ internal sealed class ChatFilterRule
public volatile string Tab = "";
public volatile ChatRuleAction Action = ChatRuleAction.Move;
public volatile ChatColorMode ColorMode = ChatColorMode.None;
+ /// Regex, or a plain-text mode (escaped into a regex by ).
+ public volatile ChatMatchMode Mode = ChatMatchMode.Regex;
/// A new rule's colour (amber).
public const uint DefaultColor = 0xFFFFD27A;
/// 0xAARRGGBB.
@@ -204,9 +219,16 @@ internal sealed class ChatFilterRule
Slow = false;
string pattern = Pattern;
if (pattern.Length == 0) { Compiled = null; Error = null; Invalid = true; return; }
+ string expr = Mode switch
+ {
+ ChatMatchMode.Contains => Regex.Escape(pattern),
+ ChatMatchMode.StartsWith => "^" + Regex.Escape(pattern),
+ ChatMatchMode.EndsWith => Regex.Escape(pattern.TrimEnd()) + @"\s*$",
+ _ => pattern,
+ };
try
{
- Compiled = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant,
+ Compiled = new Regex(expr, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant,
TimeSpan.FromMilliseconds(TimeoutMs));
Error = null;
Invalid = false;
@@ -493,9 +515,12 @@ internal sealed class ChatRouter
foreach (ChatFilterRule rule in _rules) Volatile.Write(ref rule.Hits, 0);
}
- /// One step of the editor's test: rule index (-1 = mention) and what it did.
+ /// One step of the editor's test: rule index (-1 = mention, -2 = a standard filter) and what it did.
public readonly record struct Step(int Rule, string What);
+ /// of a standard-filter (RynthChatPresets) step.
+ public const int StandardFilterStep = -2;
+
public ChatRoute Evaluate(ChatLine line, List? trace) =>
Evaluate(line.Text, line.Channel, line.ChatType, trace);
@@ -584,6 +609,28 @@ internal sealed class ChatRouter
trace?.Add(new Step(i, what!.ToString()));
}
+ // Standard filters (RynthChatPresets) decide only what the custom rules left undecided.
+ if (!routed)
+ {
+ var preset = RynthCore.Engine.UI.Panels.RynthChatPresets.FirstMatch(text, channel);
+ if (preset != null)
+ {
+ string presetTab = preset.Tab;
+ routed = true;
+ if (presetTab.Length == 0)
+ {
+ hidden = true;
+ trace?.Add(new Step(StandardFilterStep, $"standard filter \"{preset.Label}\" hides it"));
+ }
+ else
+ {
+ inHome = false;
+ AddTab(ref tabs, presetTab);
+ trace?.Add(new Step(StandardFilterStep, $"standard filter \"{preset.Label}\" moves it to {presetTab}"));
+ }
+ }
+ }
+
bool mention = false;
if (!hidden && _mention != null && ChatModel.MentionEligible(channel, chatType))
{
@@ -874,6 +921,8 @@ internal static class ChatModel
foreach (string t in Volatile.Read(ref _customTabs)) if (seen.Add(t)) tabs.Add(t);
foreach (ChatFilterRule rule in Filters)
if (rule.Enabled && rule.Routes && rule.Tab.Length > 0 && seen.Add(rule.Tab)) tabs.Add(rule.Tab);
+ foreach (string t in RynthCore.Engine.UI.Panels.RynthChatPresets.TargetTabs())
+ if (seen.Add(t)) tabs.Add(t);
string[] result = tabs.ToArray();
_allTabs = (version, result);
return result;
@@ -944,6 +993,9 @@ internal static class ChatModel
foreach (ChatFilterRule rule in Filters)
if (string.Equals(rule.Tab, tab, StringComparison.OrdinalIgnoreCase))
rule.Tab = newName;
+ foreach (var preset in RynthCore.Engine.UI.Panels.RynthChatPresets.All)
+ if (string.Equals(preset.Tab, tab, StringComparison.OrdinalIgnoreCase))
+ preset.Tab = newName;
if (string.Equals(ActiveChannel, tab, StringComparison.OrdinalIgnoreCase)) ActiveChannel = newName;
FiltersChanged();
return true;
@@ -960,6 +1012,9 @@ internal static class ChatModel
if (rule.Action is ChatRuleAction.Move or ChatRuleAction.Copy
&& string.Equals(rule.Tab, tab, StringComparison.OrdinalIgnoreCase))
rule.Enabled = false;
+ foreach (var preset in RynthCore.Engine.UI.Panels.RynthChatPresets.All)
+ if (string.Equals(preset.Tab, tab, StringComparison.OrdinalIgnoreCase))
+ preset.Enabled = false;
FiltersChanged();
}
@@ -1102,6 +1157,7 @@ internal static class ChatModel
// Kept while the rule is set to "No colour" too, so switching colour back on
// after a relaunch finds the colour that was picked.
Color = f.ColorMode != ChatColorMode.None || f.ColorArgb != ChatFilterRule.DefaultColor ? FormatColor(f.ColorArgb) : null,
+ Mode = f.Mode == ChatMatchMode.Regex ? null : f.Mode.ToString(),
};
///
@@ -1134,6 +1190,8 @@ internal static class ChatModel
_ => ChatColorMode.None,
},
ColorArgb = ParseColor(f.Color) ?? ChatFilterRule.DefaultColor,
+ // Absent (settings saved before match modes existed): Regex.
+ Mode = Enum.TryParse(f.Mode, ignoreCase: true, out ChatMatchMode mode) ? mode : ChatMatchMode.Regex,
};
rule.Recompile();
return rule;
@@ -1573,6 +1631,16 @@ internal static class ChatModel
&& !IsBaseTab(rule.Tab) && !tabs.Contains(rule.Tab, StringComparer.OrdinalIgnoreCase))
tabs.Add(rule.Tab);
}
+ foreach (RynthChatPresetDto p in dto.Presets ?? Array.Empty())
+ {
+ var preset = p.Id == null ? null : RynthCore.Engine.UI.Panels.RynthChatPresets.Get(p.Id);
+ if (preset == null) continue; // a preset a later build removed
+ preset.Enabled = p.Enabled;
+ preset.Tab = (p.Tab ?? "").Trim();
+ if (preset.Tab.Length > 0 && !IsBaseTab(preset.Tab)
+ && !tabs.Contains(preset.Tab, StringComparer.OrdinalIgnoreCase))
+ tabs.Add(preset.Tab);
+ }
_customTabs = tabs.ToArray();
_filters = rules.ToArray();
Interlocked.Increment(ref _filtersVersion);
@@ -1624,6 +1692,11 @@ internal static class ChatModel
MentionWords = MentionWords,
CustomTabs = Volatile.Read(ref _customTabs),
Filters = Filters.Select(ToDto).ToArray(),
+ // Only presets the user touched: new presets in later builds start off.
+ Presets = RynthCore.Engine.UI.Panels.RynthChatPresets.All
+ .Where(p => p.Enabled || p.Tab.Length > 0)
+ .Select(p => new RynthChatPresetDto { Id = p.Id, Enabled = p.Enabled, Tab = p.Tab.Length > 0 ? p.Tab : null })
+ .ToArray(),
};
UiBackgroundWriter.Enqueue("persist chat settings", () =>
{
@@ -1677,6 +1750,16 @@ internal sealed class RynthChatFilterDto
[JsonPropertyName("colorMode")] public string? ColorMode { get; set; }
/// "#RRGGBB".
[JsonPropertyName("color")] public string? Color { get; set; }
+ /// ChatMatchMode name; absent = Regex.
+ [JsonPropertyName("mode")] public string? Mode { get; set; }
+}
+
+/// A standard filter's user state (RynthChatPresets), by preset id.
+internal sealed class RynthChatPresetDto
+{
+ [JsonPropertyName("id")] public string? Id { get; set; }
+ [JsonPropertyName("enabled")] public bool Enabled { get; set; }
+ [JsonPropertyName("tab")] public string? Tab { get; set; }
}
internal sealed class RynthChatSettingsDto
@@ -1697,6 +1780,7 @@ internal sealed class RynthChatSettingsDto
[JsonPropertyName("mentionWords")] public string? MentionWords { get; set; }
[JsonPropertyName("customTabs")] public string[]? CustomTabs { get; set; }
[JsonPropertyName("filters")] public RynthChatFilterDto[]? Filters { get; set; }
+ [JsonPropertyName("presets")] public RynthChatPresetDto[]? Presets { get; set; }
}
/// Export / import on the clipboard (the rule editor's Export and Import).
diff --git a/src/RynthCore.Engine/UI/Data/NavData.cs b/src/RynthCore.Engine/UI/Data/NavData.cs
index 8fd22c8..b6f1b8d 100644
--- a/src/RynthCore.Engine/UI/Data/NavData.cs
+++ b/src/RynthCore.Engine/UI/Data/NavData.cs
@@ -39,6 +39,17 @@ internal sealed class NavPayload
public int ActiveNavIndex { get; set; }
public List NavFiles { get; set; } = new();
public List Points { get; set; } = new();
+ /// RynthAi records (and draws) the walked breadcrumb trail. Older plugins omit it (false).
+ public bool TrackBreadcrumbs { get; set; }
+ /// RynthAi draws the route overlay (rings / lines, waypoint labels, guide line).
+ public bool ShowRouteOverlay { get; set; }
+ /// Route recording is on (points are added as you walk). Older plugins omit it.
+ public bool IsRecording { get; set; }
+ /// Breadcrumb trail size, for "Trail to route" / "Backtrack".
+ public int TrailPoints { get; set; }
+ public double TrailYards { get; set; }
+ /// The last route edit's result, for a few seconds after it (empty otherwise).
+ public string EditStatus { get; set; } = string.Empty;
/// A copy a face may change (its own point list); the points themselves are shared.
public NavPayload Clone()
@@ -59,6 +70,12 @@ internal sealed class NavCmd
public int InsertAt { get; set; } = -1;
public string NavName { get; set; } = string.Empty;
public string Text { get; set; } = string.Empty; // addChat
+ public bool On { get; set; } // setBreadcrumbs / setRouteOverlay / setRecording
+ public List? Indices { get; set; } // movePoints / duplicatePoints / deletePoints
+ public int Delta { get; set; } // movePoints: -1 up, +1 down
+ public double Seconds { get; set; } // addPause
+ public double Yards { get; set; } // simplifyRoute tolerance
+ public bool Reverse { get; set; } // trailToRoute: backtrack
}
[JsonSerializable(typeof(NavPayload))]
@@ -104,6 +121,19 @@ internal static class NavCommands
public static readonly string[] RouteTypes = { "Once", "Circular", "Linear", "Follow" };
public static readonly string[] AddModes = { "End", "Above", "Below" };
+ public static readonly double[] PauseSeconds = { 1, 2, 3, 5, 10, 15, 30, 60 };
+ public static readonly string[] PauseLabels = Array.ConvertAll(PauseSeconds, s => $"Pause {s:0} s");
+
+ public static readonly double[] SimplifyYards = { 0.5, 1, 2, 3, 5 };
+ public static readonly string[] SimplifyLabels =
+ Array.ConvertAll(SimplifyYards, y => $"Drop points within {y:0.#} yd of a straight line");
+
+ public static readonly string[] TrailChoices =
+ {
+ "Replace route with the trail (walk it again)",
+ "Replace route with a backtrack (walk it back)",
+ };
+
/// Route picker index for the plugin's RouteType (1 Circular, 2 Linear, 3 Follow, else Once).
public static int RouteIndex(int routeType) => routeType switch { 1 => 1, 2 => 2, 3 => 3, _ => 0 };
diff --git a/src/RynthCore.Engine/UI/Data/ProgressionData.cs b/src/RynthCore.Engine/UI/Data/ProgressionData.cs
new file mode 100644
index 0000000..60bef5a
--- /dev/null
+++ b/src/RynthCore.Engine/UI/Data/ProgressionData.cs
@@ -0,0 +1,105 @@
+// ============================================================================
+// RynthCore.Engine - UI/Data/ProgressionData.cs
+// RynthAi's ILT progression planners (augmentations, enlightenment) for the
+// Skills panel's Progression tab. RynthAi owns the math and the persisted
+// inputs; this side only shows the snapshot and sends "prog ..." remote
+// commands (RynthAiCommands.ApplyRemoteCommand) for edits and actions.
+// ============================================================================
+
+using System;
+using System.Runtime.InteropServices;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using RynthCore.Engine.Plugins;
+
+namespace RynthCore.Engine.UI.Data;
+
+/// RynthPluginGetProgressionJson's payload. Display strings arrive preformatted.
+internal sealed class ProgressionInfo
+{
+ /// False off ILT-like worlds (or before the ILT Hub exists): the tab is hidden.
+ [JsonPropertyName("available")] public bool Available { get; set; }
+ [JsonPropertyName("world")] public string World { get; set; } = "";
+ [JsonPropertyName("aug")] public AugPlanner Aug { get; set; } = new();
+ [JsonPropertyName("enl")] public EnlPlanner Enl { get; set; } = new();
+}
+
+internal sealed class AugPlanner
+{
+ /// The server reports /aug off.
+ [JsonPropertyName("off")] public bool Off { get; set; }
+ [JsonPropertyName("status")] public string Status { get; set; } = "";
+ [JsonPropertyName("lumPerCoin")] public long LumPerCoin { get; set; }
+ [JsonPropertyName("rows")] public AugRow[] Rows { get; set; } = Array.Empty();
+ [JsonPropertyName("total")] public string Total { get; set; } = "";
+ /// Empty when the bank holds enough Enlightened Coins.
+ [JsonPropertyName("short")] public string Short { get; set; } = "";
+ [JsonPropertyName("banked")] public string Banked { get; set; } = "";
+}
+
+internal sealed class AugRow
+{
+ [JsonPropertyName("key")] public string Key { get; set; } = "";
+ [JsonPropertyName("label")] public string Label { get; set; } = "";
+ [JsonPropertyName("cur")] public int Current { get; set; }
+ [JsonPropertyName("tgt")] public int Target { get; set; }
+ /// Highest target allowed (the aug's cap, or the current level when the server reports more).
+ [JsonPropertyName("cap")] public int Cap { get; set; }
+ [JsonPropertyName("lum")] public string Lum { get; set; } = "-";
+ [JsonPropertyName("coins")] public long Coins { get; set; }
+}
+
+internal sealed class EnlPlanner
+{
+ /// The server reports /enl off.
+ [JsonPropertyName("off")] public bool Off { get; set; }
+ [JsonPropertyName("header")] public string Header { get; set; } = "";
+ [JsonPropertyName("next")] public string Next { get; set; } = "";
+ [JsonPropertyName("enl")] public int Level { get; set; }
+ [JsonPropertyName("target")] public int Target { get; set; }
+ [JsonPropertyName("plan")] public string[] Plan { get; set; } = Array.Empty();
+ [JsonPropertyName("coinsPerToken")] public int CoinsPerToken { get; set; }
+ [JsonPropertyName("tokensShort")] public string TokensShort { get; set; } = "";
+ /// Client-side requirements not yet met; empty = the client checks pass.
+ [JsonPropertyName("blockers")] public string[] Blockers { get; set; } = Array.Empty();
+ [JsonPropertyName("serverChecks")] public string ServerChecks { get; set; } = "";
+ [JsonPropertyName("auto")] public bool Auto { get; set; }
+ /// Auto-enlighten is disarmed every session until confirmed again.
+ [JsonPropertyName("armed")] public bool Armed { get; set; }
+ [JsonPropertyName("spendFirst")] public bool SpendFirst { get; set; }
+ [JsonPropertyName("checkEvery")] public int CheckEvery { get; set; }
+ [JsonPropertyName("status")] public string Status { get; set; } = "";
+}
+
+[JsonSerializable(typeof(ProgressionInfo))]
+internal sealed partial class ProgressionJsonContext : JsonSerializerContext { }
+
+///
+/// RynthPluginGetProgressionJson (single static buffer: one caller only) while the Skills
+/// panel is open, and right after each Progression edit (RequestRefreshAfterPluginTick).
+///
+internal sealed unsafe class ProgressionSource : UiSource
+{
+ private delegate* unmanaged[Cdecl] _getProgressionJson;
+
+ public ProgressionSource() : base("Progression", periodMs: 1000) { }
+
+ protected internal override void Poll()
+ {
+ if (_getProgressionJson == null)
+ _getProgressionJson = (delegate* unmanaged[Cdecl])PluginExportBinder.Resolve("RynthAi", "RynthPluginGetProgressionJson");
+ if (_getProgressionJson == null) return;
+ IntPtr p = _getProgressionJson();
+ string json = p == IntPtr.Zero ? "{}" : Marshal.PtrToStringAnsi(p) ?? "{}";
+ ProgressionInfo info;
+ try { info = JsonSerializer.Deserialize(json, ProgressionJsonContext.Default.ProgressionInfo) ?? new ProgressionInfo(); }
+ catch (JsonException) { info = new ProgressionInfo(); }
+ Publish(info);
+ }
+
+ protected internal override void Reset()
+ {
+ _getProgressionJson = null;
+ ClearSnapshot();
+ }
+}
diff --git a/src/RynthCore.Engine/UI/Data/RynthAiData.cs b/src/RynthCore.Engine/UI/Data/RynthAiData.cs
index 28d58f2..4f02cb4 100644
--- a/src/RynthCore.Engine/UI/Data/RynthAiData.cs
+++ b/src/RynthCore.Engine/UI/Data/RynthAiData.cs
@@ -265,6 +265,7 @@ internal static unsafe class RynthAiCommands
private static delegate* unmanaged[Cdecl] _adjustOpacity;
private static delegate* unmanaged[Cdecl] _togglePanelLock;
private static delegate* unmanaged[Cdecl] _sendNavCommand;
+ private static delegate* unmanaged[Cdecl] _applyRemoteCommand;
static RynthAiCommands()
{
@@ -272,6 +273,7 @@ internal static unsafe class RynthAiCommands
{
_toggleMacro = null; _setSubsystemEnabled = null; _selectProfile = null; _forceRebuff = null;
_cancelForceRebuff = null; _adjustOpacity = null; _togglePanelLock = null; _sendNavCommand = null;
+ _applyRemoteCommand = null;
};
}
@@ -341,6 +343,29 @@ internal static unsafe class RynthAiCommands
if (refreshPatrol) UiSources.Patrol.RequestRefresh();
UiSources.Nav.RequestRefresh(); // the plugin applied it: the Nav panels show it next poll
});
+
+ ///
+ /// RynthPluginApplyRemoteCommand(action, value) - the same (action, value) pairs as the
+ /// plugin's /ra chat commands ("huds","show"; "remote","toggle"; "hub","show" ...).
+ /// Older RynthAi builds without the export drop the command (logged once per bind miss).
+ ///
+ public static void ApplyRemoteCommand(string action, string value) => Run("remote command " + action, () =>
+ {
+ if (_applyRemoteCommand == null) _applyRemoteCommand = (delegate* unmanaged[Cdecl])Export("RynthPluginApplyRemoteCommand");
+ if (_applyRemoteCommand == null)
+ {
+ RynthLog.UI($"RynthAiCommands: RynthPluginApplyRemoteCommand not exported; dropped '{action} {value}'.");
+ return;
+ }
+ IntPtr a = Marshal.StringToHGlobalAnsi(action);
+ IntPtr b = Marshal.StringToHGlobalAnsi(value);
+ try { _applyRemoteCommand(a, b); }
+ finally
+ {
+ Marshal.FreeHGlobal(a);
+ Marshal.FreeHGlobal(b);
+ }
+ });
}
/// RynthPluginGetPatrolInfoJson's payload (patrol flyout).
diff --git a/src/RynthCore.Engine/UI/Data/SettingsData.cs b/src/RynthCore.Engine/UI/Data/SettingsData.cs
index b3f0ca2..a5619b8 100644
--- a/src/RynthCore.Engine/UI/Data/SettingsData.cs
+++ b/src/RynthCore.Engine/UI/Data/SettingsData.cs
@@ -11,6 +11,7 @@
// ============================================================================
using System;
+using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -202,6 +203,16 @@ internal sealed class RynthAiSettings
public int SalvageSalvageDelayMs { get; set; } = 50;
public int SalvageResultDelayFirstMs { get; set; } = 1000;
public int SalvageResultDelayFastMs { get; set; } = 250;
+ // Ground loot and item info
+ public bool EnableGroundLoot { get; set; }
+ public bool ItemInfoOnSelect { get; set; }
+ // Diagnostics (RynthAi's RynthLog: per PC in Logs\Diagnostics\diagnostics.json, not the profile)
+ public bool DiagDebugToChat { get; set; }
+ public bool DiagFileLogAll { get; set; } = true;
+ /// "Name=Level" per trace category, ','-joined; Level 0 Off, 1 Trace, 2 Info. See .
+ public string DiagCategories { get; set; } = string.Empty;
+ /// Read-only (RynthAi ignores it on save): the diagnostics folder.
+ public string DiagFolder { get; set; } = string.Empty;
/// A private copy for a face to edit (all members are values or strings).
public RynthAiSettings Clone() => (RynthAiSettings)MemberwiseClone();
@@ -272,7 +283,60 @@ internal static unsafe class SettingsCommands
// ── Schema ─────────────────────────────────────────────────────────────────
-internal enum SettingKind { Bool, Int, Float, Double, Combo, Section, Spacer, Note, CraftingStatus }
+internal enum SettingKind { Bool, Int, Float, Double, Combo, Section, Spacer, Note, CraftingStatus, Button, TraceCategories }
+
+///
+/// Reads and edits ("Name=Level,..."). The category
+/// list comes from RynthAi, so a category it adds shows up without an engine change.
+///
+internal static class TraceCategoryLevels
+{
+ public const int Off = 0, Trace = 1, Info = 2;
+
+ /// The categories in RynthAi's order; malformed entries are skipped.
+ public static List<(string Name, int Level)> Parse(string? levels)
+ {
+ var list = new List<(string, int)>();
+ if (string.IsNullOrWhiteSpace(levels)) return list;
+ foreach (string entry in levels.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
+ {
+ int eq = entry.IndexOf('=');
+ if (eq <= 0 || !int.TryParse(entry[(eq + 1)..], out int level)) continue;
+ list.Add((entry[..eq], Math.Clamp(level, Off, Info)));
+ }
+ return list;
+ }
+
+ private static string Format(List<(string Name, int Level)> list)
+ {
+ var parts = new string[list.Count];
+ for (int i = 0; i < list.Count; i++) parts[i] = list[i].Name + "=" + list[i].Level;
+ return string.Join(",", parts);
+ }
+
+ ///
+ /// Turns tracing on or off for one category (empty with a
+ /// : every category starting with it; both empty: all). On keeps
+ /// a category already at Info at Info, the same rule as /ra trace.
+ ///
+ public static string Set(string? levels, string name, bool on, string prefix = "")
+ {
+ List<(string Name, int Level)> list = Parse(levels);
+ for (int i = 0; i < list.Count; i++)
+ {
+ var (n, level) = list[i];
+ bool match = name.Length > 0
+ ? string.Equals(n, name, StringComparison.OrdinalIgnoreCase)
+ : n.StartsWith(prefix, StringComparison.OrdinalIgnoreCase);
+ if (!match) continue;
+ list[i] = (n, !on ? Off : level == Off ? Trace : level);
+ }
+ return Format(list);
+ }
+
+ /// Checkbox label: the name, plus " +log" at Info (trace lines also go to the normal log).
+ public static string Label(string name, int level) => level == Info ? name + " +log" : name;
+}
///
/// One row of a settings tab. Numeric values go through double (bools as
@@ -290,7 +354,10 @@ internal sealed record SettingRow(
double Step = 1,
string[]? Items = null,
Func? VisibleWhen = null,
- bool Gates = false)
+ bool Gates = false,
+ // Button rows: the button's caption (Label is the row label) and its action. Any thread.
+ string? ButtonText = null,
+ Action? Click = null)
{
public bool IsVisible(RynthAiSettings s) => VisibleWhen == null || VisibleWhen(s);
}
@@ -368,6 +435,9 @@ internal static class SettingsSchema
private static SettingRow Note(string text, Func? when = null) =>
new(SettingKind.Note, text, VisibleWhen: when);
+ private static SettingRow Button(string label, string buttonText, Action click, string? tip = null) =>
+ new(SettingKind.Button, label, tip, ButtonText: buttonText, Click: click);
+
private static SettingRow[] Tiers(Func[] get, Action[] set)
{
var rows = new SettingRow[get.Length];
@@ -414,6 +484,12 @@ internal static class SettingsSchema
TextSize("Status", "Status"),
TextSize("Log", "Log"),
TextSize("Tracker", "Tracker"),
+ Spacer(),
+ Section("Item Info"),
+ Bool("Describe Items When Selected", s => s.ItemInfoOnSelect, (s, v) => s.ItemInfoOnSelect = v,
+ "Print a Mag-style description of an item in chat when you select it.\nAlso: /ra iteminfo on|off."),
+ Button("Item Info Options", "Open...", () => RynthAiCommands.ApplyRemoteCommand("iteminfo", "window"),
+ "Which fields the description shows and which item types are described on select (/ra iteminfo window)."),
}),
new("UI", new[]
@@ -684,6 +760,8 @@ internal static class SettingsSchema
"Don't start on another corpse when no pack has a free slot (says so once in chat)."),
Bool("Jump When Looting", s => s.LootJumpEnabled, (s, v) => s.LootJumpEnabled = v, gates: true),
Int("Jump Height", s => s.LootJumpHeight, (s, v) => s.LootJumpHeight = v, 1, 100, 5, when: s => s.LootJumpEnabled),
+ Bool("Loot Items On Ground", s => s.EnableGroundLoot, (s, v) => s.EnableGroundLoot = v,
+ "Pick up loose items on the ground that match your loot profile, within Corpse Max range.\nCorpses always come first. Status and rescan: /ra groundloot."),
Spacer(),
Section("Corpse Ownership"),
Combo("Loot From", LootOwnershipModes, s => s.LootOwnership, (s, v) => s.LootOwnership = v),
@@ -700,6 +778,8 @@ internal static class SettingsSchema
"After the salvage queue empties, move same-name bags together so the server merges them."),
Bool("Combine Bags During Salvage", s => s.CombineBagsDuringSalvage, (s, v) => s.CombineBagsDuringSalvage = v,
"When salvaging an item, also add any under-full salvage bag of the same material to the salvage panel."),
+ Button("Floating HUDs", "Inventory HUDs...", () => RynthAiCommands.ApplyRemoteCommand("huds", "show"),
+ "Opens the item count HUD / Mini Remote setup window (/ra huds)."),
Spacer(),
Section("Loot Timers (ms)"),
Int("Inter-Item Delay", s => s.LootInterItemDelayMs, (s, v) => s.LootInterItemDelayMs = v, 0, 5000, 25),
@@ -742,5 +822,24 @@ internal static class SettingsSchema
Spacer(),
Note("Never sold: equipped, attuned, bonded, retained, tinkered, imbued, inscribed, rare, zero value, packs, or anything a Keep rule could match."),
}),
+
+ new("Diagnostics", new[]
+ {
+ Section("Logging & Debugging"),
+ Bool("Debug to chat", s => s.DiagDebugToChat, (s, v) => s.DiagDebugToChat = v,
+ "Echo trace lines and errors from the categories ticked below into the chat window.\nAlso: /ra debug on|off."),
+ Bool("Daily RynthAi log file", s => s.DiagFileLogAll, (s, v) => s.DiagFileLogAll = v,
+ "Mirror every RynthAi log line to rynthai_.txt in the log folder (kept 7 days).\nAlso: /ra logs file on|off."),
+ Button("Log Folder", "Open", () => RynthAiCommands.ApplyRemoteCommand("logs", "open"),
+ "Open RynthAi's Logs\\Diagnostics folder in Explorer (/ra logs open)."),
+ Button("Old Log Files", "Prune", () => RynthAiCommands.ApplyRemoteCommand("logs", "prune"),
+ "Delete diagnostics files past the retention limit now (/ra logs prune)."),
+ Spacer(),
+ Section("Trace Per Category"),
+ new SettingRow(SettingKind.TraceCategories, "Categories",
+ "Ticked categories write their trace lines to Trace\\_.txt (/ra trace on|off)."),
+ Note("+log = the category is at Info: its trace lines also go to the normal log. The launcher's Logging page sets Off, Trace or Info."),
+ Note("Exceptions always go to exceptions_.txt with full stack traces (throttled). Settings here are for this PC, not the profile."),
+ }),
};
}
diff --git a/src/RynthCore.Engine/UI/Data/UiSources.cs b/src/RynthCore.Engine/UI/Data/UiSources.cs
index a4cdd47..4be0072 100644
--- a/src/RynthCore.Engine/UI/Data/UiSources.cs
+++ b/src/RynthCore.Engine/UI/Data/UiSources.cs
@@ -16,6 +16,8 @@ internal static class UiSources
public static readonly TrackerSource Tracker = new();
public static readonly RynthAiSource RynthAi = new();
public static readonly PatrolSource Patrol = new();
+ public static readonly ProgressionSource Progression = new();
+ public static readonly CharmsSource Charms = new();
public static readonly RadarSource Radar = new();
public static readonly SettingsSource Settings = new();
public static readonly MetaSource Meta = new();
@@ -52,6 +54,8 @@ internal static class UiSources
UiDataHub.Register(Radar);
UiDataHub.Register(RynthAi);
UiDataHub.Register(Patrol);
+ UiDataHub.Register(Progression);
+ UiDataHub.Register(Charms);
UiDataHub.Register(PluginStatus);
UiDataHub.Register(Log);
UiDataHub.Register(Tracker);
diff --git a/src/RynthCore.Engine/UI/Panels/NavPanel.cs b/src/RynthCore.Engine/UI/Panels/NavPanel.cs
index d69153c..62d46be 100644
--- a/src/RynthCore.Engine/UI/Panels/NavPanel.cs
+++ b/src/RynthCore.Engine/UI/Panels/NavPanel.cs
@@ -171,9 +171,29 @@ internal static class NavPanel
{ e.Handled = true; picker.Close(); }
};
+ // Waypoint list controls live for the panel's lifetime. Rebuild() only refills
+ // waypointStack: a ScrollViewer recreated (or given a new Content) resets its
+ // offset to the top, which made the list jump back every poll and impossible to edit.
+ var waypointStack = new StackPanel { Spacing = 1 };
+ var waypointScroll = new ScrollViewer
+ {
+ VerticalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Auto,
+ HorizontalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled,
+ Content = waypointStack,
+ };
+ var waypointHost = new Border { Height = 200, Child = waypointScroll };
+
+ // Last plugin JSON the panel was built from. A rebuild from a user action
+ // (optimistic local edit) clears it so the next poll always resyncs with the plugin.
+ string lastJson = string.Empty;
+ bool rebuildFromPoll = false;
+
void Rebuild()
{
+ if (!rebuildFromPoll) lastJson = string.Empty;
+ Vector keepOffset = waypointScroll.Offset;
content.Children.Clear();
+ waypointStack.Children.Clear();
var d = state.Data;
bool navActive = d.MacroRunning && d.NavigationEnabled;
@@ -439,7 +459,6 @@ internal static class NavPanel
FontSize = 10,
});
- var waypointStack = new StackPanel { Spacing = 1 };
for (int i = 0; i < d.Points.Count; i++)
{
int ci = i;
@@ -516,16 +535,10 @@ internal static class NavPanel
waypointStack.Children.Add(row);
}
- content.Children.Add(new Border
- {
- Height = 200,
- Child = new ScrollViewer
- {
- VerticalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Auto,
- HorizontalScrollBarVisibility = Avalonia.Controls.Primitives.ScrollBarVisibility.Disabled,
- Content = waypointStack,
- },
- });
+ content.Children.Add(waypointHost); // same instance every rebuild — keeps scroll offset
+ // Re-apply after layout too: the re-attach / new row extent can coerce it to 0.
+ waypointScroll.Offset = keepOffset;
+ Dispatcher.UIThread.Post(() => waypointScroll.Offset = keepOffset, DispatcherPriority.Loaded);
}
// ── Poll timer ────────────────────────────────────────────────────────
@@ -536,6 +549,9 @@ internal static class NavPanel
timer.Tick += (_, _) =>
{
if (picker.ActivePicker != null || state.Typing) return;
+ // A rebuild between press and release eats the click on X / row select. seenVersion
+ // is left alone, so the change is picked up once the pointer leaves the list.
+ if (waypointHost.IsPointerOver) return;
var snap = UiSources.Nav.Current;
if (snap == null || snap.Version == seenVersion) return;
seenVersion = snap.Version;
diff --git a/src/RynthCore.Engine/UI/Panels/RynthChatFiltersPanel.cs b/src/RynthCore.Engine/UI/Panels/RynthChatFiltersPanel.cs
index 600fa95..4588fba 100644
--- a/src/RynthCore.Engine/UI/Panels/RynthChatFiltersPanel.cs
+++ b/src/RynthCore.Engine/UI/Panels/RynthChatFiltersPanel.cs
@@ -6,7 +6,10 @@
//
// Rule semantics (the rules live in ChatModel, UI/Data/ChatData.cs; the ImGui
// face is ImGui/Panels/ChatFiltersFace.cs):
-// • Regex, case-insensitive, matched against the formatted line.
+// • Regex, or plain text Contains / Starts with / Ends with (the mode
+// button), case-insensitive.
+// • Standard filters (RynthChatPresets) below the rules apply only to
+// lines no rule moved or hid.
// • FIRST matching rule wins — order matters, hence the ▲▼ buttons.
// • Tab name set → matching lines MOVE to that tab (and leave All).
// • Tab name empty → matching lines are hidden everywhere.
@@ -95,10 +98,24 @@ internal static class RynthChatFiltersPanel
ChatModel.FiltersChanged();
};
+ // Click-to-cycle (no ComboBox: the overlay's popup hosting is unreliable).
+ var modeBtn = new Button
+ {
+ Content = ModeLabels[(int)r.Mode],
+ FontSize = 10,
+ Width = 62,
+ Padding = new Thickness(4, 2),
+ Background = ButtonBg,
+ Foreground = Brushes.White,
+ BorderThickness = new Thickness(0),
+ VerticalAlignment = VerticalAlignment.Center,
+ };
+ ToolTip.SetTip(modeBtn, "How the text is matched: Regex, or plain text Contains / Starts with / Ends with.");
+
var patternBox = new TextBox
{
Text = r.Pattern,
- Watermark = "regex (e.g. AutoRun)",
+ Watermark = PatternWatermark(r.Mode),
FontSize = 10,
MinWidth = 220,
Height = 24,
@@ -118,6 +135,15 @@ internal static class RynthChatFiltersPanel
patternBox.BorderBrush = r.Invalid ? Brushes.IndianRed : FieldBorder;
ChatModel.FiltersChanged();
};
+ modeBtn.Click += (_, _) =>
+ {
+ r.Mode = (ChatMatchMode)(((int)r.Mode + 1) % ModeLabels.Length);
+ r.Recompile();
+ modeBtn.Content = ModeLabels[(int)r.Mode];
+ patternBox.Watermark = PatternWatermark(r.Mode);
+ patternBox.BorderBrush = r.Invalid ? Brushes.IndianRed : FieldBorder;
+ ChatModel.FiltersChanged();
+ };
var tabBox = new TextBox
{
@@ -180,7 +206,7 @@ internal static class RynthChatFiltersPanel
{
Orientation = Orientation.Horizontal,
Spacing = 4,
- Children = { enabledCheck, patternBox, tabBox, upBtn, downBtn, delBtn },
+ Children = { enabledCheck, modeBtn, patternBox, tabBox, upBtn, downBtn, delBtn },
});
}
@@ -194,6 +220,80 @@ internal static class RynthChatFiltersPanel
Margin = new Thickness(2, 6),
});
}
+
+ AddStandardFilters();
+ }
+
+ // Canned UB-IT-style filters (RynthChatPresets), checked after the rules above.
+ void AddStandardFilters()
+ {
+ rows.Children.Add(new TextBlock
+ {
+ Text = "Standard filters — tick to hide; type a tab to move the lines there instead.",
+ FontSize = 10,
+ FontWeight = FontWeight.Bold,
+ Foreground = Brushes.White,
+ Margin = new Thickness(2, 10, 2, 2),
+ });
+ foreach (string group in RynthChatPresets.Groups)
+ {
+ rows.Children.Add(new TextBlock
+ {
+ Text = group,
+ FontSize = 10,
+ Foreground = Brushes.LightSteelBlue,
+ Margin = new Thickness(2, 6, 2, 0),
+ });
+ foreach (var p in RynthChatPresets.All.Where(p => p.Group == group))
+ rows.Children.Add(PresetRow(p));
+ }
+ }
+
+ Control PresetRow(RynthChatPresets.Preset p)
+ {
+ var check = new CheckBox
+ {
+ IsChecked = p.Enabled,
+ Content = new TextBlock { Text = p.Label, FontSize = 10, Foreground = Brushes.White },
+ VerticalAlignment = VerticalAlignment.Center,
+ MinWidth = 220,
+ };
+ ToolTip.SetTip(check, $"{p.Description}\nExample: {p.Example}");
+ check.IsCheckedChanged += (_, _) =>
+ {
+ p.Enabled = check.IsChecked == true;
+ ChatModel.FiltersChanged();
+ };
+
+ var tabBox = new TextBox
+ {
+ Text = p.Tab,
+ Watermark = "tab (empty = hide)",
+ FontSize = 10,
+ Width = 120,
+ Height = 24,
+ Background = FieldBg,
+ Foreground = Brushes.White,
+ BorderBrush = FieldBorder,
+ BorderThickness = new Thickness(1),
+ };
+ ScrollViewer.SetHorizontalScrollBarVisibility(tabBox, ScrollBarVisibility.Disabled);
+ ScrollViewer.SetVerticalScrollBarVisibility(tabBox, ScrollBarVisibility.Disabled);
+ tabBox.GotFocus += (_, _) => Win32Backend.AvaloniaTextInputActive = true;
+ tabBox.LostFocus += (_, _) => Win32Backend.AvaloniaTextInputActive = false;
+ tabBox.TextChanged += (_, _) =>
+ {
+ p.Tab = (tabBox.Text ?? "").Trim();
+ ChatModel.FiltersChanged();
+ };
+
+ return new StackPanel
+ {
+ Orientation = Orientation.Horizontal,
+ Spacing = 4,
+ Margin = new Thickness(8, 0, 0, 0),
+ Children = { check, tabBox },
+ };
}
addBtn.Click += (_, _) =>
@@ -224,4 +324,15 @@ internal static class RynthChatFiltersPanel
RebuildRows();
return layout;
}
+
+ /// Button captions, indexed by .
+ private static readonly string[] ModeLabels = { "Regex", "Contains", "Starts", "Ends" };
+
+ private static string PatternWatermark(ChatMatchMode mode) => mode switch
+ {
+ ChatMatchMode.Contains => "text anywhere in the line",
+ ChatMatchMode.StartsWith => "line starts with...",
+ ChatMatchMode.EndsWith => "line ends with...",
+ _ => "regex (e.g. AutoRun)",
+ };
}
diff --git a/src/RynthCore.Engine/UI/Panels/RynthChatPresets.cs b/src/RynthCore.Engine/UI/Panels/RynthChatPresets.cs
new file mode 100644
index 0000000..0df795c
--- /dev/null
+++ b/src/RynthCore.Engine/UI/Panels/RynthChatPresets.cs
@@ -0,0 +1,250 @@
+// ============================================================================
+// RynthCore.Engine — UI/Panels/RynthChatPresets.cs
+// Canned ("standard") RynthChat filters, modelled on UtilityBelt-IT's
+// ChatFilter / Mag ChatFilter categories. Each preset is a tick-box in the
+// ChatFilters panel that hides its lines or moves them to a tab.
+//
+// Presets match the raw line text (no timestamp / sender prefix). Most are
+// limited to non-chat channels so a player typing the same words in Local or
+// a channel is never eaten. ChatRouter evaluates them on the plugin pump
+// (after the custom rules); editors change Enabled / Tab from any thread and
+// then call ChatModel.FiltersChanged so every kept line is routed again.
+// ============================================================================
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.RegularExpressions;
+
+namespace RynthCore.Engine.UI.Panels;
+
+internal static class RynthChatPresets
+{
+ /// Which RynthChat channels a preset may match.
+ internal enum Scope
+ {
+ /// Anything except Chat / Channels (player-typed text).
+ NotPlayerChat,
+ /// Only the Combat channel (spell incantations arrive as chat type 0x11 → Combat).
+ CombatOnly,
+ /// Only the Channels tab (General / Trade / LFG / Roleplay / Society).
+ ChannelsOnly,
+ /// Every channel.
+ Any,
+ }
+
+ internal sealed class Preset
+ {
+ internal string Id { get; }
+ internal string Group { get; }
+ internal string Label { get; }
+ internal string Description { get; }
+ internal string Example { get; }
+ internal Scope Where { get; }
+ internal Regex Pattern { get; }
+
+ // User state (persisted in rynthchat_settings.json "presets" by ChatModel).
+ // Volatile: written by an editor, read by the pump's router.
+ internal volatile bool Enabled;
+ internal volatile string Tab = ""; // "" = hide matching lines
+
+ internal Preset(string id, string group, string label, string description, string example, Scope where, string pattern)
+ {
+ Id = id;
+ Group = group;
+ Label = label;
+ Description = description;
+ Example = example;
+ Where = where;
+ Pattern = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(50));
+ }
+
+ /// True when this preset applies to a line on with raw .
+ internal bool Matches(string text, string channel)
+ {
+ bool inScope = Where switch
+ {
+ Scope.NotPlayerChat => channel is not ("Chat" or "Channels"),
+ Scope.CombatOnly => channel == "Combat",
+ Scope.ChannelsOnly => channel == "Channels",
+ _ => true,
+ };
+ if (!inScope) return false;
+ try { return Pattern.IsMatch(text); }
+ catch (RegexMatchTimeoutException) { return false; }
+ }
+ }
+
+ // Kill flavour text (retail/ACE death messages). Damage lines ("... for N points of ...")
+ // share some verbs, so they are excluded up front.
+ private const string KillPattern =
+ @"^(?!.* for \d+ points? of )(?:" +
+ @"You (?:flatten|knock|split|cleave|slay|bring|beat|run|suffocate|smite|killed) .+!" +
+ @"|.+ is (?:reduced to cinders|torn to ribbons by your assault|shattered by your assault|incinerated by your assault|liquified by your attack|dessicated by your attack)!" +
+ @"|.+ catches your attack, with dire consequences!" +
+ @"|.+'s (?:seared corpse smolders before you|last strength dissolves before you)!" +
+ @"|Electricity tears .+ apart!|Blistered by lightning, .+ falls!" +
+ @"|Your killing blow nearly turns .+ inside-out!|The thunder of crushing .+ is followed by the deafening silence of death!" +
+ @"|Your attack stops .+ cold!)";
+
+ // Optional combat prefixes such as "Critical hit! " / "Sneak Attack! ".
+ private const string HitPrefix = @"^(?:[A-Z][\w ]{2,20}! )*";
+
+ private static readonly Preset[] _all =
+ {
+ // ── Combat ────────────────────────────────────────────────────────
+ new("combat.attack_evades", "Combat", "Your attacks evaded",
+ "A monster evades your melee or missile attack.",
+ "Drudge Slinker evaded your attack.", Scope.NotPlayerChat, @" evaded your attack\.\s*$"),
+ new("combat.defense_evades", "Combat", "You evade attacks",
+ "You evade a monster's attack.",
+ "You evaded Drudge Slinker!", Scope.NotPlayerChat, @"^You evaded "),
+ new("combat.damage_dealt", "Combat", "Damage you deal",
+ "Your melee, missile and war-spell hits (including critical / sneak attack prefixes).",
+ "You slash Drudge Slinker for 54 points of slashing damage!", Scope.NotPlayerChat, HitPrefix + @"You .+ for \d+ points? of "),
+ new("combat.damage_taken", "Combat", "Damage you take",
+ "Monster hits and spell damage landing on you.",
+ "Drudge Slinker slashes you for 12 points of slashing damage!", Scope.NotPlayerChat, HitPrefix + @"(?!You ).+ you (?:with .+ )?for \d+ points? of "),
+ new("combat.attack_resists", "Combat", "Your spells resisted",
+ "A target resists one of your spells.",
+ "Drudge Slinker resists your spell", Scope.NotPlayerChat, @" resists your spell"),
+ new("combat.defense_resists", "Combat", "You resist spells",
+ "You resist a spell, or a caster was out of range / had no valid target.",
+ "You resist the spell cast by Drudge Sorcerer", Scope.NotPlayerChat,
+ @"^You resist the spell cast by |^You have no appropriate target.*spell|^You are an invalid target for the spell|tried to cast a spell on you, but was too far away!"),
+ new("combat.npk", "Combat", "Not-a-PK failures",
+ "\"You fail to affect X, you are not a player killer!\" and the mirror message.",
+ "You fail to affect Bob because you are not a player killer!", Scope.NotPlayerChat,
+ @"^You fail to affect .+ you are not a player killer!|fails to affect you.+ is not a player killer!"),
+ new("combat.dirty_fighting", "Combat", "Dirty Fighting procs",
+ "Dirty Fighting assault announcements.",
+ "Dirty Fighting! Bob delivers a Traumatic Assault to Drudge!", Scope.NotPlayerChat, @"^Dirty Fighting! .+ delivers a "),
+ new("combat.monster_deaths", "Combat", "Monster death messages",
+ "Kill flavour text (\"You flatten…\", \"…is reduced to cinders!\").",
+ "Drudge Slinker is reduced to cinders!", Scope.NotPlayerChat, KillPattern),
+
+ // ── Casting ───────────────────────────────────────────────────────
+ new("cast.mine", "Casting", "Your spell words",
+ "Your own incantations (\"You say, \\\"Zojak…\\\"\"). Real Local chat is untouched.",
+ "You say, \"Zojak Equin\"", Scope.CombatOnly, @"^You say, """),
+ new("cast.others", "Casting", "Others' spell words",
+ "Incantations from other players and monsters.",
+ "Bob says, \"Cruath Quareth\"", Scope.CombatOnly, @"^(?!You say).+ says, """),
+ new("cast.fizzle", "Casting", "Spell fizzles",
+ "\"Your spell fizzled.\"",
+ "Your spell fizzled.", Scope.NotPlayerChat, @"^Your spell fizzled\."),
+ new("cast.components", "Casting", "Component usage",
+ "\"The spell consumed the following components: …\"",
+ "The spell consumed the following components: Lead Scarab", Scope.NotPlayerChat, @"^The spell consumed the following components"),
+ new("cast.self_buffs", "Casting", "Your buff casts",
+ "\"You cast X on yourself…\" confirmations.",
+ "You cast Strength Self VII on yourself", Scope.NotPlayerChat, @"^You cast .+ on yourself"),
+ new("cast.buffs_on_you", "Casting", "Buffs others cast on you",
+ "\"Bob cast X on you…\" lines from buff bots and fellows.",
+ "Bob cast Strength Other VII on you", Scope.NotPlayerChat, @"^(?!You ).+ cast .+ on you\b"),
+ new("cast.expires", "Casting", "Spell expiry",
+ "\"… has expired.\" — rares (Brilliance / Prodigal / Spectral) are kept.",
+ "Strength Self VII has expired.", Scope.NotPlayerChat, @"^(?!.*(?:Brilliance|Prodigal|Spectral)).*\b(?:has|have) expired\."),
+
+ // ── Items & utility ───────────────────────────────────────────────
+ new("item.heal_ok", "Items", "Healing kit success",
+ "\"You heal yourself for N Health points…\"",
+ "You heal yourself for 80 Health points.", Scope.NotPlayerChat, @"^You .*heal yourself for "),
+ new("item.heal_fail", "Items", "Healing kit failure",
+ "\"You fail to heal yourself.\"",
+ "You fail to heal yourself. ", Scope.NotPlayerChat, @"^You fail to heal yourself\."),
+ new("item.salvage", "Items", "Salvage results",
+ "\"You obtain … using your knowledge of …\"",
+ "You obtain 12 Steel (ws 7.00) using your knowledge of Weapon Tinkering.", Scope.NotPlayerChat, @"^You obtain .+ using your knowledge of "),
+ new("item.salvage_fail", "Items", "Salvage failures",
+ "\"Salvaging Failed!\" and unsuitable-item notices.",
+ "Salvaging Failed!", Scope.NotPlayerChat, @"^Salvaging Failed!|The following were not suitable for salvaging: "),
+ new("item.craftsman", "Items", "Aura of the Craftsman",
+ "The +5 skill augmentation notice on every craft.",
+ "Your Aura of the Craftman augmentation increased your skill by 5!", Scope.NotPlayerChat, @"^Your Aura of the Craftman augmentation increased your skill"),
+ new("item.mana_stone", "Items", "Mana stone usage",
+ "Mana stone give / drain / destroyed lines.",
+ "The Mana Stone gives 4,500 points of mana to the following items:", Scope.NotPlayerChat,
+ @"^The Mana Stone (?:gives|drains) |^You need .+ more mana to fully charge your items\.\s*$|^The .+ is destroyed\.\s*$"),
+ new("item.regen", "Items", "Periodic healing ticks",
+ "\"You receive N points of periodic healing.\"",
+ "You receive 12 points of periodic healing.", Scope.NotPlayerChat, @"^You receive .+ points of periodic healing"),
+
+ // ── Social & trade ────────────────────────────────────────────────
+ new("social.bot_spam", "Social", "Trade / buff bot spam",
+ "Lines ending in the bot tags -t- or -b-.",
+ "BuffBot says, \"Buffs at the Holtburg lifestone -b-\"", Scope.Any, @"-[tb]-""?\s*$"),
+ new("social.failed_assess", "Social", "Failed assess on you",
+ "\"Someone tried and failed to assess you!\"",
+ "Bob tried and failed to assess you!", Scope.NotPlayerChat, @"tried and failed to assess you!\s*$"),
+ new("social.kill_task", "Social", "Kill task complete",
+ "\"You have killed N Xs! Your task is complete!\"",
+ "You have killed 50 Drudges! Your task is complete!", Scope.NotPlayerChat, @"^You have killed \d+ .+Your task is complete!\s*$"),
+ new("social.general", "Social", "General channel",
+ "Everything said on General.",
+ "[General] Bob says, \"hi\"", Scope.ChannelsOnly, @"^\[General\]|says on the General channel"),
+ new("social.trade", "Social", "Trade channel",
+ "Everything said on Trade.",
+ "[Trade] Bob says, \"WTS\"", Scope.ChannelsOnly, @"^\[Trade\]|says on the Trade channel"),
+ new("social.lfg", "Social", "LFG channel",
+ "Everything said on LFG.",
+ "[LFG] Bob says, \"LF fellow\"", Scope.ChannelsOnly, @"^\[LFG\]|says on the LFG channel"),
+ new("social.roleplay", "Social", "Roleplay channel",
+ "Everything said on Roleplay.",
+ "[Roleplay] Bob says, \"…\"", Scope.ChannelsOnly, @"^\[Roleplay\]|says on the Roleplay channel"),
+ new("social.society", "Social", "Society channel",
+ "Everything said on your society channel.",
+ "[Society] Bob says, \"…\"", Scope.ChannelsOnly, @"^\[(?:Society|Celestial Hand|Eldrytch Web|Radiant Blood)\]|says on the (?:Society|Celestial Hand|Eldrytch Web|Radiant Blood) channel"),
+
+ // ── NPCs ──────────────────────────────────────────────────────────
+ new("npc.arbitrator", "NPCs", "Master Arbitrator (Colosseum)",
+ "All Master Arbitrator speech and the fellowship-lock notice.",
+ "Master Arbitrator tells you, \"You shall be known…\"", Scope.Any,
+ @"^Master Arbitrator (?:says|tells you)|^Your fellowship is now locked\..*you have 15 minutes to be recruited"),
+
+ // ── Pets (ACE custom combat pets) ─────────────────────────────────
+ new("pet.hit", "Pets", "Pet hits",
+ "\"[Pet] … hit …\" outgoing damage.",
+ "[Pet] Fire Banshee hit Drudge for 40 damage.", Scope.NotPlayerChat, @"^\[Pet\] .+ hit "),
+ new("pet.evade", "Pets", "Pet attacks evaded",
+ "\"[Pet] … evaded by …\"",
+ "[Pet] Fire Banshee's attack was evaded by Drudge.", Scope.NotPlayerChat, @"^\[Pet\] .+ evaded by "),
+ new("pet.damage_taken", "Pets", "Pet damage taken",
+ "\"[Pet] … took …\" incoming damage.",
+ "[Pet] Fire Banshee took 25 damage from Drudge.", Scope.NotPlayerChat, @"^\[Pet\] .+ took "),
+ new("pet.death", "Pets", "Pet died",
+ "\"[Pet] Your combat pet … has died.\"",
+ "[Pet] Your combat pet Fire Banshee has died.", Scope.NotPlayerChat, @"^\[Pet\] Your combat pet .+ has died\.\s*$"),
+ new("pet.recall_block", "Pets", "Pet recall blocked",
+ "\"Your pet was in combat recently; you cannot recall it…\"",
+ "Your pet was in combat recently; you cannot recall it for about 10 seconds.", Scope.NotPlayerChat,
+ @"^Your pet was in combat recently; you cannot recall it"),
+ new("pet.overflow", "Pets", "Pet heal overflow",
+ "\"… receives N excess … from …\" boost overflow.",
+ "Fire Banshee receives 20 excess health from Heal Other.", Scope.NotPlayerChat, @" receives .+ excess .+ from "),
+ };
+
+ private static readonly Dictionary _byId =
+ _all.ToDictionary(p => p.Id, StringComparer.OrdinalIgnoreCase);
+
+ /// Every preset in display order.
+ internal static IReadOnlyList All => _all;
+
+ /// Group names in display order.
+ internal static IEnumerable Groups => _all.Select(p => p.Group).Distinct();
+
+ internal static Preset? Get(string id) => _byId.TryGetValue(id, out var p) ? p : null;
+
+ /// First enabled preset that matches the line, or null.
+ internal static Preset? FirstMatch(string text, string channel)
+ {
+ foreach (var p in _all)
+ if (p.Enabled && p.Matches(text, channel))
+ return p;
+ return null;
+ }
+
+ /// Tabs named by enabled presets (tab names create tabs implicitly, like custom rules).
+ internal static IEnumerable TargetTabs()
+ => _all.Where(p => p.Enabled && p.Tab.Length > 0).Select(p => p.Tab);
+}
diff --git a/src/RynthCore.Engine/UI/Panels/SettingsPanel.cs b/src/RynthCore.Engine/UI/Panels/SettingsPanel.cs
index 914160a..714c966 100644
--- a/src/RynthCore.Engine/UI/Panels/SettingsPanel.cs
+++ b/src/RynthCore.Engine/UI/Panels/SettingsPanel.cs
@@ -333,6 +333,10 @@ internal static class SettingsPanel
return SectionHeader(row.Label);
case SettingKind.Spacer:
return Spacer();
+ case SettingKind.Button:
+ return ButtonRow(row.Label, row.ButtonText ?? row.Label, () => row.Click?.Invoke(), row.Tooltip);
+ case SettingKind.TraceCategories:
+ return TraceCategoriesRow(state, row);
case SettingKind.Note:
return new TextBlock
{
@@ -699,6 +703,96 @@ internal static class SettingsPanel
return row;
}
+ /// Label on the left, a single action button on the right.
+ private static Control ButtonRow(string label, string buttonText, Action onClick, string? tooltip = null)
+ {
+ var btn = new Button
+ {
+ Content = buttonText,
+ FontSize = 10,
+ Height = 20,
+ MinWidth = 160,
+ Padding = new Thickness(4, 1),
+ Background = ColBtnFill,
+ Foreground = ColTextDim,
+ BorderBrush = ColBtnBord,
+ BorderThickness = new Thickness(1),
+ HorizontalContentAlignment = HorizontalAlignment.Center,
+ };
+ btn.Click += (_, _) => onClick();
+
+ var row = new Grid
+ {
+ ColumnDefinitions = new ColumnDefinitions("*,Auto"),
+ Margin = new Thickness(0, 2, 0, 2),
+ Height = 22,
+ };
+ var lblBlock = new TextBlock { Text = label, Foreground = ColTextDim, FontSize = 11, VerticalAlignment = VerticalAlignment.Center };
+ Grid.SetColumn(lblBlock, 0);
+ Grid.SetColumn(btn, 1);
+ row.Children.Add(lblBlock);
+ row.Children.Add(btn);
+
+ if (tooltip != null)
+ {
+ ToolTip.SetTip(row, tooltip);
+ ToolTip.SetShowDelay(row, 400);
+ }
+ return row;
+ }
+
+ ///
+ /// [All on] [All off] [ILT Hub on] over a 3-column grid of toggles, one per RynthAi trace
+ /// category. Each change edits DiagCategories, saves, and rebuilds the tab so the grid redraws.
+ ///
+ private static Control TraceCategoriesRow(PanelState state, SettingRow row)
+ {
+ var cats = TraceCategoryLevels.Parse(state.Data.DiagCategories);
+ if (cats.Count == 0)
+ return new TextBlock { Text = "Waiting for RynthAi...", Foreground = ColMute, FontSize = 10, Margin = new Thickness(0, 2, 0, 0) };
+
+ void Save(string levels)
+ {
+ state.Data.DiagCategories = levels;
+ Push(state);
+ state.Rebuild?.Invoke();
+ }
+
+ Button Bulk(string text, Func next)
+ {
+ var b = new Button
+ {
+ Content = text, FontSize = 10, Height = 20, Padding = new Thickness(6, 1),
+ Background = ColBtnFill, Foreground = ColTextDim, BorderBrush = ColBtnBord, BorderThickness = new Thickness(1),
+ };
+ b.Click += (_, _) => Save(next());
+ return b;
+ }
+
+ var box = new StackPanel { Margin = new Thickness(0, 2, 0, 2) };
+ var buttons = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 6, Margin = new Thickness(0, 0, 0, 4) };
+ buttons.Children.Add(Bulk("All on", () => TraceCategoryLevels.Set(state.Data.DiagCategories, "", true)));
+ buttons.Children.Add(Bulk("All off", () => TraceCategoryLevels.Set(state.Data.DiagCategories, "", false)));
+ buttons.Children.Add(Bulk("ILT Hub on", () => TraceCategoryLevels.Set(state.Data.DiagCategories, "", true, "Ilt")));
+ if (row.Tooltip != null)
+ {
+ ToolTip.SetTip(buttons, row.Tooltip);
+ ToolTip.SetShowDelay(buttons, 400);
+ }
+ box.Children.Add(buttons);
+
+ var grid = new Avalonia.Controls.Primitives.UniformGrid { Columns = 3 };
+ foreach (var (name, level) in cats)
+ {
+ string catName = name;
+ bool on = level != TraceCategoryLevels.Off;
+ grid.Children.Add(BoolRow(TraceCategoryLevels.Label(name, level), on,
+ v => Save(TraceCategoryLevels.Set(state.Data.DiagCategories, catName, v))));
+ }
+ box.Children.Add(grid);
+ return box;
+ }
+
// SimpleTheme wraps TextBox content in a ScrollViewer, and its vertical
// scrollbar's up RepeatButton is a filled triangle Path. On these short
// (Height=20) single-line numeric fields that scrollbar shows and the