feat(nav): Breadcrumbs and Route overlay toggles on the Nav panel

NavFace gains a toggle row bound to RynthAi's TrackBreadcrumbs and route overlay
settings via the nav bridge (setBreadcrumbs / setRouteOverlay).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
BlankenshipG 2026-10-05 11:35:09 -04:00
commit 5ecadc7bba
3 changed files with 73 additions and 1 deletions

View file

@ -1,7 +1,8 @@
// ============================================================================
// 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) /
// Start/Stop, route type and insert mode, the Breadcrumbs and Route overlay
// toggles, 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
@ -130,6 +131,24 @@ 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
@ -239,6 +258,18 @@ internal sealed class NavFace : IImGuiPanel
_picker.Draw();
}
/// <summary>
/// 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).
/// </summary>
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;
}
/// <summary>
/// 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

View file

@ -39,6 +39,10 @@ internal sealed class NavPayload
public int ActiveNavIndex { get; set; }
public List<string> NavFiles { get; set; } = new();
public List<NavPoint> Points { get; set; } = new();
/// <summary>RynthAi records (and draws) the walked breadcrumb trail. Older plugins omit it (false).</summary>
public bool TrackBreadcrumbs { get; set; }
/// <summary>RynthAi draws the route overlay (rings / lines, waypoint labels, guide line).</summary>
public bool ShowRouteOverlay { get; set; }
/// <summary>A copy a face may change (its own point list); the points themselves are shared.</summary>
public NavPayload Clone()
@ -59,6 +63,7 @@ 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
}
[JsonSerializable(typeof(NavPayload))]