feat: SK backlog from test through 2026.11.22.48 (Trade Shop, Oracle, quests, loot, nav)

Squash of test/main-merge-2026-10-25 onto aelrynth main 2026.11.19.1 for the standing sk PR. Includes Trade Shop, Oracle wiki/ILT tracker, quest runs, loot checklist, RynthNav, VTank import. HandWrittenVersion remains 0.5.0-legacy-ui. See Changelog/2026-11-22-sk-backlog-test-merge.md.
This commit is contained in:
BlankenshipG 2026-11-23 00:08:38 -05:00
commit dc08e1abba
521 changed files with 47247 additions and 795 deletions

View file

@ -8,6 +8,9 @@ namespace RynthCore.Plugin.RynthOracle.Views;
/// <summary>About: the credit to Oracle of Dereth's author, the settings and the quest list's source.</summary>
internal sealed partial class OracleView
{
// The labels for OracleSettings.QuestRefreshChoices, in the same order.
private static readonly string[] QuestRefreshLabels = { "Off (login and Refresh only)", "5 minutes", "10 minutes", "15 minutes", "30 minutes" };
private void DrawAbout(UiWindow w)
{
w.TextColored(UiColors.Gold, "Based on Oracle of Dereth by Advis Eveldan - thank you!");
@ -21,6 +24,11 @@ internal sealed partial class OracleView
w.Tooltip("Sends /myquests after login so the quest pages have data, and again while quest timers are on screen "
+ "and the flags are over 10 minutes old, or when the server turns a quest down as solved too recently "
+ "(only with the replies hidden).");
int refreshIndex = Math.Max(0, Array.IndexOf(OracleSettings.QuestRefreshChoices, s.QuestRefreshMinutes));
w.Combo("Read quest flags again when older than", "o.refresh", refreshIndex, QuestRefreshLabels,
i => { s.QuestRefreshMinutes = OracleSettings.QuestRefreshChoices[i]; s.Save(); });
w.Tooltip("Keeps the quest pages current on a long session: /myquests again (its reply hidden) once nothing\n"
+ "has read it for this long. Any reply resets the clock, RynthAi's meta polls too. The server allows one a minute.");
w.Checkbox("Hide the replies to RynthOracle's own requests", "o.hide", s.HideOwnQuestReplies, v => { s.HideOwnQuestReplies = v; s.Save(); });
w.Tooltip("/myquests. A command you type yourself always shows its reply.");
w.Checkbox("Show the Void window for characters with Void Magic", "o.void", s.AutoShowVoidWindow, v => { s.AutoShowVoidWindow = v; s.Save(); });

View file

@ -0,0 +1,269 @@
using System;
using System.Collections.Generic;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
/// <summary>
/// Dynamic Stamps (Infinite Leaftide only, ServerIdentity.IsIlt): the NPC hand-ins that put a "Dynamic_N_..." flag on
/// the character, read from /myquests. Since 2026-10-18 they are rows of the Quests tab's merged
/// list (QuestsTab.cs: DYN rows, the Show filter's area picker). What is left here is the opened
/// stamp's box (RynthNav, the Parchment hand-in, chat), and the read after a hand-in. The list follows the players' "ExtraDyn" sheet (dynstamps.csv).
/// Since 2026-11-08 (Silentkelpie: "for the dynamic quests, it should also auto hand in the parchment and if one does
/// not have any it should buy one from a vendor") Go hands the Parchment in on arrival by itself, and with none in
/// the packs RynthAi buys one from a vendor near you first ("questloot buy Parchment": before setting off, and
/// again at the NPC's place when that failed).
/// </summary>
internal sealed partial class OracleView
{
// The stamp clicked last: the box below the list offers RynthNav's auto nav to it.
private DynamicStamp? _dynNav;
private bool _dynNavDone;
private string _dynNavStatus = "";
/// <summary>
/// The destination box (the click's pop-up): the stamp, where RynthNav will take you, and Go (plan
/// and walk the route: portals, recalls and dungeon entrances included), Arrow, Chat and Close.
/// </summary>
private void DrawDynamicNavBox(UiWindow w)
{
DynamicStamp? s = _dynNav;
if (s == null) return;
List<string> targets = s.NavCandidates();
w.SeparatorText("Navigate to " + Cut(s.Label, 40));
w.TextDisabled(targets.Count == 0
? "No place, coordinates or area to go to for this stamp."
: "Where: " + Cut(string.Join(" or ", targets), 90));
if (targets.Count > 0)
{
w.Button(s.Npc.Length > 0 ? "Go and hand in" : "Go (auto nav)", "dy.nav.go", () => StartDynAuto(s));
w.Tooltip(s.Npc.Length > 0
? "RynthNav plans the route (walking, portals, recalls, the dungeon's entrance) and walks it; there, a Parchment\n"
+ "from your packs is handed to " + s.Npc + ". With none, RynthAi buys one from a vendor near you first\n"
+ "(a Scribe or a shop within 80 m), or at the NPC's place."
: "RynthNav plans the route (walking, portals, recalls, the dungeon's entrance) and walks it.");
w.SameLine();
w.Button("Arrow", "dy.nav.arrow", () => SendNav("arrow", s));
w.Tooltip("Only point RynthNav's arrow at it.");
w.SameLine();
}
w.Button("Chat", "dy.nav.chat", () => PrintStamp(s, _dynNavDone));
w.SameLine();
w.Button("Close", "dy.nav.close", () => { _dynNav = null; _dynNavStatus = ""; _selKey = ""; });
// The hand-in: a Parchment from your packs to the stamp's NPC (RynthAi's /ub give).
if (s.Npc.Length > 0)
{
string? parchment = CarriedParchment();
if (parchment != null)
{
w.Button("Give " + Cut(parchment, 24), "dy.nav.give", () => GiveParchment(s, parchment));
w.Tooltip($"Hands one {parchment} to {s.Npc}. Stand near them (or Go first): AC walks you the last bit.");
}
else
{
w.TextDisabled("No Parchment in your packs to give " + Cut(s.Npc, 30) + ".");
w.SameLine();
w.SmallButton("Buy one", "dy.nav.buy", () =>
_dynNavStatus = _c.SendAi("questloot", "buy Parchment")
? "RynthAi is looking for a Parchment at the vendors near you." : "RynthAi isn't loaded (it buys the Parchment).");
w.Tooltip("RynthAi opens the vendors near you (a Scribe or a shop first, within 80 m) until one sells a Parchment, and buys one.");
}
}
if (_dynNavStatus.Length > 0) w.TextDisabled(_dynNavStatus);
}
// ── Go and hand in (2026-11-08) ──
private enum DynPhase { None, BuyFirst, Going, BuyThere, Settling }
// After RynthNav's "goto: arrived" the hand-in waits this long, so the character has stopped: a give
// sent while still running is cancelled by the server's own move-to ("Action cancelled!").
private const long ArriveSettleMs = 1500;
private long _dynGiveAt;
private DynamicStamp? _dynAuto;
private DynPhase _dynPhase;
internal const string BoughtLine = "[RynthAi] Quest: bought Parchment";
internal const string BuyFailLine = "[RynthAi] Quest: couldn't buy Parchment";
/// <summary>Go: the Parchment first when none is carried (bought near you), then RynthNav; the hand-in on arrival.</summary>
private void StartDynAuto(DynamicStamp s)
{
_dynAuto = s;
_dynPhase = DynPhase.None;
if (!_c.InWorld) { _dynNavStatus = "Log in first."; return; }
if (s.Npc.Length == 0) { SendNav("go", s); return; }
_parchmentScanAt = 0;
if (CarriedParchment() == null && _c.SendAi("questloot", "buy Parchment"))
{
_dynPhase = DynPhase.BuyFirst;
_dynNavStatus = $"No Parchment: RynthAi is buying one near you first, then RynthNav goes to {s.Npc}.";
return;
}
GoDyn(s, "");
}
private void GoDyn(DynamicStamp s, string before)
{
SendNav("go", s);
_dynPhase = _dynNavStatus.StartsWith("RynthNav is planning", StringComparison.Ordinal) ? DynPhase.Going : DynPhase.None;
if (_dynPhase == DynPhase.Going) _dynNavStatus = before + $"RynthNav is walking to {s.Npc}; the Parchment is handed in when it gets there.";
}
/// <summary>A chat line while Go and hand in runs: RynthAi's buy, RynthNav's arrival. Plugin calls it for every line.</summary>
internal void OnDynChat(string line)
{
DynamicStamp? s = _dynAuto;
if (s == null || _dynPhase == DynPhase.None) return;
bool bought = line.Contains(BoughtLine, StringComparison.OrdinalIgnoreCase);
bool noBuy = line.Contains(BuyFailLine, StringComparison.OrdinalIgnoreCase);
switch (_dynPhase)
{
case DynPhase.BuyFirst:
if (bought) GoDyn(s, "Bought a Parchment. ");
else if (noBuy) GoDyn(s, "No Parchment to buy here (tried again there). ");
break;
case DynPhase.Going:
if (!line.Contains("[RynthNav]", StringComparison.Ordinal)) break;
if (line.Contains("goto: arrived", StringComparison.OrdinalIgnoreCase)) DynArrived(s);
else if (line.Contains("goto:", StringComparison.OrdinalIgnoreCase) || line.Contains("on the map", StringComparison.OrdinalIgnoreCase))
{
_dynPhase = DynPhase.None;
_dynNavStatus = "RynthNav didn't get there (" + Cut(line.Trim(), 80) + "): Go again, or Give by hand.";
}
break;
case DynPhase.BuyThere:
if (bought)
{
_parchmentScanAt = 0;
_dynPhase = DynPhase.None;
if (CarriedParchment() is string p) GiveParchment(s, p);
else _dynNavStatus = "Bought a Parchment, but it isn't in your packs yet: Give it by hand.";
}
else if (noBuy)
{
_dynPhase = DynPhase.None;
_dynNavStatus = $"No Parchment, and no vendor near {s.Npc} sells one: buy one in a town (a Scribe), then Go again.";
}
break;
}
}
private void DynArrived(DynamicStamp s)
{
_dynPhase = DynPhase.Settling;
_dynGiveAt = _c.NowMs + ArriveSettleMs;
_dynNavStatus = $"At {s.Npc}: handing in the Parchment in a moment.";
}
/// <summary>Plugin tick: the hand-in once the character has settled after arriving.</summary>
internal void TickDyn()
{
if (_dynPhase != DynPhase.Settling || _dynAuto is not DynamicStamp s) return;
if (_c.NowMs < _dynGiveAt) return;
HandInNow(s);
}
private void HandInNow(DynamicStamp s)
{
_parchmentScanAt = 0;
if (CarriedParchment() is string p) { _dynPhase = DynPhase.None; GiveParchment(s, p); return; }
if (_c.SendAi("questloot", "buy Parchment"))
{
_dynPhase = DynPhase.BuyThere;
_dynNavStatus = $"At {s.Npc}, no Parchment: RynthAi is buying one from a vendor here.";
return;
}
_dynPhase = DynPhase.None;
_dynNavStatus = $"At {s.Npc}, but no Parchment in your packs.";
}
// A /myquests read this long after a Parchment hand-in (the walk there and the NPC's answer), so
// the new stamp shows as had; 0 = none due.
private const long HandInRefreshMs = 8000;
private long _dynRefreshAt;
/// <summary>The read after a hand-in, when it is due: now, or when the server's once-a-minute wait ends.</summary>
private void RefreshAfterHandIn(QuestFlagStore flags)
{
if (_dynRefreshAt == 0 || _c.NowMs < _dynRefreshAt) return;
if (flags.Loading) return;
int wait = flags.ThrottleSecondsLeft(_c.NowMs);
if (wait > 0) { _dynRefreshAt = _c.NowMs + wait * 1000L; return; }
_dynRefreshAt = 0;
_c.RequestQuests();
}
// Packs scanned for a Parchment at most this often (the box draws every frame).
private const long ParchmentScanMs = 1500;
private long _parchmentScanAt;
private string? _parchmentName;
/// <summary>
/// The name of a Parchment you carry (the main pack and its side packs), or null. Any item
/// whose name has "Parchment" in it; read again every <see cref="ParchmentScanMs"/>.
/// </summary>
private string? CarriedParchment()
{
if (_c.NowMs - _parchmentScanAt < ParchmentScanMs && _parchmentScanAt != 0) return _parchmentName;
_parchmentScanAt = _c.NowMs == 0 ? 1 : _c.NowMs;
_parchmentName = null;
RynthCore.PluginSdk.RynthCoreHost host = _c.Host;
uint me = _c.Character.PlayerId;
if (!_c.InWorld || me == 0 || !host.HasGetContainerContents) return null;
var buf = new uint[512];
var packs = new List<uint> { me };
for (int p = 0; p < packs.Count && p < 16; p++)
{
int n = Math.Min(host.GetContainerContents(packs[p], buf), buf.Length);
for (int i = 0; i < n; i++)
{
uint id = buf[i];
if (!host.TryGetObjectName(id, out string name)) continue;
if (name.IndexOf("Parchment", StringComparison.OrdinalIgnoreCase) >= 0) { _parchmentName = name; return name; }
// A side pack in the main pack: look inside it too (only one level deep, as AC packs go).
if (p == 0) packs.Add(id);
}
}
return null;
}
/// <summary>"/ub give 1 &lt;parchment&gt; to &lt;npc&gt;": RynthAi finds the NPC by name and hands it over.</summary>
private void GiveParchment(DynamicStamp s, string parchment)
{
if (!_c.InWorld) { _dynNavStatus = "Log in first."; return; }
bool sent = _c.RunCommand($"/ub give 1 {parchment} to {s.Npc}");
_parchmentScanAt = 0; // read the packs again after the give
// The stamp is a quest flag: read /myquests again once the NPC has had time to answer.
if (sent) _dynRefreshAt = _c.NowMs + HandInRefreshMs;
_dynNavStatus = sent
? $"Giving {parchment} to {s.Npc} (RynthAi does the give; it says so in chat if {s.Npc} isn't in sight)."
: "Could not send the give.";
}
/// <summary>Clicking a row: select it and ask RynthNav for the route (shown in chat and its overlay).</summary>
private void SelectDynamicStamp(DynamicStamp s, bool done)
{
_dynNav = s;
_dynNavDone = done;
_dynNavStatus = "";
if (s.NavCandidates().Count > 0) SendNav("route", s);
}
/// <summary>"/rnav &lt;verb&gt; a || b || c" to RynthNav (it takes the first candidate on its map).</summary>
private void SendNav(string verb, DynamicStamp s)
{
List<string> targets = s.NavCandidates();
if (targets.Count == 0) return;
_dynNavStatus = SendRynthNav(verb, targets);
}
/// <summary>Chat: the NPC, its stamp and whether this character has it, where, the reward and
/// any coordinates (RynthChat makes those a RynthNav arrow link).</summary>
private void PrintStamp(DynamicStamp s, bool done)
{
string where = s.Place.Length > 0 ? $"{s.Area}, {s.Place}" : s.Area;
string details = $"{where}" + (s.Reward.Length > 0 ? $" - gives {s.Reward}" : "") + (s.Note.Length > 0 ? $" - {s.Note}" : "");
PrintEntry(s.Label, s.Stamp, done ? "have" : "missing", details, "");
}
}

View file

@ -0,0 +1,438 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
/// <summary>
/// Gear: how the worn gear's spells fit together, for any server. Two views, as UB-ILT's
/// Character tab had them:
/// - Overlap: life wards and banes by element and tier, every spell on each worn piece (and the
/// set bonuses, paragon spells and the character's buffs), and the families where spells
/// compete (the highest power wins), repeat (the same spell on two pieces) or stack.
/// - Ratings: items with a set, an item level or gear ratings (UB-ILT's Paragon gear), with the
/// ratings summed over what is worn.
/// The Check button reads it all again (GearScanner); nothing is read until it is pressed.
/// </summary>
internal sealed partial class OracleView
{
public const string GearOverlap = "Overlap", GearRatings = "Ratings";
// Tier colours (UB-ILT's): Minor green, Major blue, Epic purple, Legendary orange; missing red.
private static readonly uint TierMinor = UiFormat.Rgb(120, 220, 120), TierMajor = UiFormat.Rgb(140, 180, 255),
TierEpic = UiFormat.Rgb(200, 140, 255), TierLegendary = UiFormat.Rgb(255, 180, 100), TierLower = UiFormat.Rgb(190, 190, 190);
private static readonly uint HeaderBlue = UiFormat.Rgb(180, 200, 255), SetPurple = UiFormat.Rgb(200, 180, 255),
ParagonTan = UiFormat.Rgb(220, 200, 140), WornGreen = UiFormat.Rgb(200, 235, 180), PackGrey = UiFormat.Rgb(210, 210, 210),
T11Teal = UiFormat.Rgb(120, 220, 210);
private string GearView
{
get => _c.Settings.GearView == GearRatings ? GearRatings : GearOverlap;
set { _c.Settings.GearView = value; _c.Settings.Save(); }
}
private void DrawGear(UiWindow w)
{
string view = GearView;
w.ToggleButton(GearOverlap, "g.v.o", view == GearOverlap, () => GearView = GearOverlap, small: true);
w.Tooltip("Spell overlap and stacking on your worn gear, life wards and banes.");
w.SameLine();
w.ToggleButton(GearRatings, "g.v.r", view == GearRatings, () => GearView = GearRatings, small: true);
w.Tooltip("Sets, item levels and gear ratings (paragon gear where the server has it).");
w.SameLine();
w.PushStyleColor(21, UiFormat.Rgb(150, 30, 30)); // ImGuiCol_Button: UB-ILT's red Check
w.Button(view == GearOverlap ? "Check spell overlap" : "Check gear ratings", "g.check", StartGearCheck, small: true);
w.PopStyleColor();
w.Tooltip("Reads your worn gear again: asks the server to appraise items it hasn't yet, then rebuilds the lists.");
DrawGearProgress(w);
w.Separator();
if (view == GearRatings) DrawGearRatings(w);
else DrawGearOverlap(w);
}
/// <summary>Starts a Check (the button, the Refresh row and a change of the pack option).</summary>
private void StartGearCheck()
{
if (_c.Gear.Busy) return;
if (!_c.Gear.Start(_c.Host, _c.NowMs, _c.Settings.GearIncludePack, msg => _c.Host.Log(msg)) && _c.Gear.Problem.Length > 0)
_c.Print("Gear: " + _c.Gear.Problem);
}
private RefreshResult RefreshGear()
{
if (_c.Gear.Busy) return new RefreshResult("A gear check is already running.", () => !_c.Gear.Busy);
StartGearCheck();
return _c.Gear.Problem.Length > 0
? new RefreshResult(_c.Gear.Problem)
: new RefreshResult("Checking your gear.", () => !_c.Gear.Busy);
}
private void DrawGearProgress(UiWindow w)
{
GearScanner g = _c.Gear;
switch (g.State)
{
case GearScanner.Phase.Identifying:
w.TextColored(UiColors.Yellow, $"Appraising items: {g.IdsSent} of {g.IdsQueued} asked...");
break;
case GearScanner.Phase.Settling:
w.TextColored(UiColors.Yellow, "Waiting for the appraisals...");
break;
case GearScanner.Phase.WaitingForSpells:
w.TextColored(UiColors.Yellow, "Reading the client's spell table...");
break;
default:
if (g.Problem.Length > 0) w.TextColored(UiColors.Red, g.Problem);
break;
}
}
// ── Overlap ──────────────────────────────────────────────────────────────
private void DrawGearOverlap(UiWindow w)
{
GearReport? r = _c.Gear.Overlap;
w.TextDisabled("Worn and wielded gear and your buffs: wards, banes, set bonuses and the spells that compete.");
if (r == null)
{
w.TextDisabled("Press Check to scan your worn gear and active buffs.");
return;
}
w.Text($"Checked {r.CheckedLocal:HH:mm:ss} | {r.Equipped} worn | {r.SpellSources} spells | "
+ $"{r.Count(OverlapKind.Overlap)} overlap / {r.Count(OverlapKind.Duplicate)} duplicate / {r.Count(OverlapKind.Stacks)} stack");
ProtSummary prot = r.Protection;
string line2 = $"Life {prot.LifeLegendary}/7 Legendary | Crit {prot.CritLegendary}/7 Legendary";
if (r.Sets.Count > 0) line2 += $" | Sets: {r.Sets.Count}";
if (r.Paragon.Count > 0) line2 += $" | Paragon: {r.Paragon.Count}";
if (r.Buffs.Count > 0) line2 += $" | Buffs: {r.Buffs.Count}";
w.TextDisabled(line2);
if (prot.LifeMissing.Length > 0) w.TextColored(UiColors.Red, "Life wards missing: " + prot.LifeMissing);
if (prot.CritMissing.Length > 0) w.TextColored(UiColors.Red, "Banes missing: " + prot.CritMissing);
if (r.NotAppraised > 0) w.TextColored(UiColors.Yellow, $"{r.NotAppraised} item(s) not appraised yet: Check again in a moment.");
if (r.UnknownSpells > 0) w.TextDisabled($"{r.UnknownSpells} spell id(s) the client's spell table doesn't know.");
if (!PortalSpellBook.Shared.HasDat && PortalSpellBook.Shared.Done)
w.TextColored(UiColors.Yellow, "Spells from RynthOracle's own table (" + PortalSpellBook.Shared.Status + "): custom spells may show as unknown.");
if (w.CollapsingHeader("Life / Crit protection (Minor - Major - Epic - Legendary)", "g.prot", defaultOpen: true))
{
w.TextDisabled("Highest tier wins: Legendary > Epic > Major > Minor (red = missing element).");
DrawProtSection(w, "Life prot (7 wards)", prot.Life, "g.pl");
DrawProtSection(w, "Crit prot (7 banes)", prot.Crit, "g.pc");
}
if (w.CollapsingHeader("Equipped gear spells", "g.gear", defaultOpen: true))
DrawGearSpells(w, r);
if (w.CollapsingHeader("Overlap / stacking", "g.over", defaultOpen: true))
{
bool hide = _c.Settings.GearHideOverlap;
w.Checkbox("Hide overlap", "g.hide", hide, v => { _c.Settings.GearHideOverlap = v; _c.Settings.Save(); });
w.Tooltip("Hide the families where spells compete, to see what stacks.");
DrawOverlapRows(w, r, hide);
}
}
private static void DrawProtSection(UiWindow w, string title, List<ProtRow> rows, string id)
{
w.SeparatorText(title);
w.TextColored(HeaderBlue, "Element");
w.SameLine(90f); w.TextColored(HeaderBlue, "Tier");
w.SameLine(175f); w.TextColored(HeaderBlue, "Active spell");
w.SameLine(380f); w.TextColored(HeaderBlue, "Source");
w.SameLine(540f); w.TextColored(HeaderBlue, "Beats");
foreach (ProtRow row in rows)
{
w.TextColored(row.Missing ? UiColors.Red : ElementColor(row.Element), row.Element);
w.SameLine(90f); w.TextColored(TierColor(row.Tier), GearAnalysis.TierLabel(row.Tier));
if (row.Missing) continue;
w.SameLine(175f); w.Text(Cut(row.Winner, 30));
w.SameLine(380f); w.Text(Cut(row.Source, 22));
if (row.Beaten.Length > 0) { w.SameLine(540f); w.TextDisabled(Cut(row.Beaten, 30)); }
}
}
private static void GearHeader(UiWindow w)
{
w.TextColored(HeaderBlue, "Item");
w.SameLine(200f); w.TextColored(HeaderBlue, "Layer");
w.SameLine(280f); w.TextColored(HeaderBlue, "Spell");
w.SameLine(490f); w.TextColored(HeaderBlue, "Family");
w.SameLine(640f); w.TextColored(HeaderBlue, "P");
}
private static void GearSpellRow(UiWindow w, string item, SpellSource s, uint color)
{
w.TextColored(color, Cut(item, 26));
w.SameLine(200f); w.TextColored(color, s.LayerLabel);
w.SameLine(280f); w.TextColored(color, Cut(s.Spell.Name, 30));
w.SameLine(490f); w.TextColored(color, Cut(GearNames.FamilyLabel(s.Spell.Category), 22));
w.SameLine(640f); w.TextColored(color, s.Spell.Power.ToString(CultureInfo.InvariantCulture));
}
private void DrawGearSpells(UiWindow w, GearReport r)
{
if (r.Pieces.Count == 0)
{
w.TextDisabled("No equipped items found.");
return;
}
GearHeader(w);
if (r.Sets.Count > 0)
{
w.SeparatorText("Set bonuses");
foreach (SetBonusGroup g in r.Sets)
{
bool first = true;
foreach (SpellSource s in g.Spells)
{
GearSpellRow(w, first ? g.Label : "", s, SetPurple);
if (first) w.Tooltip(g.PieceNames);
first = false;
}
}
}
if (r.Paragon.Count > 0)
{
w.SeparatorText($"Paragon spells ({r.Paragon.Count})");
foreach (SpellSource s in r.Paragon) GearSpellRow(w, s.ItemName, s, ParagonTan);
}
w.SeparatorText("Equipped gear");
foreach (GearPiece p in r.Pieces)
{
string label = $"{p.Name} [{GearAnalysis.CategoryOf(p.ItemType)}{(p.Appraised ? "" : ", not appraised")}]";
List<SpellSource> spells = r.PieceSpells.TryGetValue(p.Id, out var l) ? l : new List<SpellSource>();
if (spells.Count == 0)
{
w.Text(Cut(label, 26));
w.Tooltip(label);
w.SameLine(200f);
w.TextDisabled(p.Appraised ? "(no spells)" : "(appraisal pending)");
continue;
}
bool first = true;
foreach (SpellSource s in spells)
{
GearSpellRow(w, first ? label : "", s, UiFormat.Rgb(255, 255, 255));
if (first) w.Tooltip(label);
first = false;
}
}
// The character's buffs: often fifty or more rows, so they start folded.
if (r.Buffs.Count > 0 && w.CollapsingHeader($"Character buffs ({r.Buffs.Count})", "g.buffs", defaultOpen: false))
{
GearHeader(w);
foreach (SpellSource s in r.Buffs) GearSpellRow(w, s.ItemName, s, HeaderBlue);
}
}
private static void DrawOverlapRows(UiWindow w, GearReport r, bool hideOverlap)
{
var rows = r.Rows.Where(x => x.Kind != OverlapKind.Ok && !(hideOverlap && x.Kind == OverlapKind.Overlap)).ToList();
if (rows.Count == 0)
{
w.TextDisabled(r.Rows.Any(x => x.Kind == OverlapKind.Overlap) && hideOverlap
? "Overlap rows hidden (uncheck Hide overlap)."
: r.SpellSources > 0 ? "No competing families: every spell counts." : "No spells read yet: Check again once the appraisals are in.");
return;
}
OverlapKind? last = null;
foreach (OverlapRow row in rows)
{
if (row.Kind != last)
{
w.SeparatorText(row.Kind switch
{
OverlapKind.Overlap => "Overlap - highest power wins, the rest do nothing",
OverlapKind.Duplicate => "Duplicate - the same spell on more than one item",
_ => "Stacks - these combine",
});
w.TextColored(HeaderBlue, "Family");
w.SameLine(170f); w.TextColored(HeaderBlue, "On");
w.SameLine(300f); w.TextColored(HeaderBlue, "Winner");
w.SameLine(490f); w.TextColored(HeaderBlue, "Sources");
last = row.Kind;
}
uint color = row.Kind == OverlapKind.Stacks ? UiColors.Green : row.Kind == OverlapKind.Duplicate ? UiColors.Yellow : UiFormat.Rgb(255, 255, 255);
w.TextColored(color, Cut(row.Family, 22));
w.SameLine(170f); w.Text(row.Scope.Length > 0 ? Cut(row.Scope, 18) : "character");
w.SameLine(300f); w.Text(Cut($"{row.Winner.Spell.Name} P{row.Winner.Spell.Power}", 28));
w.SameLine(490f); w.TextWrapped(row.Summary);
}
}
// ── Ratings ──────────────────────────────────────────────────────────────
private void DrawGearRatings(UiWindow w)
{
bool pack = _c.Settings.GearIncludePack;
w.Checkbox("Include pack items", "g.pack", pack, v =>
{
_c.Settings.GearIncludePack = v;
_c.Settings.Save();
StartGearCheck();
});
w.Tooltip("Also list the sets, levels and ratings of the gear in your packs (each one is appraised once).");
bool mag = _c.Settings.GearRatingsMag;
w.SameLine();
w.ToggleButton("Mag-style", "g.fmt.mag", mag, () => { _c.Settings.GearRatingsMag = true; _c.Settings.Save(); }, small: true);
w.Tooltip("Each item as one Mag-Tools ItemInfo line (what Mag-Tools prints when you identify it).");
w.SameLine();
w.ToggleButton("Columns", "g.fmt.col", !mag, () => { _c.Settings.GearRatingsMag = false; _c.Settings.Save(); }, small: true);
w.Tooltip("Rated items in columns: Loc, Item, Type, Set, Level, Ratings.");
w.TextDisabled(mag
? "Mag-Tools ItemInfo lines for your gear; [D, DR, C, CD, CR, CDR, HB, V ...] are its ratings, T11 [...] its modifiers."
: "Loc | Item | Type | Set | Level | Ratings (T11 modifier lines under the item). Weapon rows are tinted by damage type.");
RatingsReport? r = _c.Gear.Ratings;
if (r == null)
{
w.TextDisabled("Press Check to read your gear's sets, levels and ratings.");
return;
}
int rated = r.RatedRows.Count();
w.Text($"Checked {r.CheckedLocal:HH:mm:ss} | {(mag ? r.Rows.Count : rated)} item(s) | {rated} rated, {r.EquippedRows} of them worn | "
+ (r.IncludePack ? "worn + packs" : "worn only"));
if (r.IncludePack != pack) w.TextColored(UiColors.Yellow, "The pack option changed: Check again to apply it.");
if (r.WornTotals.Count > 0)
w.TextColored(UiColors.Gold, "Worn totals: " + string.Join(" ", r.WornTotals.Select(t => GearAnalysis.RatingShort(t.Prop) + " " + t.Value)));
if (r.WornTotals.Count > 0 || r.T11Totals.Count > 0)
w.Tooltip(string.Join("\n", r.WornTotals.Select(t => GearAnalysis.RatingLong(t.Prop) + " " + t.Value))
+ (r.T11Rows > 0 ? "\nT11 modifier ratings are included (the appraisal lists them under Modifiers, not Ratings)." : ""));
// The T11 modifiers (worn totals and each item's lines) are on the ILT Tracker bar window (Infinite Leaftide).
if (r.T11Rows > 0 && _c.Server.IsIlt)
w.TextColored(T11Teal, $"{r.T11Rows} T11 item(s): their modifiers are on the ILT Tracker bar button (/ro tracker).");
else if (r.T11Totals.Count > 0)
w.TextColored(T11Teal, "T11 worn: " + string.Join(" | ", r.T11Totals.Select(t => t.Name + " " + t.Value)));
if (mag)
{
DrawMagLines(w, r);
return;
}
if (rated == 0)
{
w.TextDisabled("No gear with a set, an item level or ratings.");
return;
}
w.TextColored(HeaderBlue, "Loc");
w.SameLine(45f); w.TextColored(HeaderBlue, "Item");
w.SameLine(230f); w.TextColored(HeaderBlue, "Type");
w.SameLine(330f); w.TextColored(HeaderBlue, "Set");
w.SameLine(480f); w.TextColored(HeaderBlue, "Level");
w.SameLine(550f); w.TextColored(HeaderBlue, "Ratings");
foreach (RatingRow row in r.RatedRows)
{
GearPiece p = row.Piece;
uint baseColor = p.Equipped ? WornGreen : PackGrey;
uint tint = RowTint(p, baseColor);
w.TextColored(baseColor, p.Equipped ? "Worn" : "Pack");
w.SameLine(45f); w.TextColored(tint, Cut(p.Name, 26));
w.Tooltip(p.Name);
w.SameLine(230f); w.TextColored(tint, row.TypeLabel);
w.SameLine(330f); w.TextColored(row.Paragon ? ParagonTan : baseColor, Cut(row.SetName, 20));
w.SameLine(480f); w.TextColored(baseColor, p.MaxLevel > 0 ? $"{p.Level}/{p.MaxLevel}" : "-");
w.SameLine(550f);
if (row.Stats.Length > 0) w.TextWrapped(row.Stats);
else w.TextDisabled("-");
// T11 gear's modifier lines: the T11 Tracking tab (their rating lines are in Ratings above). Off Infinite
// Leaftide (no such tab) they stay here.
if (row.T11.Length > 0 && !_c.Server.IsIlt)
{
w.Dummy(1f, 0f); // starts the line; the label then sits under the Item column
w.SameLine(45f);
w.TextColored(T11Teal, "T11:");
w.SameLine(90f);
w.TextWrapped(row.T11 + (p.ZoneLocked ? " (zone locked: power reduced outside its zone)" : ""));
}
}
}
/// <summary>A weapon's row in its damage type's colour, anything else in the worn / pack colour.</summary>
private static uint RowTint(GearPiece p, uint baseColor) =>
(p.ItemType & GearAnalysis.ItemWeapons) != 0 && p.DamageType != 0 ? ElementColorFlags(p.DamageType) : baseColor;
/// <summary>
/// The Mag-style view: every item as its Mag-Tools ItemInfo line, worn first, weapons tinted by
/// damage type, paragon pieces in tan; Print to chat writes the lines as Mag-Tools would.
/// </summary>
private void DrawMagLines(UiWindow w, RatingsReport r)
{
if (r.Rows.Count == 0)
{
w.TextDisabled("No gear found.");
return;
}
RatingsReport report = r;
w.SmallButton("Print to chat", "g.mag.print", () =>
{
foreach (RatingRow row in report.Rows) _c.Print((row.Piece.Equipped ? "" : "(pack) ") + row.Mag);
});
w.Tooltip("Writes every line below to your chat window (only you see it).");
bool packHeader = false;
foreach (RatingRow row in r.Rows)
{
GearPiece p = row.Piece;
if (!p.Equipped && !packHeader)
{
w.SeparatorText("In your packs");
packHeader = true;
}
uint baseColor = p.Equipped ? WornGreen : PackGrey;
uint tint = row.Paragon ? ParagonTan : RowTint(p, baseColor);
w.TextColored(baseColor, p.Equipped ? "Worn" : "Pack");
w.SameLine(45f);
w.PushStyleColor(0, tint); // ImGuiCol_Text: TextWrapped has no colour of its own
w.TextWrapped(row.Mag);
w.PopStyleColor();
if (!p.Appraised) w.Tooltip("Not appraised yet: Check again in a moment for its full line.");
}
}
// ── Colours ──────────────────────────────────────────────────────────────
private static uint TierColor(ProtTier tier) => tier switch
{
ProtTier.Missing => UiColors.Red,
ProtTier.Minor => TierMinor,
ProtTier.Major => TierMajor,
ProtTier.Epic => TierEpic,
ProtTier.Legendary => TierLegendary,
_ => TierLower,
};
/// <summary>Damage-type colours (UB-ILT's Combat Tracker table) by the protection element's name.</summary>
private static uint ElementColor(string element) => element switch
{
"Slashing" => ElementColorFlags(0x1),
"Piercing" => ElementColorFlags(0x2),
"Bludgeon" => ElementColorFlags(0x4),
"Cold" => ElementColorFlags(0x8),
"Fire" => ElementColorFlags(0x10),
"Acid" => ElementColorFlags(0x20),
"Storm" => ElementColorFlags(0x40),
_ => UiFormat.Rgb(255, 255, 255),
};
/// <summary>The same colours by DamageType flags (Nether wins where it is set).</summary>
private static uint ElementColorFlags(int flags)
{
if ((flags & 0x400) != 0) return UiFormat.Rgb(200, 160, 255);
return flags switch
{
0x1 => UiFormat.Rgb(255, 180, 120),
0x2 => UiFormat.Rgb(240, 200, 140),
0x3 => UiFormat.Rgb(255, 160, 100),
0x4 => UiFormat.Rgb(220, 190, 140),
0x8 => UiFormat.Rgb(160, 210, 255),
0x10 => UiFormat.Rgb(255, 130, 70),
0x20 => UiFormat.Rgb(160, 255, 140),
0x40 => UiFormat.Rgb(255, 240, 120),
_ => UiFormat.Rgb(200, 200, 200),
};
}
}

View file

@ -0,0 +1,284 @@
using System;
using System.Collections.Generic;
using System.Linq;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
// The ILT Tracker tab's quest bonus and wiki sections (Infinite Leaftide only, 2026-11-21, Silentkelpie: "look at
// acecustom add in itl qb bonus levels and bonus tracker under t11 tab, change t11 tab to itl tracker, add in the itl wiki
// how to to this tab as well"; the levels are ACECustom's QB Deeds: "should be called deeds based on total qb"). The T11
// sections stay in T11Tab.cs. Data: Data/QbDeeds.cs and RynthILT's /deeds read (IltDeedsInfo), Data/QuestBonus.cs
// (ACECustom's QB and /bonus), RynthILT's /qb list (IltQuestBonusList), Data/IltWikiGuide.cs.
internal sealed partial class OracleView
{
private string _qbFilter = "";
private bool _qbShowStamps = true;
private const int QbRowsShown = 200;
private int _qbAskedSession = -1, _bonusAskedSession = -1;
// ── QB Deeds and the XP multipliers ──────────────────────────────────
private int _deedsAskedSession = -1;
private void DrawIltQuestBonus(UiWindow w)
{
IltQuestBonusList? ilt = _c.Ilt.QuestBonus;
IltDeedsInfo? deeds = _c.Ilt.Deeds;
QuestBonus qb = _c.QuestBonus;
long count = qb.BestCount(ilt, out string from, deeds);
int tier = deeds is { Loaded: true } ? deeds.Unlocked : count >= 0 ? QbDeeds.TierFor(count) : 0;
string head = count >= 0
? $"QB Deeds ({TimeText.Number(count)} QB, tier {tier} of {QbDeeds.MaxTier}"
+ (deeds?.On == false ? ", OFF" : "") + ")"
: "QB Deeds";
if (!w.CollapsingHeader(head, "ilt.h.qb", defaultOpen: true)) return;
// Once a session: /bonus from the server, the /deeds list and the /qb list from RynthILT (the server allows /qb list
// once a minute; RynthILT reads /deeds quietly).
if (_c.InWorld && _bonusAskedSession != qb.Session) { _bonusAskedSession = qb.Session; _c.Send("/bonus"); }
if (_c.InWorld && _deedsAskedSession != qb.Session && deeds != null && !deeds.Loaded && !deeds.Busy && !deeds.Unsupported)
{
_deedsAskedSession = qb.Session;
_c.Send("/ilt deeds refresh");
}
if (_c.InWorld && _qbAskedSession != qb.Session && ilt != null && !ilt.Disabled && ilt.Generation == 0)
{
_qbAskedSession = qb.Session;
_c.Send("/ilt qb");
}
w.SmallButton(deeds?.Busy == true ? "Reading..." : "Read /deeds", "ilt.dd.read", () =>
_t11Msg = _c.Send("/ilt deeds refresh") ? "RynthILT is reading your Deeds (/deeds list)." : "Log in first.");
w.Tooltip("RynthILT reads /deeds list quietly: your QB, Deeds on or off, and every tier as the server tells it.");
w.SameLine();
if (deeds?.On == false)
w.SmallButton("Deeds on", "ilt.dd.on", () => _c.Send("/ilt deeds on"));
else
w.SmallButton("Deeds off", "ilt.dd.off", () => _c.Send("/ilt deeds off"));
w.Tooltip("/deeds on | off: the Deeds bonuses for this character (the server says which in chat).");
w.SameLine();
if (tier >= QbDeeds.RebuffTier)
{
w.SmallButton("/rebuff", "ilt.dd.rebuff", () => _c.Send("/ilt deeds rebuff"));
w.Tooltip("Tier 10: casts all your known level 8 buffs at once.");
w.SameLine();
w.SmallButton("Writ", "ilt.dd.writ", () => _c.Send("/ilt deeds item"));
w.Tooltip("/deeds item: a Deedkeeper's Writ that rebuffs you when used.");
w.SameLine();
}
w.SmallButton("Deeds window", "ilt.dd.win", () => _t11Msg = _c.RunCommand("/ilt deeds show") || _c.Send("/ilt deeds show") ? "" : "RynthILT isn't loaded.");
w.Tooltip("RynthILT's QB Deeds window (/ilt deeds).");
if (deeds?.Unsupported == true) w.TextDisabled("This server has no /deeds.");
else if (deeds == null) w.TextDisabled("RynthILT isn't loaded (or is older): the tiers below are ACECustom's table, at the default settings.");
else if (deeds.Status.Length > 0) w.TextDisabled(deeds.Status);
if (count < 0)
w.TextDisabled("No QB yet: press Read /deeds or /bonus.");
else
{
var (next, frac, toNext) = QbDeeds.Progress(count);
if (next == 0) w.TextColored(UiColors.Green, $"Every Deeds tier is unlocked ({TimeText.Number(count)} QB).");
else
{
long nextQb = deeds is { Loaded: true, NextAt: > 0 } ? deeds.NextAt : (long)next * QbDeeds.QbPerTier;
w.TextColored(T11Gold, $"Tier {tier}");
w.SameLine(70f);
w.ProgressBar(frac, 220f, 0f, $"{TimeText.Number(count)} / {TimeText.Number(nextQb)} QB");
w.SameLine();
w.TextDisabled($"{TimeText.Number(Math.Max(0, nextQb - count))} QB to tier {next}");
}
w.Tooltip("Deeds: a tier every 1,000 account QB, 15 in all, each adding to the ones before (ACECustom QB Deeds).\n"
+ $"QB from: {from}. Your QB also gives x{QuestBonus.Multiplier(count):0.000} kill XP (1 + QB x 0.005).");
}
DrawDeedTiers(w, deeds, tier);
BonusReading b = qb.Bonus;
w.Spacing();
if (!b.Seen)
{
w.TextDisabled("XP multipliers: press /bonus to read them.");
w.SameLine();
w.SmallButton("/bonus", "ilt.qb.bonus", () => _t11Msg = _c.Send("/bonus") ? "Asked the server for your XP multipliers (/bonus)." : "Log in first.");
return;
}
w.TextColored(UiColors.Gold, "XP multipliers (/bonus " + b.AtUtc.ToLocalTime().ToString("HH:mm") + ")");
w.SameLine();
w.SmallButton("/bonus", "ilt.qb.bonus", () => _t11Msg = _c.Send("/bonus") ? "Asked the server for your XP multipliers (/bonus)." : "Log in first.");
w.Tooltip("/bonus: the server prints your XP multipliers from quests, equipment and enlightenment, and the total.");
w.SameLine();
w.SmallButton("/top qb", "ilt.qb.top", () => _c.Send("/top qb"));
w.Tooltip("The server's top 25 players by quest bonus, in chat.");
BonusRow(w, "Quests", b.Quests, "1 + QB x 0.005" + (b.Quests > 0 ? $" (about {TimeText.Number(QuestBonus.QbFromMultiplier(b.Quests))} QB)" : ""));
BonusRow(w, "Equipment", b.Equipment, "1 + your XP enchantments + 5% for each Bonus XP augmentation");
BonusRow(w, "Enlightenment", b.Enlightenment, "1 + enlightenments x 0.1"
+ (b.Enlightenment > 1 ? $" ({Math.Round((b.Enlightenment - 1) / QuestBonus.PerEnlightenment):0} ENL)" : ""));
BonusRow(w, "Total", b.Total, "Quests x Equipment x Enlightenment (kill XP; the server's own XP rate comes on top)");
}
/// <summary>
/// The 15 Deeds tiers: unlocked ones green, the next one gold, the rest grey. Each tier's text is the server's own (RynthILT's
/// /deeds list) when it is in, else ACECustom's table at the default settings.
/// </summary>
private void DrawDeedTiers(UiWindow w, IltDeedsInfo? deeds, int tier)
{
var live = new Dictionary<int, IltDeedTier>();
if (deeds is { Loaded: true })
foreach (IltDeedTier t in deeds.Tiers) live[t.Number] = t;
foreach (QbDeedTier t in QbDeeds.Tiers)
{
bool have = live.TryGetValue(t.Number, out IltDeedTier? lt) ? lt.Unlocked : t.Number <= tier;
bool next = !have && t.Number == tier + 1;
uint color = have ? UiColors.Green : next ? T11Gold : UiColors.Grey;
w.TextColored(color, $"T{t.Number}");
w.SameLine(40f);
w.TextColored(color, TimeText.Number(t.Qb) + " QB");
w.SameLine(115f);
if (lt != null && lt.Rewards.Count > 0)
{
string text = string.Join(", ", lt.Rewards);
w.TextWrapped(text.Length > 260 ? text.Substring(0, 260) + "..." : text);
if (text.Length > 260) w.Tooltip(string.Join("\n", lt.Rewards));
}
else w.TextWrapped(QbDeeds.Line(t));
}
if (deeds is not { Loaded: true })
w.TextDisabled("The tier text is ACECustom's table at the server's default settings; Read /deeds shows the server's own.");
}
private static void BonusRow(UiWindow w, string name, double value, string how)
{
w.Text(name);
w.SameLine(120f);
w.TextColored(name == "Total" ? UiColors.Green : UiFormat.Rgb(230, 230, 230), $"x{value:0.00}");
w.SameLine(190f);
w.TextDisabled(how);
}
// ── Quest bonus tracker ──────────────────────────────────────────────
private void DrawIltBonusTracker(UiWindow w)
{
IltQuestBonusList? ilt = _c.Ilt.QuestBonus;
bool loaded = ilt != null && ilt.Generation > 0;
string head = loaded
? $"Quest bonus tracker ({TimeText.Number(ilt!.Completed.Count)} done, {TimeText.Number(ilt.Incomplete.Count)} to finish)"
: "Quest bonus tracker";
if (!w.CollapsingHeader(head, "ilt.h.qbt", defaultOpen: true)) return;
if (ilt == null)
{
w.TextDisabled("RynthILT isn't loaded: it reads the /qb list for this tracker.");
return;
}
if (ilt.Disabled)
{
w.TextDisabled("/qb is turned off on this server.");
return;
}
if (!loaded)
{
w.TextDisabled("The /qb list isn't read this session. " + ilt.Status);
w.SameLine();
w.SmallButton("Read /qb list", "ilt.qb.read", () => _t11Msg = _c.Send("/ilt qb") ? "RynthILT is reading your quest bonus list." : "Log in first.");
w.Tooltip("RynthILT reads /qb list: every quest that counts towards your QB, done or not (the server allows it once a minute).");
return;
}
int doneStamps = ilt.Completed.Count(QuestBonus.IsStamp);
long qbNow = ilt.Count >= 0 ? ilt.Count : ilt.Completed.Count;
long qbAll = qbNow + ilt.Incomplete.Count;
w.TextDisabled($"Per account: a quest is 1 QB once any of your characters starts it and 2 once one finishes it. "
+ $"{TimeText.Number(doneStamps)} of the done ones are Dynamic stamps.");
w.SameLine();
w.SmallButton("Read /qb list", "ilt.qb.read", () => _t11Msg = _c.Send("/ilt qb") ? "RynthILT is reading your quest bonus list." : "Log in first.");
w.Tooltip("RynthILT reads /qb list again (the server allows it once a minute).");
if (ilt.Incomplete.Count > 0)
w.TextColored(T11Gold, $"Finish the {TimeText.Number(ilt.Incomplete.Count)} started ones: {TimeText.Number(qbAll)} QB, "
+ $"Deeds tier {QbDeeds.TierFor(qbAll)} of {QbDeeds.MaxTier}.");
w.InputText("Filter", "ilt.qbt.filter", _qbFilter, 64, s => _qbFilter = s);
w.SameLine();
w.Checkbox("Dynamic stamps", "ilt.qbt.stamps", _qbShowStamps, v => _qbShowStamps = v);
w.Tooltip("List the Dynamic stamp flags too (the Quests tab's Dynamic Stamps rows track them by area).");
QbList(w, "To finish", "todo", ilt.Incomplete, UiColors.Yellow, defaultOpen: true,
"Started on this account, not finished yet: finishing each is +1 QB (+0.5% XP, and towards the next Deeds tier).");
QbList(w, "Done", "done", ilt.Completed, UiColors.Green, defaultOpen: false, "Counted in your QB.");
}
private void QbList(UiWindow w, string label, string id, IReadOnlyList<string> flags, uint color, bool defaultOpen, string help)
{
string f = _qbFilter.Trim();
List<string> rows = flags.Where(x => (_qbShowStamps || !QuestBonus.IsStamp(x))
&& (f.Length == 0 || x.Contains(f, StringComparison.OrdinalIgnoreCase))).ToList();
if (!w.CollapsingHeader($"{label} ({TimeText.Number(rows.Count)})", "ilt.qbt." + id, defaultOpen)) return;
w.TextDisabled(help);
for (int i = 0; i < rows.Count && i < QbRowsShown; i++)
{
string flag = rows[i];
w.TextColored(QuestBonus.IsStamp(flag) ? UiColors.Grey : color, Cut(flag, 60));
GuideQuest? q = _c.FindWiki(flag);
if (q != null)
{
w.SameLine();
w.TextDisabled("(wiki: " + Cut(q.Title, 30) + ")");
}
if (flag.Length > 60) w.Tooltip(flag);
}
if (rows.Count > QbRowsShown)
w.TextDisabled($"... and {TimeText.Number(rows.Count - QbRowsShown)} more: narrow them with the filter.");
}
// ── The ILT wiki: how to get its login ───────────────────────────────
private string _wikiGuideMsg = "";
private void DrawIltWikiGuide(UiWindow w)
{
QuestGuideClient g = _c.Guide;
string state = !g.Available ? "RynthILT isn't serving it"
: g.Running ? "reading..."
: g.Guide.Quests.Count > 0 ? $"{TimeText.Number(g.Guide.Quests.Count)} quests read"
: g.LoginSaved ? "login saved, not read yet" : "no login yet";
bool open = !g.LoginSaved || g.Guide.Quests.Count == 0;
if (!w.CollapsingHeader($"ILT wiki: how to get its login ({state})", "ilt.h.wiki", defaultOpen: open)) return;
w.TextWrapped("Every page of leaftidewiki.com needs a login, so RynthILT reads the wiki with a bot password: a second, "
+ "read-only password of your own wiki account. RynthOracle never sees it.");
if (g.Status.Length > 0) w.TextDisabled("Wiki: " + g.Status);
if (_wikiGuideMsg.Length > 0) w.TextColored(UiColors.Yellow, _wikiGuideMsg);
for (int i = 0; i < IltWikiGuide.Steps.Length; i++)
{
IltWikiGuide.Step st = IltWikiGuide.Steps[i];
w.TextColored(UiColors.Gold, $"{i + 1}. {st.Title}");
if (st.Url.Length > 0)
{
w.SameLine();
string url = st.Url;
string title = st.Title;
w.SmallButton("Open page", "ilt.wiki.open." + i, () =>
_wikiGuideMsg = IltWikiGuide.Open(url) ? "Opened in your browser: " + title + "." : "Couldn't open the browser: " + url);
w.Tooltip(url);
}
w.TextWrapped(st.Text);
}
w.Spacing();
w.SmallButton("RynthILT settings", "ilt.wiki.settings", () =>
_wikiGuideMsg = g.Command("settings") || _c.Send("/ilt settings") ? "" : "RynthILT isn't loaded.");
w.Tooltip("Opens /ilt settings, where the login goes (Quest guide).");
w.SameLine();
w.SmallButton(g.Running ? "Reading..." : "Read the wiki now", "ilt.wiki.read", () =>
{
if (g.Running) return;
_wikiGuideMsg = !g.LoginSaved ? "Save the login in RynthILT's settings first."
: g.Command("refresh") ? "RynthILT is reading the wiki." : "RynthILT isn't loaded.";
});
w.Tooltip("RynthILT reads the wiki again (only the pages edited since).");
w.SameLine();
w.SmallButton("/ilt wiki help", "ilt.wiki.help", () => _c.Send("/ilt wiki help"));
w.Tooltip("The same steps in chat.");
}
}

View file

@ -0,0 +1,277 @@
// The Quests tab's Kill Tasks list (2026-11-21, Silentkelpie: "add a tab to track kill tasks ... you should be
// able to track progress by looking at quests in the client"). Infinite Leaftide only. The list is the wiki's
// kill tasks (the Quest Summary box's "Kill Task = Yes", 150 pages) with each one's progress:
// - the kills: the task's counter flag in /myquests ("KillTaskDrudgeLurkers_0507: 37 of 100"), else this
// session's kill line in chat ("You have killed 37 Drudge Lurkers! You must kill 100 ...");
// - "Turn in" once the kills are all made, "Done 5h" while its timer runs, "Ready" when it can be had again;
// - "1st" or "Again" (2026-11-22, Silentkelpie: "the kill task tab should flag if the kill task has been done before or
// if it is the 1st time"): done before when a stamp or flag of the task other than its live kill counter is held
// (/myquests, the account's /qb list, this session), the quest list's flag of its name is, or its timer runs;
// and the kill counters /myquests holds that no wiki task names (so nothing the server counts is left out).
// The opened task is the wiki quest view (its steps, Go, Run this quest) with the kill count on top.
using System;
using System.Collections.Generic;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
internal sealed partial class OracleView
{
/// <summary>Where a kill task stands; the order the list shows them in.</summary>
internal enum KillState { TurnIn, Counting, Ready, NotStarted, Waiting, Completed }
/// <summary>A kill task's progress: the kills and the goal, where the count came from, and its state.</summary>
internal sealed class KillProgress
{
public KillState State;
public int Kills;
public int Goal;
/// <summary>The /myquests counter flag, or null.</summary>
public QuestFlag? Counter;
/// <summary>The count came from this session's kill line in chat (newer than /myquests).</summary>
public bool FromChat;
public string Status = "";
public uint Color = UiColors.Grey;
/// <summary>The task was done before (else this is the first time).</summary>
public bool DoneBefore;
}
/// <summary>
/// Done before: a stamp of the task is held (any run: /myquests, the /qb list, this session) other than the ones a
/// first run holds too (its live kill counter, a "start" flag, the first step's), a kill task timer flag naming its
/// creature is in /myquests, or the quest list's flag of its name is.
/// </summary>
private bool KillDoneBefore(GuideQuest q, QuestFlag? counter)
{
// Not the stamps a first run holds too: the live counter, a "start" flag, the first step's (taking the task).
string counterKey = counter != null ? GuideStamp.Key(counter.Key) : "";
var first = new HashSet<string>(StringComparer.Ordinal);
if (q.Steps.Count > 1)
foreach (string st in q.Steps[0].Stamps) first.Add(GuideStamp.Key(st));
foreach (string st in q.AllStamps())
{
string k = GuideStamp.Key(st);
if (k == counterKey || first.Contains(k) || k.Contains("start", StringComparison.Ordinal)) continue;
if (StateOf(q, st) != StampState.Missing) return true;
// A flag of the task's on a redo timer: it was turned in.
if (StampFlag(st) is QuestFlag tf && tf.RepeatTime > TimeSpan.Zero && tf.MaxSolves <= 1) return true;
}
string key = q.KillCreatureKey;
if (key.Length >= 5)
foreach (QuestFlag f in _c.Flags.Flags.Values)
if (f.MaxSolves <= 1 && f.Solves > 0 && QuestTimer.IsKillTask(f) && GuideStamp.Key(f.Key).Contains(key, StringComparison.Ordinal))
return true;
return CatalogByName(q.Title) is Quest cq && cq.IsComplete(_c.Flags);
}
/// <summary>The Kill Tasks list is on screen (the plugin reads /myquests again after kills while it is).</summary>
public bool KillTasksShowing => Tab == TabQuests && _c.Settings.QuestGuideView && _gTab == GuideTab.KillTasks;
/// <summary>
/// The task's counter flag: one of its stamps that /myquests holds with a solve limit over 1 (a kill
/// counter, "KillTaskDrudgeLurkers_0507" 37 of 100); else, for the few pages that list no stamps, a kill
/// counter flag that names the task's creature.
/// </summary>
internal QuestFlag? KillCounter(GuideQuest q)
{
foreach (string st in q.AllStamps())
if (StampFlag(st) is QuestFlag f && f.MaxSolves > 1) return f;
string key = q.KillCreatureKey;
if (key.Length < 5) return null;
foreach (QuestFlag f in _c.Flags.Flags.Values)
if (QuestTimer.IsKillTask(f) && GuideStamp.Key(f.Key).Contains(key, StringComparison.Ordinal)) return f;
return null;
}
/// <summary>A wiki kill task's progress (internal for the tests).</summary>
internal KillProgress KillProgressOf(GuideQuest q)
{
var p = new KillProgress { Goal = q.KillTarget };
GuideRow row = WikiRow(q);
QuestFlag? counter = KillCounter(q);
p.Counter = counter;
if (counter != null)
{
p.Kills = counter.Solves;
if (counter.MaxSolves > 1) p.Goal = counter.MaxSolves;
}
// A kill line newer than the last /myquests read wins (it moves with every kill).
if (_c.Kills.For(q.KillCreatureKey) is KillCount k && k.AtUtc > _c.Flags.LastReadUtc && (k.Goal > 0 || k.Kills > 0))
{
p.Kills = k.Kills;
if (k.Goal > 0) p.Goal = k.Goal;
p.FromChat = true;
}
TimeSpan wait = WikiWait(q);
bool counting = (counter != null || p.FromChat) && p.Goal > 0 && p.Kills < p.Goal;
bool allKilled = (counter != null || p.FromChat) && p.Goal > 0 && p.Kills >= p.Goal;
if (counting && !(row.Done && wait > TimeSpan.Zero))
{
p.State = KillState.Counting;
p.Status = $"{p.Kills} / {p.Goal}";
p.Color = UiColors.Yellow;
}
else if (allKilled && wait <= TimeSpan.Zero && !row.Done)
{
p.State = KillState.TurnIn;
p.Status = "Turn in";
p.Color = UiColors.Gold;
}
else if (row.Done && wait > TimeSpan.Zero)
{
p.State = KillState.Waiting;
p.Status = "Done " + Short(wait);
p.Color = UiColors.Yellow;
}
else if (row.Done && q.RepeatSec == 0)
{
p.State = KillState.Completed;
p.Status = "Completed";
p.Color = UiColors.Green;
}
else if (row.State == GuideProgressState.Done || row.Done || counter != null)
{
p.State = KillState.Ready;
p.Status = "Ready";
p.Color = UiColors.Green;
}
else
{
p.State = KillState.NotStarted;
p.Status = p.Goal > 0 ? $"0 / {p.Goal}" : "Not started";
p.Color = UiColors.Grey;
}
p.DoneBefore = p.State is KillState.Waiting or KillState.Completed || KillDoneBefore(q, counter);
return p;
}
/// <summary>The Kill Tasks list: the wiki's kill tasks, then the counters only /myquests knows. Each by state, then name.</summary>
private void KillTaskRows(string[] terms, bool hide)
{
var order = new Dictionary<string, (int State, string Label)>(StringComparer.Ordinal);
var named = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (GuideQuest q in _c.Wiki.Quests)
{
if (!_c.Wiki.IsKillTask(q)) continue;
KillProgress p = KillProgressOf(q);
if (p.Counter != null) named.Add(p.Counter.Key);
foreach (string st in q.AllStamps()) named.Add(st);
if (!MatchesAll(WikiHay(q), terms)) continue;
bool done = p.State is KillState.Waiting or KillState.Completed;
if (hide && done) continue;
var r = new GuideRow { Key = "w:" + q.Title, Label = q.Title, W = q, Done = done, Status = p.Status, Color = p.Color };
SetKillTag(r, p.DoneBefore);
_gRows.Add(r);
order[r.Key] = ((int)p.State, r.Label);
}
// Counters the server keeps that no wiki kill task names.
var namedKeys = new HashSet<string>(StringComparer.Ordinal);
foreach (string n in named) namedKeys.Add(GuideStamp.Key(n));
foreach (QuestFlag f in _c.Flags.Flags.Values)
{
if (!QuestTimer.IsKillTask(f) || namedKeys.Contains(GuideStamp.Key(f.Key))) continue;
if (!MatchesAll(f.Key + " " + f.Description, terms)) continue;
QuestTimerState st = QuestTimer.State(f, true, _c.UtcNow, out string text);
KillState ks = st switch
{
QuestTimerState.InProgress => KillState.Counting,
QuestTimerState.Waiting => KillState.Waiting,
QuestTimerState.Done => KillState.Completed,
_ => KillState.Ready,
};
bool done = ks is KillState.Waiting or KillState.Completed;
if (hide && done) continue;
var r = new GuideRow
{
Key = "k:" + f.Key, Label = FlagLabel(f.Key), Flag = f, Done = done,
Status = ks == KillState.Counting ? $"{f.Solves} / {f.MaxSolves}" : ks == KillState.Waiting ? "Done " + text : ks == KillState.Completed ? "Completed" : "Ready",
Color = ks switch { KillState.Counting or KillState.Waiting => UiColors.Yellow, KillState.Completed or KillState.Ready => UiColors.Green, _ => UiColors.Grey },
};
// A counter alone: its timer running or up says it was turned in before.
SetKillTag(r, ks is KillState.Waiting or KillState.Completed or KillState.Ready);
_gRows.Add(r);
order[r.Key] = ((int)ks, r.Label);
}
_gRows.Sort((a, b) =>
{
(int sa, string la) = order[a.Key];
(int sb, string lb) = order[b.Key];
return sa != sb ? sa.CompareTo(sb) : string.Compare(la, lb, StringComparison.OrdinalIgnoreCase);
});
}
private static void SetKillTag(GuideRow r, bool doneBefore)
{
(r.Tag, r.TagTip) = GuideProgress.KillTag(doneBefore);
r.TagColor = doneBefore ? UiColors.Green : UiColors.Gold;
}
/// <summary>"KillTaskDrudgeLurkers_0507" -> "Kill Task Drudge Lurkers 0507".</summary>
internal static string FlagLabel(string flag)
{
var sb = new System.Text.StringBuilder(flag.Length + 8);
for (int i = 0; i < flag.Length; i++)
{
char c = flag[i];
if (c == '_') { if (sb.Length > 0 && sb[^1] != ' ') sb.Append(' '); continue; }
if (i > 0 && char.IsUpper(c) && (char.IsLower(flag[i - 1]) || char.IsDigit(flag[i - 1])) && sb.Length > 0 && sb[^1] != ' ') sb.Append(' ');
else if (i > 0 && char.IsDigit(c) && char.IsLetter(flag[i - 1]) && sb.Length > 0 && sb[^1] != ' ') sb.Append(' ');
sb.Append(c);
}
return sb.ToString().Trim();
}
/// <summary>A line over the list: how many tasks are counting, to turn in and ready.</summary>
private void DrawKillSummary(UiWindow w)
{
int counting = 0, turnIn = 0, ready = 0;
foreach (GuideQuest q in _c.Wiki.Quests)
{
if (!_c.Wiki.IsKillTask(q)) continue;
switch (KillProgressOf(q).State)
{
case KillState.Counting: counting++; break;
case KillState.TurnIn: turnIn++; break;
case KillState.Ready: ready++; break;
}
}
string read = _c.Flags.LastReadUtc == DateTime.MinValue ? "not read yet" : "read " + Short(_c.UtcNow - _c.Flags.LastReadUtc) + " ago";
w.TextDisabled($"Kill tasks: {counting} counting, {turnIn} to turn in, {ready} ready | /myquests {read}");
w.Tooltip("The kills come from your quest flags (/myquests): each task's counter flag. A kill line in chat\n"
+ "(\"You have killed 37 Drudge Lurkers! You must kill 100 ...\") shows at once, and with this list open\n"
+ "the flags are read again after kills (at most once a minute: the server's limit). Refresh reads them now.");
}
/// <summary>The kill count over an opened wiki kill task.</summary>
private void DrawKillLine(UiWindow w, GuideQuest q)
{
KillProgress p = KillProgressOf(q);
string count = p.Counter != null || p.FromChat
? $"Kills: {p.Kills} / {(p.Goal > 0 ? p.Goal.ToString(System.Globalization.CultureInfo.InvariantCulture) : "?")}"
+ (p.Goal > p.Kills ? $" ({p.Goal - p.Kills} left)" : "")
: p.Goal > 0 ? $"Kills: not started (the task is {p.Goal} kills)" : "Kills: not started";
w.TextColored(p.Color, count + " - " + p.Status);
w.SameLine();
w.TextColored(p.DoneBefore ? UiColors.Green : UiColors.Gold, p.DoneBefore ? "(done before)" : "(first time)");
string from = p.FromChat ? "from the last kill line in chat"
: p.Counter != null ? $"from /myquests: {p.Counter.Key} ({p.Counter.Solves} of {p.Counter.MaxSolves})"
: "no counter flag in /myquests yet (talk to " + (q.StartsWith.Length > 0 ? q.StartsWith : "the task's NPC") + " to start it)";
w.TextDisabled(from);
}
/// <summary>A kill counter only /myquests knows.</summary>
private void DrawKillFlag(UiWindow w, QuestFlag f)
{
w.TextColored(UiColors.Gold, FlagLabel(f.Key));
QuestTimerState st = QuestTimer.State(f, true, _c.UtcNow, out string text);
w.Text($"Kills: {f.Solves} / {f.MaxSolves}" + (f.Solves < f.MaxSolves ? $" ({f.MaxSolves - f.Solves} left)" : ""));
w.TextDisabled("State: " + (st == QuestTimerState.Waiting ? "again in " + text : text));
if (f.RepeatTime > TimeSpan.Zero) w.TextDisabled("Timer: " + Short(f.RepeatTime));
if (f.Description.Length > 0) w.TextWrapped(f.Description);
w.TextDisabled("Flag " + f.Key + " - no wiki kill task names this counter.");
}
}

View file

@ -1,4 +1,5 @@
using System;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
@ -9,7 +10,7 @@ namespace RynthCore.Plugin.RynthOracle.Views;
/// </summary>
internal sealed partial class OracleView
{
public const string TabQuests = "Quests", TabCharacter = "Character",
public const string TabQuests = "Quests", TabCharacter = "Character", TabGear = "Gear",
TabSkills = "Skills", TabAttributes = "Attributes", TabProgress = "Progress",
TabAugs = "Augs", TabSociety = "Society",
TabTitles = "Titles", TabVoid = "Void", TabFellowship = "Fellowship",
@ -50,6 +51,9 @@ internal sealed partial class OracleView
() => "RynthCore's skills panel: attributes and vitals."),
new(TabProgress, DrawEmbedded, false, RefreshCharacter,
() => "RynthCore's skills panel: progression planners (where the server has them)."),
// Gear: every server's (the spells come from the client's own spell table).
new(TabGear, DrawGear, false, RefreshGear,
() => "Checks your gear again: worn items are appraised where needed, then the overlap and ratings lists are rebuilt."),
new(TabAugs, DrawAugs, true, RefreshCharacterAndQuests,
() => "Re-reads your character from the game and sends /myquests for the gem timers."),
new(TabSociety, DrawSociety, true, RefreshCharacterAndQuests,
@ -58,6 +62,8 @@ internal sealed partial class OracleView
() => "Re-reads the titles you hold from the game."),
new(TabVoid, DrawVoid, true, RefreshVoid,
() => "Re-reads your buffs from the game and drops the spell timers that ran out."),
// ILT Tracker left the Oracle tab strip 2026-11-22: its own bar window ("ILT Tracker", /ro tracker).
// ILT Hub pages are RynthILT's "ILT Features" bar window (like Conquest).
new(TabFellowship, DrawFellowship, false, RefreshFellowship,
() => "Re-reads the fellowship and its members from the game."),
new(TabAbout, DrawAbout, false, RefreshAbout,
@ -66,15 +72,17 @@ internal sealed partial class OracleView
}
/// <summary>Every tab shows on every server (a server's own pages are its server plugin's).</summary>
private static bool Visible(TabDef t) => true;
private bool Visible(TabDef t) => true;
/// <summary>The selected tab's name; a tab not available on this server falls back to Quests.</summary>
/// <summary>The selected tab's name; an old saved ILT Tracker / T11 tab falls back to Quests.</summary>
public string Tab
{
get
{
string saved = _c.Settings.TabName;
if (saved == TabT11 || saved == TabT11Old) return TabQuests;
foreach (TabDef t in _tabs)
if (t.Name == _c.Settings.TabName && Visible(t)) return t.Name;
if (t.Name == saved && Visible(t)) return t.Name;
return TabQuests;
}
set
@ -172,4 +180,14 @@ internal sealed partial class OracleView
w.SmallButton(">", id + ".next", () => setPage(Math.Min(pages - 1, p + 1)));
return page;
}
/// <summary>Celestial Hand / Eldrytch Web / Radiant Blood from PropertyInt 287–289 (for society quest runs).</summary>
private SocietyStanding Standing()
{
CharacterSnapshot c = _c.Character;
return new SocietyStanding(
c.Int(_c.Host, CharacterSnapshot.IntSocietyCelhan),
c.Int(_c.Host, CharacterSnapshot.IntSocietyEldweb),
c.Int(_c.Host, CharacterSnapshot.IntSocietyRadblo));
}
}

View file

@ -0,0 +1,899 @@
// The Quests tab's guide view (2026-11-01, Silentkelpie's layout): the quests on the left with how many of
// their stamps you hold, the opened quest on the right: its timer, where it starts, its steps with their
// coordinates (Go) and the stamps each gives (ticked when you hold them), its loot and rewards, and "Run this
// quest" (QuestRunner: RynthNav walks the steps, RynthAi picks up the quest's items). On Infinite Leaftide the
// list holds the wiki's quests (RynthILT reads leaftidewiki.com: QuestGuideClient) with the master quest list's
// own, and the Dynamic Stamps by area; elsewhere the master list's quests. Tabs: All / Story / Dailies /
// Weekly, and on ILT QB / ILT Wiki / Stamps. "Flag list" switches back to the full flag list (QuestsTab.cs).
using System;
using System.Collections.Generic;
using System.Globalization;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
/// <summary>The guide view's tabs.</summary>
internal enum GuideTab { All, Story, Dailies, Weekly, Qb, Wiki, Stamps, KillTasks, Society, Contracts }
internal sealed partial class OracleView
{
private static readonly string[] GuideTabNames = { "All", "Story", "Dailies", "Weekly", "QB", "Wiki", "Stamps", "Kill Tasks", "Society", "Contracts" };
private const int GuidePageSize = 60;
private const int GuideLabelChars = 48;
private const int ColText = 0; // ImGuiCol_Text
private GuideTab _gTab;
private string _gSearch = "";
private int _gPage;
private string _gSel = "";
private string _gMsg = "";
private readonly List<GuideRow> _gRows = new();
private string _gRowsKey = "";
// The stamps the character holds (GuideStamp keys): /myquests flags, the /qb list, this session's stamps.
private HashSet<string> _held = new(StringComparer.Ordinal);
private string _heldKey = "";
private sealed class GuideRow
{
public string Key = "";
public string Label = "";
public string Status = "";
public uint Color = UiColors.Grey;
public bool Done;
public GuideQuest? W;
public Quest? Q;
public string Area = "";
/// <summary>A kill counter only /myquests knows (the Kill Tasks list).</summary>
public QuestFlag? Flag;
/// <summary>A contract (the Contracts list).</summary>
public GuideContract? C;
/// <summary>The status's tooltip (the four states' sentence, 2026-11-22).</summary>
public string Tip = "";
/// <summary>The four states (a wiki or quest list row).</summary>
public GuideProgressState State;
/// <summary>A short tag before the status (a kill task's "1st" / "Again"), its colour and tooltip.</summary>
public string Tag = "";
public uint TagColor = UiColors.Grey;
public string TagTip = "";
}
/// <summary>
/// The tabs this server has (internal for the tests). Since 2026-11-21 the wiki tabs are on every server: Wiki
/// (every wiki quest), Kill Tasks, Society and Contracts, from the AC Community Wiki (RynthILT's wiki on
/// Infinite Leaftide). QB and Stamps stay Infinite Leaftide's.
/// </summary>
internal List<GuideTab> GuideTabs()
{
var tabs = new List<GuideTab> { GuideTab.All, GuideTab.Story, GuideTab.Dailies, GuideTab.Weekly, GuideTab.Wiki,
GuideTab.KillTasks, GuideTab.Society, GuideTab.Contracts };
if (_c.Server.IsIlt) { tabs.Add(GuideTab.Qb); tabs.Add(GuideTab.Stamps); }
return tabs;
}
/// <summary>The tabs on the second row: the wiki's lists.</summary>
private static bool SecondRow(GuideTab t) => t is GuideTab.KillTasks or GuideTab.Society or GuideTab.Contracts or GuideTab.Qb or GuideTab.Stamps;
/// <summary>Opens a guide tab (and the guide view). Internal for the tests and /ro.</summary>
internal void ShowGuide(GuideTab tab, string? select = null)
{
_c.Settings.QuestGuideView = true;
_gTab = tab;
_gPage = 0;
if (select != null) _gSel = select;
Tab = TabQuests;
}
/// <summary>The Guide / Flag list switch at the top of the Quests tab.</summary>
private void DrawQuestViewSwitch(UiWindow w)
{
bool guide = _c.Settings.QuestGuideView;
w.ToggleButton("Guide", "q.view.guide", guide, () => SetGuideView(true), small: true);
w.Tooltip("The quests with their steps: the list on the left, the opened quest on the right.");
w.SameLine();
w.ToggleButton("Flag list", "q.view.flags", !guide, () => SetGuideView(false), small: true);
w.Tooltip("Every quest flag you hold, with the trackers, filters, timers and rewards.");
}
private void SetGuideView(bool guide)
{
if (_c.Settings.QuestGuideView == guide) return;
_c.Settings.QuestGuideView = guide;
_c.Settings.Save();
}
// ── Held stamps ─────────────────────────────────────────────────────────
private HashSet<string> HeldStamps()
{
string key = $"{_c.Flags.Revision}|{_c.Ilt.Revision}|{_c.SessionStampRevision}";
if (key == _heldKey) return _held;
_heldKey = key;
var set = new HashSet<string>(StringComparer.Ordinal);
foreach (string f in _c.Flags.Flags.Keys) set.Add(GuideStamp.Key(f));
if (_c.Server.IsIlt)
foreach (string f in _c.Ilt.QbCompletedSet) set.Add(GuideStamp.Key(f));
foreach (string s in _c.SessionStamps) set.Add(s);
_held = set;
return set;
}
private bool StampHeld(string stamp) => HeldStamps().Contains(GuideStamp.Key(stamp));
/// <summary>Where a quest's stamp stands for this run of the quest (2026-11-01).</summary>
internal enum StampState
{
/// <summary>Never stamped.</summary>
Missing,
/// <summary>Stamped, and it counts now: a one-time quest's, or a repeatable one's still inside its timer.</summary>
Done,
/// <summary>Stamped on an earlier run of a repeatable quest whose timer has run out: it can be had again.</summary>
Earlier,
}
/// <summary>
/// A stamp of <paramref name="q"/> for this run. Before 2026-11-01 any stamp ever held was ticked, so a
/// daily done yesterday showed every step done though it was ready again. Now a repeatable quest's stamp
/// counts while its flag's timer runs (or, with no timer on the flag, while the quest's repeat time since
/// it was stamped hasn't passed); after that it is Earlier. A stamp seen in chat this session is Done.
/// </summary>
private StampState StateOf(GuideQuest q, string stamp)
{
if (_c.SessionStamps.Contains(GuideStamp.Key(stamp))) return StampState.Done;
QuestFlag? f = StampFlag(stamp);
bool repeats = q.RepeatSec != 0;
if (f != null)
{
if (!repeats) return StampState.Done;
if (f.RepeatTime > TimeSpan.Zero) return f.NextAvailableTime(_c.UtcNow) > TimeSpan.Zero ? StampState.Done : StampState.Earlier;
if (q.RepeatSec > 0 && f.CompletedOnUtc != DateTime.MinValue)
return f.CompletedOnUtc.AddSeconds(q.RepeatSec) > _c.UtcNow ? StampState.Done : StampState.Earlier;
return StampState.Done;
}
// The /qb list (Infinite Leaftide) says only that it was ever stamped.
if (StampHeld(stamp)) return repeats ? StampState.Earlier : StampState.Done;
return StampState.Missing;
}
/// <summary>A step is done when it has stamps and each one counts now.</summary>
private bool StepDone(GuideQuest q, GuideStep s) => s.Stamps.Count > 0 && s.Stamps.TrueForAll(st => StateOf(q, st) == StampState.Done);
/// <summary>
/// Each step's state: done (its stamps count now), done by the steps after it (no stamp of its own, but a
/// later step is done: the quest went past it), or not done; and the first step not done (-1: none).
/// </summary>
private (bool[] Done, bool[] Implied, int Next) StepStates(GuideQuest q)
{
int n = q.Steps.Count;
var done = new bool[n];
var implied = new bool[n];
int lastDone = -1;
for (int i = 0; i < n; i++)
{
done[i] = StepDone(q, q.Steps[i]);
if (done[i]) lastDone = i;
}
for (int i = 0; i < lastDone; i++)
if (!done[i] && q.Steps[i].Stamps.Count == 0) implied[i] = true;
int next = -1;
for (int i = 0; i < n; i++)
if (!done[i] && !implied[i]) { next = i; break; }
return (done, implied, next);
}
/// <summary>The flag a stamp is in /myquests (any spelling of it), or null.</summary>
private QuestFlag? StampFlag(string stamp)
{
if (_c.Flags.TryGet(stamp, out QuestFlag f)) return f;
string k = GuideStamp.Key(stamp);
foreach (KeyValuePair<string, QuestFlag> kv in _c.Flags.Flags)
if (GuideStamp.Key(kv.Key) == k) return kv.Value;
return null;
}
// ── The view ────────────────────────────────────────────────────────────
private void DrawGuide(UiWindow w)
{
List<GuideTab> tabs = GuideTabs();
if (!tabs.Contains(_gTab)) _gTab = GuideTab.All;
bool second = false;
foreach (GuideTab t in tabs)
{
GuideTab tab = t;
if (SecondRow(t) && !second)
{
second = true;
w.Dummy(0f, 0f); // ends the first row (the SameLine before it)
}
string name = t == GuideTab.Wiki ? _c.WikiLabel : GuideTabNames[(int)t];
w.ToggleButton(name, "g.tab." + (int)t, _gTab == t, () => { _gTab = tab; _gPage = 0; });
w.SameLine();
}
w.Checkbox("Hide collected", "g.hide", _c.Settings.GuideHideCollected, v =>
{
_c.Settings.GuideHideCollected = v;
_c.Settings.Save();
_gPage = 0;
});
w.Tooltip("Leave out the quests whose stamps you all hold (and stamps you have).");
w.SameLine();
w.Button("Refresh", "g.refresh", () => _gMsg = GuideRefresh());
w.Tooltip("Reads your quest flags again (/myquests), and the wiki's quests: the AC Community Wiki"
+ (_c.Server.IsIlt ? " and RynthILT's." : "."));
w.InputText("##g.search", "g.search", _gSearch, 64, s => { _gSearch = s; _gPage = 0; });
w.Tooltip("Words to find: a quest's name, NPC, place, items or stamps.");
w.SameLine();
DrawGuideSource(w);
if (_gMsg.Length > 0) w.TextDisabled(_gMsg);
if (_gTab == GuideTab.KillTasks) DrawKillSummary(w);
if (_gTab == GuideTab.Contracts) w.TextDisabled($"Contracts: {_c.Fandom.Guide.Contracts.Count} on the AC Community Wiki; the quest each is for opens with Open, and Run this quest runs it.");
if (_gTab == GuideTab.Stamps)
w.TextDisabled(DynamicStampList.Source == "wiki"
? $"Stamps: the wiki's Dynamic Stamps page ({DynamicStampList.All.Count} stamps in {DynamicStampList.Areas.Count} places)"
: $"Stamps: the players' sheet ({DynamicStampList.All.Count}); the wiki's page once RynthILT has read it");
List<GuideRow> rows = GuideRows();
float total = w.ContentWidth > 0f ? w.ContentWidth : 680f;
// The list gets enough room for the names (2026-11-01: at 38% they were cut to ~15 letters).
float leftW = Math.Clamp(total * 0.45f, 260f, 440f);
w.BeginChild("g.list", leftW, 0f, border: true);
if (rows.Count > GuidePageSize)
{
_gPage = Pager(w, "g.page", _gPage, rows.Count, GuidePageSize, p => _gPage = p);
}
else _gPage = 0;
int start = _gPage * GuidePageSize;
// The status column holds the four states ("3/5 wait 5h 12m", 2026-11-22); a kill task's tag sits before it.
float statusX = Math.Max(150f, leftW - 104f);
bool tags = false;
for (int i = start; i < rows.Count && i < start + GuidePageSize; i++) if (rows[i].Tag.Length > 0) { tags = true; break; }
float tagX = statusX - 40f;
float labelEnd = tags ? tagX : statusX;
int chars = Math.Max(16, Math.Min(GuideLabelChars, (int)((labelEnd - 14f) / 6.2f)));
for (int i = start; i < rows.Count && i < start + GuidePageSize; i++)
{
GuideRow r = rows[i];
string key = r.Key;
w.Selectable(Cut(r.Label, chars), "g.r." + key, key == _gSel, () => _gSel = key, labelEnd - 12f);
if (r.Label.Length > chars) w.Tooltip(r.Label);
if (r.Tag.Length > 0)
{
w.SameLine(tagX);
w.TextColored(r.TagColor, r.Tag);
if (r.TagTip.Length > 0) w.Tooltip(r.TagTip);
}
if (r.Status.Length > 0)
{
w.SameLine(statusX);
w.TextColored(r.Color, r.Status);
if (r.Tip.Length > 0) w.Tooltip(r.Tip);
}
}
if (rows.Count == 0)
w.TextDisabled(_gTab is GuideTab.Wiki or GuideTab.KillTasks or GuideTab.Society or GuideTab.Contracts && _c.Wiki.Quests.Count == 0
? "No wiki quests yet (see above)." : "Nothing matches.");
w.EndChild();
w.SameLine();
w.BeginChild("g.detail", 0f, 0f, border: true);
GuideRow? sel = rows.Find(r => r.Key == _gSel) ?? FindGuideRow(_gSel);
if (sel == null) w.TextDisabled("Pick a quest on the left.");
else if (sel.W != null) DrawWikiQuest(w, sel.W);
else if (sel.Q != null) DrawGuideCatalogQuest(w, sel.Q);
else if (sel.Area.Length > 0) DrawStampArea(w, sel.Area);
else if (sel.Flag != null) DrawKillFlag(w, sel.Flag);
else if (sel.C != null) DrawContract(w, sel.C);
w.EndChild();
}
/// <summary>
/// Where the wiki's quests come from, one line: the AC Community Wiki (every server, 2026-11-21), or on
/// Infinite Leaftide RynthILT's wiki once it has quests.
/// </summary>
private void DrawGuideSource(UiWindow w)
{
if (!_c.Server.IsIlt && _c.ServerGuide.Client.Available)
{
QuestGuideClient sg = _c.ServerGuide.Client;
string tag = sg.Tag.Length > 0 ? sg.Tag : "Server";
string st = sg.Running ? $"{tag} Wiki: {sg.Status}" : sg.Guide.Quests.Count > 0 ? $"{tag} Wiki: {sg.Guide.Quests.Count} quests" : $"{tag} Wiki: {sg.Status}";
w.TextDisabled(Cut(st, 50));
w.Tooltip($"{tag}'s own wiki quests, from the server's plugin, first in the wiki tab; then the AC Community Wiki's. " + sg.Status);
w.SameLine();
}
if (!_c.Server.IsIlt || _c.Guide.Guide.Quests.Count == 0 && !_c.Guide.Running)
{
FandomFeed f = _c.Fandom;
string ft = f.Running ? "AC Wiki: " + f.Status
: f.Guide.Quests.Count > 0 ? $"AC Wiki: {f.Guide.Quests.Count} quests, {f.Guide.Contracts.Count} contracts, read {f.Guide.UpdatedUtc.ToLocalTime():MM-dd HH:mm}"
: "AC Wiki: " + f.Status;
w.TextDisabled(Cut(ft, 70));
w.Tooltip("The quests, kill tasks, society quests and contracts of the AC Community Wiki (asheron.fandom.com),\n"
+ "read by RynthOracle at login once a day, and by Refresh. " + f.Status
+ (_c.Server.IsIlt ? "\nOn this server, RynthILT's own wiki is used once it has been read." : ""));
if (!_c.Server.IsIlt) return;
w.SameLine();
}
QuestGuideClient g = _c.Guide;
if (!g.Available)
{
w.TextDisabled("Wiki quests: RynthILT isn't serving them (update RynthILT).");
return;
}
string text = g.Running ? "Wiki: reading... " + g.Status
: g.Guide.Quests.Count > 0 ? $"Wiki: {g.Guide.Quests.Count} quests, read {g.Guide.UpdatedUtc.ToLocalTime():MM-dd HH:mm}"
: g.LoginSaved ? "Wiki: " + g.Status : "Wiki: no login yet";
w.TextDisabled(Cut(text, 70));
w.Tooltip(g.Status + (g.LoginSaved ? "" : "\nThe wiki needs a login: make a bot password on leaftidewiki.com (Special:BotPasswords) and type it into RynthILT's settings > Quest guide. Or import a Special:Export file there."));
if (!g.LoginSaved && g.Guide.Quests.Count == 0)
{
w.SameLine();
w.SmallButton("Wiki login...", "g.wikilogin", () => _gMsg = g.Command("settings") ? "RynthILT's settings are open: Quest guide." : "RynthILT didn't answer.");
}
}
private string GuideRefresh()
{
string msg = _c.RequestQuests() ? "Reading your quest flags..." : "Quest flags: not now (the server allows one /myquests a minute).";
if (_c.Server.IsIlt && _c.Guide.Available && _c.Guide.LoginSaved && !_c.Guide.Running)
msg += _c.Guide.Command("refresh") ? " Reading the wiki too." : "";
if (_c.Fandom.Start()) msg += " Reading the AC Community Wiki.";
return msg;
}
// ── Rows ────────────────────────────────────────────────────────────────
private GuideRow? FindGuideRow(string key)
{
if (key.StartsWith("w:", StringComparison.Ordinal) && _c.FindWiki(key.Substring(2)) is GuideQuest q) return WikiRow(q);
if (key.StartsWith("c:", StringComparison.Ordinal) && _c.Fandom.Guide.Contracts.Find(x => x.Title == key.Substring(2)) is GuideContract gc) return ContractRow(gc);
if (key.StartsWith("k:", StringComparison.Ordinal) && _c.Flags.TryGet(key.Substring(2), out QuestFlag kf))
return new GuideRow { Key = key, Label = FlagLabel(kf.Key), Flag = kf };
if (key.StartsWith("q:", StringComparison.Ordinal) && _c.Catalog.TryGet(key.Substring(2), out Quest cq)) return CatalogRow(cq);
return null;
}
private List<GuideRow> GuideRows()
{
HeldStamps();
string key = $"{_gTab}|{_gSearch}|{_c.Settings.GuideHideCollected}|{_c.Server.IsIlt}|{_c.WikiRevision}|{_c.Catalog.Revision}|{_heldKey}|{_c.Kills.Revision}|{DynamicStampList.Revision}|{_c.UtcNow:yyyyMMddHHmm}";
if (key == _gRowsKey) return _gRows;
_gRowsKey = key;
_gRows.Clear();
string[] terms = _gSearch.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
bool hide = _c.Settings.GuideHideCollected;
if (_gTab == GuideTab.Stamps)
{
foreach (string area in DynamicStampList.Areas)
{
int have = 0, all = 0;
string hay = area;
foreach (DynamicStamp s in DynamicStampList.All)
{
if (s.Area != area) continue;
all++;
if (s.Have(_c.Flags, _c.Ilt.QbStampSet)) have++;
hay += " " + s.Npc + " " + s.Place + " " + s.Reward;
}
if (all == 0 || !MatchesAll(hay, terms)) continue;
bool done = have == all;
if (hide && done) continue;
_gRows.Add(new GuideRow
{
Key = "a:" + area, Label = area, Area = area, Done = done,
Status = done ? "Completed" : $"{have} / {all}", Color = done ? UiColors.Green : have > 0 ? UiColors.Yellow : UiColors.Grey,
});
}
return _gRows;
}
if (_gTab == GuideTab.KillTasks)
{
KillTaskRows(terms, hide);
return _gRows;
}
if (_gTab == GuideTab.Society)
{
SocietyRows(terms, hide);
return _gRows;
}
if (_gTab == GuideTab.Contracts)
{
ContractRows(terms, hide);
return _gRows;
}
var wikiNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (GuideQuest q in _c.Wiki.Quests)
{
wikiNames.Add(q.Title);
if (!WikiInTab(q, _gTab)) continue;
if (!MatchesAll(WikiHay(q), terms)) continue;
GuideRow r = WikiRow(q);
if (hide && r.Done) continue;
_gRows.Add(r);
}
if (_gTab is GuideTab.All or GuideTab.Story or GuideTab.Dailies or GuideTab.Weekly)
foreach (Quest q in _c.Catalog.Quests)
{
if (q.IsNew || wikiNames.Contains(q.DisplayName)) continue;
long rep = CatalogRepeatSec(q);
bool inTab = _gTab switch
{
GuideTab.Story => rep == 0,
GuideTab.Dailies => rep > 0 && rep <= 26 * 3600,
GuideTab.Weekly => rep > 26 * 3600 && rep <= 31L * 86400,
_ => true,
};
if (!inTab || !MatchesAll(q.Flag + " " + q.DisplayName, terms)) continue;
GuideRow r = CatalogRow(q);
if (hide && r.Done) continue;
_gRows.Add(r);
}
// The wiki's quests first (they have steps), then the quest list's; each by name.
_gRows.Sort((a, b) => (a.W == null).CompareTo(b.W == null) is int k && k != 0 ? k
: string.Compare(a.Label, b.Label, StringComparison.OrdinalIgnoreCase));
return _gRows;
}
private static bool WikiInTab(GuideQuest q, GuideTab tab) => tab switch
{
GuideTab.Story => q.IsOneTime,
GuideTab.Dailies => q.IsDaily,
GuideTab.Weekly => q.IsWeekly,
GuideTab.Qb => q.Qb > 0,
_ => true,
};
private static string WikiHay(GuideQuest q) =>
$"{q.Title} {q.StartsWith} {q.StartsAt} {q.Type} {string.Join(" ", q.Loot)} {string.Join(" ", q.AllStamps())} {string.Join(" ", q.Categories)}";
/// <summary>A catalog quest's repeat timer: the server's (its flag's), else the list's; 0 one-time.</summary>
private long CatalogRepeatSec(Quest q)
{
if (_c.Flags.TryGet(q.Flag, out QuestFlag f) && f.RepeatTime > TimeSpan.Zero) return (long)f.RepeatTime.TotalSeconds;
if (q.MinDelta > 0) return q.MinDelta;
return q.IsRepeatable(_c.Flags) ? 86400 : 0;
}
/// <summary>
/// A wiki quest's row in the four states (2026-11-22): Done (every stamp held), partly done with the redo timer
/// running, partly done with the timer up, Not done. Held = in /myquests (any run), the /qb list, or stamped this
/// session. A page with no stamps (the AC Community Wiki's) takes the quest list's flag of the same name: Done or
/// Not done. <see cref="GuideRow.Done"/> (Hide collected) is Done with nothing to do now: one-time, or its timer
/// running.
/// </summary>
private GuideRow WikiRow(GuideQuest q)
{
int held = 0, now = 0, all = 0;
foreach (string st in q.AllStamps())
{
all++;
StampState ss = StateOf(q, st);
if (ss != StampState.Missing) held++;
if (ss == StampState.Done) now++;
}
var r = new GuideRow { Key = "w:" + q.Title, Label = q.Title, W = q };
if (all == 0)
{
if (CatalogByName(q.Title) is Quest cq)
{
GuideRow cr = CatalogRow(cq);
r.Done = cr.Done;
r.State = cr.State;
r.Status = cr.Status;
r.Color = cr.Color;
r.Tip = cr.Tip;
return r;
}
r.Status = "no stamps";
r.Tip = "The wiki lists no stamps for this quest, and the quest list has no flag of its name: its state isn't known.";
r.Color = UiColors.Grey;
return r;
}
TimeSpan wait = HeldWait(q);
bool repeats = q.RepeatSec != 0 || wait > TimeSpan.Zero;
GuideProgressState state = GuideProgress.Of(held, all, wait);
r.State = state;
(r.Status, r.Tip) = GuideProgress.Text(state, held, all, wait, repeats);
r.Color = ProgressColor(state);
// Hide collected: done, with nothing to do now (one-time, its timer running, or every stamp counting this run).
r.Done = state == GuideProgressState.Done && (!repeats || wait > TimeSpan.Zero || now == all);
return r;
}
/// <summary>The four states' colours: Done green, partly done waiting yellow, partly done ready gold, not done grey.</summary>
internal static uint ProgressColor(GuideProgressState s) => s switch
{
GuideProgressState.Done => UiColors.Green,
GuideProgressState.PartialWaiting => UiColors.Yellow,
GuideProgressState.PartialReady => UiColors.Gold,
_ => UiColors.Grey,
};
/// <summary>
/// The redo timer on the stamps held: the longest wait left on any of them (the flag's own timer, else the quest's
/// repeat time since the flag was stamped); zero when every timer is up or none runs.
/// </summary>
private TimeSpan HeldWait(GuideQuest q)
{
TimeSpan wait = TimeSpan.Zero;
foreach (string st in q.AllStamps())
{
if (StampFlag(st) is not QuestFlag f) continue;
TimeSpan left = TimeSpan.Zero;
if (f.RepeatTime > TimeSpan.Zero) left = f.NextAvailableTime(_c.UtcNow);
else if (q.RepeatSec > 0 && f.CompletedOnUtc != DateTime.MinValue) left = f.CompletedOnUtc.AddSeconds(q.RepeatSec) - _c.UtcNow;
if (left > wait) wait = left;
}
return wait;
}
/// <summary>How long until the quest's stamps can be had again (the longest wait on any of them), zero when ready.</summary>
private TimeSpan WikiWait(GuideQuest q)
{
TimeSpan wait = TimeSpan.Zero;
foreach (string st in q.AllStamps())
if (StampFlag(st) is QuestFlag f && f.RepeatTime > TimeSpan.Zero)
{
TimeSpan left = f.NextAvailableTime(_c.UtcNow);
if (left > wait) wait = left;
}
return wait;
}
private Dictionary<string, Quest> _catalogByName = new(StringComparer.OrdinalIgnoreCase);
private int _catalogByNameRev = -1;
/// <summary>The quest list's quest with this name (its display name), or null.</summary>
private Quest? CatalogByName(string name)
{
if (_catalogByNameRev != _c.Catalog.Revision)
{
var map = new Dictionary<string, Quest>(StringComparer.OrdinalIgnoreCase);
foreach (Quest q in _c.Catalog.Quests)
if (!q.IsNew && q.DisplayName.Length > 0) map.TryAdd(q.DisplayName, q);
_catalogByName = map;
_catalogByNameRev = _c.Catalog.Revision;
}
return _catalogByName.TryGetValue(name, out Quest? found) ? found : null;
}
private GuideRow CatalogRow(Quest q)
{
// One flag, so Done or Not done (no partial states, 2026-11-22).
bool done = q.IsComplete(_c.Flags);
var r = new GuideRow { Key = "q:" + q.Flag, Label = q.DisplayName, Q = q };
TimeSpan left = TimeSpan.Zero;
bool repeats = false;
if (done && _c.Flags.TryGet(q.Flag, out QuestFlag f) && f.RepeatTime > TimeSpan.Zero)
{
repeats = true;
left = f.NextAvailableTime(_c.UtcNow);
}
GuideProgressState state = done ? GuideProgressState.Done : GuideProgressState.NotDone;
r.State = state;
(r.Status, r.Tip) = GuideProgress.Text(state, done ? 1 : 0, 0, left, repeats);
if (state == GuideProgressState.Done)
r.Tip = left > TimeSpan.Zero ? $"Fully done: its flag is held. It can be done again in {GuideProgress.Short(left)}."
: repeats ? "Fully done: its flag is held. Its timer is up: it can be done again now." : "Fully done: its flag is held.";
else r.Tip = "Not done: its flag isn't held yet.";
r.Color = ProgressColor(state);
r.Done = done && (!repeats || left > TimeSpan.Zero);
return r;
}
/// <summary>"3d 4h", "5h 12m", "9m".</summary>
internal static string Short(TimeSpan t)
{
if (t.TotalDays >= 1) return $"{(int)t.TotalDays}d {t.Hours}h";
if (t.TotalHours >= 1) return $"{(int)t.TotalHours}h {t.Minutes:00}m";
return $"{Math.Max(1, (int)Math.Ceiling(t.TotalMinutes))}m";
}
/// <summary>"Daily (every 20h 00m)", "Weekly (every 7d 0h)", "One-time", or the wiki's own words.</summary>
internal static string RepeatText(GuideQuest q)
{
if (q.RepeatSec == 0) return q.Repeat.Length > 0 ? "One-time (" + q.Repeat + ")" : "One-time";
if (q.RepeatSec < 0) return "Repeats: " + q.Repeat;
string every = Short(TimeSpan.FromSeconds(q.RepeatSec));
return q.IsDaily ? $"Daily (every {every})" : q.IsWeekly ? $"Weekly (every {every})" : $"Repeats every {every}";
}
// ── The opened wiki quest ───────────────────────────────────────────────
private void DrawWikiQuest(UiWindow w, GuideQuest q)
{
QuestRunner? run = _c.Runner;
bool runningThis = run?.Quest?.Title == q.Title;
w.TextColored(UiColors.Gold, q.Title);
TimeSpan wait = WikiWait(q);
w.TextDisabled(RepeatText(q) + (wait > TimeSpan.Zero ? " - again in " + Short(wait) : ""));
// Where it stands, in the four states (the list's status, said in full; 2026-11-22).
GuideRow state = WikiRow(q);
if (state.Tip.Length > 0) w.TextColored(state.Color, state.Tip);
var facts = new List<string>();
if (q.Level.Length > 0) facts.Add("Level " + q.Level);
if (q.RecommendedLevel.Length > 0) facts.Add("rec. " + q.RecommendedLevel);
if (q.Type.Length > 0) facts.Add(q.Type);
if (q.Qb > 0) facts.Add("QB " + q.Qb.ToString(CultureInfo.InvariantCulture));
if (q.TimeToComplete.Length > 0) facts.Add(q.TimeToComplete);
if (facts.Count > 0) w.TextDisabled(string.Join(" | ", facts));
if (_c.Wiki.IsKillTask(q) || _c.Fandom.Guide.IsKillTask(q)) DrawKillLine(w, q);
// Run this quest / its controls.
if (!runningThis)
{
w.Button("Run this quest", "g.run", () =>
{
_c.Runner?.Start(q, st => StateOf(q, st) == StampState.Done, loot: true, society: Standing());
_gMsg = "";
});
w.Tooltip("RynthNav walks to each step you haven't been stamped for, in order; the step's instructions go to chat\n"
+ "when you get there. A stamp moves it on (or Next). RynthAi picks up the quest's items meanwhile,\n"
+ "with the quest's own loot profile (base-quest-dynamic and its items) until the run ends.\n"
+ "A step without coordinates goes to the people and places it names; there, RynthAi talks to\n"
+ "the person, or hands them the quest's items on a hand-in (\"Return the collar to Xsao\").\n"
+ "Society quests use your Celestial Hand / Eldrytch Web / Radiant Blood membership for NPCs and portals.");
if (q.Loot.Count > 0)
{
w.SameLine();
w.Button($"Loot map ({q.Loot.Count})", "g.loot", () =>
{
int n = _c.Runner?.AddLoot(q) ?? 0;
_gMsg = n > 0 ? $"RynthAi picks up {n} quest item(s) this session: {string.Join(", ", q.Loot)} (/ra questloot list)."
: "RynthAi has them already, or isn't loaded.";
});
w.Tooltip("Have RynthAi pick up this quest's items (by name) on top of its loot profile, this session:\n" + string.Join("\n", q.Loot));
w.SameLine();
w.Button("Loot profile", "g.lootprofile", () =>
{
bool ok = _c.Runner?.BuildProfile(q) ?? false;
_gMsg = ok ? $"RynthAi wrote LootProfiles\\Quests\\{q.Title}.utl: base-quest-dynamic and this quest's {q.Loot.Count} item(s). Run this quest uses it."
: "RynthAi isn't loaded: it writes the loot profile.";
});
w.Tooltip("Write this quest's loot profile: your base-quest-dynamic.utl with a Keep rule per quest item in front\n"
+ "(LootProfiles\\Quests). Run this quest switches to it while it runs, then back. /ro lootprofiles writes every quest's.");
}
}
else
{
w.Button("Stop", "g.stop", () => _c.Runner?.Stop());
w.SameLine();
w.Button("Next", "g.next", () => _c.Runner?.Next());
w.Tooltip("This step is done (or skip it): on to the next place or step.");
w.SameLine();
w.Button("Back", "g.back", () => _c.Runner?.Back());
w.SameLine();
w.Button("Again", "g.again", () => _c.Runner?.Again());
w.Tooltip("Ask RynthNav to go to this step's place again.");
if (run!.Note.Length > 0) w.TextColored(UiColors.Yellow, run.Note);
}
w.SameLine();
w.SmallButton("Wiki page", "g.url", () => _c.Print(q.Url));
w.Tooltip("Prints the wiki page's address in chat.");
DrawHandIn(w, q, "g.w", t => _gMsg = t);
if (q.StartsWith.Length > 0 || q.StartsAt.Length > 0)
{
w.Text("Starts" + (q.StartsWith.Length > 0 ? " with " + q.StartsWith : "") + (q.StartsAt.Length > 0 ? " at " + q.StartsAt : ""));
if (q.StartsAt.Length > 0)
{
w.SameLine();
string place = q.StartsAt;
w.SmallButton("Go", "g.start.go", () => _gMsg = SendRynthNav("go", new[] { place }));
w.Tooltip("RynthNav goes to " + place + " (a place on its Atlas).");
}
}
if (q.KillTask.Length > 0) w.TextDisabled("Kill task: " + q.KillTask);
if (q.Overview.Length > 0) w.TextWrapped(q.Overview);
DrawWikiProgress(w, q);
var (stepDone, implied, next) = StepStates(q);
w.SeparatorText(q.Steps.Count > 0 ? "Steps" : "Steps (the page has no walkthrough)");
for (int i = 0; i < q.Steps.Count; i++) DrawWikiStep(w, q, i, runningThis ? run!.Step : -1, stepDone[i], implied[i], i == next);
if (q.ExtraStamps.Count > 0)
{
w.TextDisabled("Also stamps (the wiki doesn't say which step):");
foreach (string st in q.ExtraStamps) StampLine(w, q, st);
}
if (q.Loot.Count > 0)
{
w.SeparatorText("Loot");
w.TextWrapped(string.Join(", ", q.Loot));
}
if (q.Rewards.Count > 0 && w.CollapsingHeader("Rewards", "g.rewards"))
foreach (string r in q.Rewards)
if (r.EndsWith(':')) w.Text(r); else w.BulletText(r);
}
/// <summary>
/// What the quest stands at, above the steps: how many stamps count now, and each one still to get with
/// its step, so nothing missing has to be hunted for in the list (2026-11-01).
/// </summary>
private void DrawWikiProgress(UiWindow w, GuideQuest q)
{
var missing = new List<string>();
int all = 0, done = 0, earlier = 0;
var stepOf = new Dictionary<string, int>(StringComparer.Ordinal);
for (int i = 0; i < q.Steps.Count; i++)
foreach (string st in q.Steps[i].Stamps) stepOf.TryAdd(GuideStamp.Key(st), i + 1);
foreach (string st in q.AllStamps())
{
all++;
StampState state = StateOf(q, st);
if (state == StampState.Done) { done++; continue; }
if (state == StampState.Earlier) earlier++;
string where = stepOf.TryGetValue(GuideStamp.Key(st), out int n) ? $"step {n}" : "no step";
missing.Add($"{st} ({where}{(state == StampState.Earlier ? ", done before: ready again" : "")})");
}
if (all == 0)
{
w.TextDisabled("The wiki lists no stamps for this quest, so its progress can't be read: the steps are only a guide.");
return;
}
if (missing.Count == 0)
{
w.TextColored(UiColors.Green, $"All {all} stamps done{(q.RepeatSec != 0 ? " this run" : "")}.");
return;
}
w.TextColored(done > 0 ? UiColors.Yellow : UiColors.Grey, $"{done} of {all} stamps done{(q.RepeatSec != 0 ? " this run" : "")}. Still to get:");
foreach (string m in missing) w.TextColored(m.Contains("ready again", StringComparison.Ordinal) ? UiColors.Yellow : UiColors.Red, " - " + m);
if (earlier > 0 && done == 0)
w.TextDisabled(" (A repeatable quest: the stamps from your last run don't count once its timer is up.)");
}
private void DrawWikiStep(UiWindow w, GuideQuest q, int i, int current, bool done, bool implied, bool isNext)
{
GuideStep s = q.Steps[i];
// [x] done, [~] done by the steps after it (no stamp of its own), [>] the next one to do, [ ] still to do.
string mark = done ? "[x]" : implied ? "[~]" : isNext ? "[>]" : "[ ]";
uint color = i == current || (isNext && current < 0) ? UiColors.Yellow : done ? UiColors.Green : implied ? UiColors.Grey : 0;
if (color != 0) w.PushStyleColor(ColText, color);
w.TextWrapped($"{mark} {i + 1}. {s.Text}");
if (color != 0) w.PopStyleColor();
if (implied) w.Tooltip("No stamp of its own; a step after it is done, so the quest went past it.");
else if (isNext) w.Tooltip("The next step to do.");
for (int k = 0; k < s.Coords.Count; k++)
{
string c = s.Coords[k];
if (k > 0) w.SameLine();
w.SmallButton("Go " + c, $"g.s{i}.c{k}", () => _gMsg = SendRynthNav("go", new[] { c }));
w.Tooltip("RynthNav plans the way to " + c + " and walks it.");
}
// A quest of several steps: any step can be the one to do (2026-11-08), not only by Next and Back.
if (q.Steps.Count > 1 && i != current)
{
if (s.Coords.Count > 0) w.SameLine();
int step = i;
bool running = _c.Runner?.Quest?.Title == q.Title;
w.SmallButton(running ? $"Do step {i + 1}" : $"Run from step {i + 1}", $"g.s{i}.from", () =>
{
if (_c.Runner == null) return;
if (_c.Runner.Quest?.Title == q.Title) _c.Runner.GoTo(step);
else _c.Runner.Start(q, st => StateOf(q, st) == StampState.Done, loot: true, fromStep: step, society: Standing());
});
w.Tooltip(running ? "The run goes to this step now (done or not): RynthNav goes to its place, RynthAi does its part there."
: "Run this quest starting at this step (its loot list and loot profile as usual).");
}
foreach (string n in s.Notes)
{
w.PushStyleColor(ColText, UiColors.Grey);
w.TextWrapped(" " + n);
w.PopStyleColor();
}
foreach (string st in s.Stamps) StampLine(w, q, st);
}
private void StampLine(UiWindow w, GuideQuest q, string stamp)
{
switch (StateOf(q, stamp))
{
case StampState.Done:
w.TextColored(UiColors.Green, " [x] You've stamped " + stamp + "!");
break;
case StampState.Earlier:
w.TextColored(UiColors.Yellow, " [ ] " + stamp + " - done on an earlier run; ready again");
break;
default:
w.TextColored(UiColors.Red, " [ ] " + stamp + " - not stamped yet");
break;
}
w.Tooltip(StampWhy(q, stamp));
}
/// <summary>Why a stamp reads the way it does: the flag it matched and its times, or that none did.</summary>
private string StampWhy(GuideQuest q, string stamp)
{
if (_c.SessionStamps.Contains(GuideStamp.Key(stamp))) return "Stamped this session (\"You've stamped " + stamp + "!\").";
if (StampFlag(stamp) is QuestFlag f)
{
string when = f.CompletedOnUtc == DateTime.MinValue ? "" : $", last {f.CompletedOnUtc.ToLocalTime():yyyy-MM-dd HH:mm}";
string timer = f.RepeatTime > TimeSpan.Zero
? (f.NextAvailableTime(_c.UtcNow) > TimeSpan.Zero ? $"; again in {Short(f.NextAvailableTime(_c.UtcNow))}" : "; its timer is up")
: "";
return $"Your quest flag '{f.Key}': {f.Solves} solve(s){when}{timer}.";
}
if (StampHeld(stamp)) return "In your /qb list (the server's quest bonus list): stamped at some time.";
return _c.Flags.LastReadUtc == DateTime.MinValue
? "Your quest flags haven't been read yet (Refresh)."
: $"No quest flag named like '{stamp}' in your /myquests ({_c.Flags.Flags.Count} flags, read {_c.Flags.LastReadUtc.ToLocalTime():HH:mm}).";
}
// ── The opened master-list quest ────────────────────────────────────────
private void DrawGuideCatalogQuest(UiWindow w, Quest q)
{
w.TextColored(UiColors.Gold, q.DisplayName);
w.TextDisabled(q.Flag + (q.Server.Length > 0 ? " (" + q.Server + ")" : ""));
string status = q.Status(_c.Flags, _c.UtcNow);
if (status.Length > 0) w.Text(status);
long rep = CatalogRepeatSec(q);
w.TextDisabled(rep == 0 ? "One-time" : "Repeats every " + Short(TimeSpan.FromSeconds(rep)));
bool tracked = _c.Book.IsTracked(q.Flag);
string flag = q.Flag;
w.Button(tracked ? "Untrack" : "Track", "g.q.track", () => { if (_c.Book.Loaded) _c.Book.ToggleTracked(flag); });
w.Tooltip("List it in the Quest Timers window.");
w.SameLine();
w.SmallButton("Details in chat", "g.q.print", () => _c.PrintQuest(q));
if (q.Info.Length > 0) w.TextWrapped(q.Info);
if (q.Hint.Length > 0) w.TextWrapped(q.Hint);
List<NavTargets.Stop> stops = NavTargets.Stops(q.Info + " - " + q.Hint);
if (stops.Count > 0)
{
w.SeparatorText("Places");
for (int i = 0; i < stops.Count; i++)
{
NavTargets.Stop st = stops[i];
w.SmallButton("Go", "g.q.go." + i, () => _gMsg = SendRynthNav("go", new[] { st.Target }));
w.SameLine();
w.Text(Cut(st.Display, 70));
}
}
if (q.Url.Length > 0) w.SmallButton("Wiki page", "g.q.url", () => _c.Print(q.Url));
DrawHandIn(w, GuideFor(q.Flag, q.Name), "g.q", t => _gMsg = t);
}
// ── The opened Dynamic Stamps area ──────────────────────────────────────
private void DrawStampArea(UiWindow w, string area)
{
w.TextColored(UiColors.Gold, "Dynamic Stamps: " + area);
int i = 0;
bool hide = _c.Settings.GuideHideCollected;
foreach (DynamicStamp s in DynamicStampList.All)
{
if (s.Area != area) continue;
bool have = s.Have(_c.Flags, _c.Ilt.QbStampSet);
int n = i++;
if (hide && have) continue;
w.TextColored(have ? UiColors.Green : UiColors.Grey, have ? "[x]" : "[ ]");
w.SameLine();
w.Text(Cut(s.Label + (s.Place.Length > 0 && s.Place != s.Label ? " - " + s.Place : ""), 70));
string tip = s.Stamp + (s.Reward.Length > 0 ? "\nReward: " + s.Reward : "") + (s.Note.Length > 0 ? "\n" + s.Note : "");
w.Tooltip(tip);
List<string> nav = s.NavCandidates();
if (nav.Count > 0)
{
w.SameLine();
DynamicStamp stamp = s;
// The same Go and hand in as the flag list's Dynamic Stamps (the Parchment, bought when none is carried).
w.SmallButton(s.Npc.Length > 0 ? "Go and hand in" : "Go", "g.a.go." + n, () =>
{
StartDynAuto(stamp);
_gMsg = _dynNavStatus;
});
if (s.Npc.Length > 0) w.Tooltip($"RynthNav goes to {s.Npc}; a Parchment from your packs is handed over there (bought from a vendor when you carry none).");
}
}
// Go and hand in's progress (the buy, the walk, the give), as the flag list's stamp box shows it.
if (_dynAuto != null && _dynAuto.Area == area && _dynNavStatus.Length > 0) w.TextColored(UiColors.Yellow, _dynNavStatus);
}
}

View file

@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
// One hand-in for every view under Quests (2026-11-11, Silentkelpie: "make sure all tabs under quests support the
// same function to hand the quest item in after quest completion step"). The wiki guide's quests (All, Story,
// Dailies, Weekly, QB, ILT Wiki), the master list's quests in the guide and the flag list, and the Legendary
// rows all get "Go and hand in": the quest run from its hand-in step (RynthNav to the person, then RynthAi's
// "questloot handin" of the quest's items there, through the give queue), and "Hand in here" when you're
// standing by them. A quest whose wiki page has no hand-in step but whose rewards are for handing something in
// ("For Hand in Female Tusker Tusk:") hands it to the person it starts with. The Dynamic Stamps (the flag list
// and the guide's Stamps tab) use Go and hand in's Parchment (DynamicStampsTab.cs); the Temple guardians,
// RynthILT's hand-in; the markers have nothing to hand in.
internal sealed partial class OracleView
{
/// <summary>The wiki quest a master-list quest or a Legendary row is: one of its stamps is the flag, or the same title.</summary>
private GuideQuest? GuideFor(string flag, params string[] titles)
{
List<GuideQuest> quests = _c.Wiki.Quests;
if (quests.Count == 0) return null;
string key = flag.Length > 0 ? GuideStamp.Key(flag) : "";
if (key.Length > 0)
foreach (GuideQuest q in quests)
foreach (string st in q.AllStamps())
if (GuideStamp.Key(st) == key) return q;
foreach (string t in titles)
if (t.Length > 0 && _c.FindWiki(t) is GuideQuest byTitle) return byTitle;
return null;
}
/// <summary>
/// What hands the quest in: the quest itself and its last hand-in step, or a one-step quest made from its
/// rewards' items and the person it starts with. Null when neither is known. Internal for the tests.
/// </summary>
internal static (GuideQuest Quest, int Step)? HandInOf(GuideQuest q)
{
for (int i = q.Steps.Count - 1; i >= 0; i--)
if (QuestNames.IsHandIn(q.Steps[i])) return (q, i);
List<string> items = QuestNames.RewardItems(q);
foreach (string it in q.Loot)
if (!items.Exists(x => x.Equals(it, StringComparison.OrdinalIgnoreCase))) items.Add(it);
string who = q.StartsWith.Trim();
if (items.Count == 0 || who.Length == 0) return null;
var hand = new GuideQuest { Title = q.Title, Url = q.Url, StartsWith = q.StartsWith, StartsAt = q.StartsAt };
hand.Loot.AddRange(items);
hand.Steps.Add(new GuideStep { Text = $"Return to {who} and hand in the {string.Join(", ", items)}." });
return (hand, 0);
}
/// <summary>"Go and hand in" and "Hand in here" for <paramref name="q"/> (nothing known: says so). <paramref name="id"/> keeps the ids apart.</summary>
private void DrawHandIn(UiWindow w, GuideQuest? q, string id, Action<string> say)
{
if (q == null)
{
w.TextDisabled("Hand-in: no wiki guide for this quest, so who takes the items isn't known.");
return;
}
if (HandInOf(q) is not { } h)
{
w.TextDisabled("Hand-in: the wiki's steps don't hand anything in.");
return;
}
List<string> who = QuestNames.TargetsAt(h.Quest, h.Step);
List<string> items = QuestNames.HandInItems(h.Quest, h.Step);
string whoText = who.Count > 0 ? string.Join(" or ", who) : "the person of the step before";
string itemText = items.Count > 0 ? string.Join(", ", items) : "the quest's items";
QuestRunner? run = _c.Runner;
bool runningThis = run?.Quest is GuideQuest rq && rq.Title == h.Quest.Title && rq.Steps.Count == h.Quest.Steps.Count;
w.Button("Go and hand in", id + ".handin.go", () =>
{
if (_c.Runner == null) { say("The quest run isn't ready."); return; }
if (!_c.InWorld) { say("Log in first."); return; }
if (runningThis) _c.Runner.GoTo(h.Step);
else _c.Runner.Start(h.Quest, st => StateOf(h.Quest, st) == StampState.Done, loot: false, fromStep: h.Step, society: Standing());
say($"Handing {itemText} to {whoText}: RynthNav goes there, RynthAi gives them over (step {h.Step + 1}).");
});
w.Tooltip($"Step {h.Step + 1}: {h.Quest.Steps[h.Step].Text}\nRynthNav goes to {whoText} (outdoors, a dungeon or the Bur), then RynthAi hands over:\n{itemText}");
w.SameLine();
w.Button("Hand in here", id + ".handin.here", () =>
{
if (who.Count == 0) { say("The step doesn't name who takes them: use Go and hand in."); return; }
string line = "handin " + string.Join(" || ", who) + (items.Count > 0 ? " | " + string.Join(" | ", items.ConvertAll(i => i.Replace('|', '/'))) : "");
say(_c.SendAi("questloot", line) ? $"RynthAi hands {itemText} to {whoText} near you." : "RynthAi isn't loaded (it does the give).");
});
w.Tooltip($"You're standing by them: RynthAi gives {itemText} to {whoText} (within 60 m).");
}
}

View file

@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
// The quest offer (2026-11-08): an NPC who starts quests in the wiki guide talks to the character, and a small
// window asks whether to run one (QuestOffers). Not for a quest being run, a one-time quest already done, one
// still on its timer, or one turned down this session ("Not now"); the same NPC is asked about once in
// OfferRepeatMs.
internal sealed partial class OracleView
{
private const long OfferRepeatMs = 10 * 60 * 1000;
private readonly Dictionary<string, long> _offeredAt = new(StringComparer.OrdinalIgnoreCase);
private readonly HashSet<string> _offerDeclined = new(StringComparer.OrdinalIgnoreCase);
private readonly List<GuideQuest> _offer = new();
private string _offerNpc = "", _offerText = "";
/// <summary>Asks the plugin to show or hide the offer window, and to open the main window.</summary>
public Action<bool>? SetOfferWindow;
public Action? ShowMainWindow;
/// <summary>
/// An NPC's line: when it starts quests the character can do now, they are offered (true: show the window).
/// </summary>
internal bool OfferFor(string npc, string text, long now)
{
if (_offeredAt.TryGetValue(npc, out long at) && now - at < OfferRepeatMs) return false;
var list = new List<GuideQuest>();
foreach (GuideQuest q in QuestOffers.StartedBy(_c.Wiki.Quests, npc, text))
{
if (_c.Runner?.Quest?.Title == q.Title || _offerDeclined.Contains(q.Title)) continue;
if (WikiWait(q) > TimeSpan.Zero) continue; // on its timer
var stamps = new List<string>(q.AllStamps());
if (q.RepeatSec == 0 && stamps.Count > 0 && stamps.TrueForAll(st => StateOf(q, st) == StampState.Done)) continue; // one-time, done
list.Add(q);
if (list.Count >= QuestOffers.MaxQuests) break;
}
if (list.Count == 0) return false;
_offeredAt[npc] = now;
_offer.Clear();
_offer.AddRange(list);
_offerNpc = npc;
_offerText = text;
_c.Print($"{npc} starts {string.Join(", ", list.ConvertAll(q => q.Title))}: the quest offer window asks whether to run it.");
return true;
}
internal IReadOnlyList<GuideQuest> Offered => _offer;
public void DrawOffer(UiWindow w)
{
if (_offer.Count == 0)
{
w.TextDisabled("No quest offered.");
return;
}
w.TextColored(UiColors.Gold, _offer.Count == 1 ? $"{_offerNpc} starts a quest" : $"{_offerNpc} starts {_offer.Count} quests");
if (_offerText.Length > 0) w.TextWrapped("\"" + Cut(_offerText, 160) + "\"");
w.Separator();
for (int i = 0; i < _offer.Count; i++)
{
GuideQuest q = _offer[i];
w.TextColored(UiColors.Yellow, q.Title);
var facts = new List<string> { RepeatText(q) };
if (q.Level.Length > 0) facts.Add("Level " + q.Level);
if (q.Steps.Count > 0) facts.Add($"{q.Steps.Count} step(s)");
w.TextDisabled(string.Join(" | ", facts));
w.Button("Run this quest", $"offer.run.{i}", () =>
{
_c.Runner?.Start(q, st => StateOf(q, st) == StampState.Done, loot: true, society: Standing());
CloseOffer();
});
w.Tooltip("Yes: Run this quest (RynthNav walks its steps, RynthAi talks, loots and picks up its items).");
w.SameLine();
w.Button("Show", $"offer.show.{i}", () =>
{
ShowGuide(GuideTab.Wiki, "w:" + q.Title);
ShowMainWindow?.Invoke();
});
w.Tooltip("Open it in the quest guide (its steps), without running it.");
}
w.Separator();
w.Button("Not now", "offer.no", () =>
{
foreach (GuideQuest q in _offer) _offerDeclined.Add(q.Title);
CloseOffer();
});
w.Tooltip("No: not asked about these quests again this session.");
}
private void CloseOffer()
{
_offer.Clear();
SetOfferWindow?.Invoke(false);
}
}

View file

@ -4,6 +4,9 @@
// Stamps tabs and RynthILT's Temple guardians merged in as tracker rows (SilentKelpie's PR 12,
// RynthOracle 0.6.0, ported by hand onto this lineage). The Dynamic Stamps, the Temple guardians and the
// /qb list are one server's (Infinite Leaftide's) and moved to that server's plugin, RynthILT, on 2026-10-21.
// The Dynamic Stamps and Temple guardian rows came back on 2026-10-25, shown only while RynthCore's
// active server is Infinite Leaftide (ServerIdentity.IsIlt); the data still comes from RynthILT.
// The list's columns follow the window's width (QuestColumns).
using System;
using System.Collections.Generic;
using RynthCore.Plugin.RynthOracle.Data;
@ -14,9 +17,10 @@ namespace RynthCore.Plugin.RynthOracle.Views;
/// <summary>
/// What a row of the merged Quests list is. Every kind but Quest is a tracker: the Legendary Key
/// quests and the exploration markers (retail, every server).
/// quests and the exploration markers (retail, every server), and the Dynamic Stamps and the
/// Temple guardians (Infinite Leaftide only).
/// </summary>
internal enum QuestKind { Quest, Legendary, Marker }
internal enum QuestKind { Quest, Legendary, Marker, Dynamic, Guardian }
/// <summary>
/// Quests: every flag the character holds, cross-referenced with the master quest list (and the
@ -33,7 +37,9 @@ internal sealed partial class OracleView
private const float QuestListHeightWithPanel = 300f;
private static readonly string[] QuestSorts = { "Flag", "Name", "Done first", "Not done first", "Ready soonest", "Most solves" };
/// <summary>The kinds' names in <see cref="QuestKind"/> order (the Show filter).</summary>
private static readonly string[] KindNames = { "Quests", "Legendary", "Markers" };
private static readonly string[] KindNames = { "Quests", "Legendary", "Markers", "Dynamic Stamps", "Guardians" };
/// <summary>The guardians' last answer is offered for this long (RynthILT's Mini Remote line does the same).</summary>
private const long GuardianAnswerShownSec = 600;
// The reward editor's fields, in QuestReward order (two percentages, then counts).
private static readonly string[] RewardLabels =
@ -47,6 +53,9 @@ internal sealed partial class OracleView
private QuestKind? _qKind;
private int _questSort;
private int _questPage;
private int _dynArea; // 0 = all areas, else DynamicStampList.Areas[n - 1] (Show: Dynamic Stamps)
// The list's column layout for the window's width (from the engine's Geometry events).
private QuestColumns _cols = QuestColumns.For(0f);
private readonly List<QuestRow> _questRows = new();
private string _questKey = "";
@ -74,18 +83,32 @@ internal sealed partial class OracleView
public Quest? Q;
public LegendaryQuest? L;
public Marker? M;
public DynamicStamp? D;
public IltGuardianRow? G;
}
/// <summary>The kinds the list shows: quests, Legendary quests and markers, on every server. Internal for the tests.</summary>
internal List<QuestKind> AvailableKinds() => new() { QuestKind.Quest, QuestKind.Legendary, QuestKind.Marker };
/// <summary>
/// The kinds the list shows: quests, Legendary quests and markers on every server; Dynamic Stamps
/// and the Temple guardians only while the active server is Infinite Leaftide. Internal for the tests.
/// </summary>
internal List<QuestKind> AvailableKinds()
{
var kinds = new List<QuestKind> { QuestKind.Quest, QuestKind.Legendary, QuestKind.Marker };
if (_c.Server.IsIlt)
{
kinds.Add(QuestKind.Dynamic);
kinds.Add(QuestKind.Guardian);
}
return kinds;
}
/// <summary>A kind is listed: this server has it, the Show filter allows it, and Trackers only doesn't hide it.</summary>
private bool KindListed(QuestKind k, List<QuestKind> kinds)
=> kinds.Contains(k) && (_qKind == null || _qKind == k) && !(_qTrackers && k == QuestKind.Quest);
/// <summary>
/// Opens the Quests tab on the trackers: one kind (/ro legendary, /ro markers) or all of them
/// (null). The old tabs' commands land here.
/// Opens the Quests tab on the trackers: one kind (/ro legendary, /ro markers, and on Infinite
/// Leaftide /ro dynamic, /ro guardians) or all of them (null). The old tabs' commands land here.
/// </summary>
public void ShowTrackers(QuestKind? kind)
{
@ -97,7 +120,18 @@ internal sealed partial class OracleView
private void DrawQuests(UiWindow w)
{
// The guide (2026-11-01, QuestGuideTab.cs): two panes, the quests and the opened one's steps; or this flag list.
DrawQuestViewSwitch(w);
if (_c.Settings.QuestGuideView)
{
w.SameLine();
DrawQuestFlagStatus(w);
DrawGuide(w);
return;
}
QuestFlagStore flags = _c.Flags;
_cols = QuestColumns.For(w.ContentWidth);
if (_c.Server.IsIlt) RefreshAfterHandIn(flags);
if (flags.ServerDisabled)
w.TextColored(UiColors.Red, "This server has /myquests turned off, so quest flags can't be read.");
else if (flags.Loading)
@ -122,11 +156,14 @@ internal sealed partial class OracleView
// A Show filter left on a kind the list doesn't have: all kinds.
List<QuestKind> kinds = AvailableKinds();
if (_qKind is QuestKind chosen && !kinds.Contains(chosen)) _qKind = null;
bool ilt = kinds.Contains(QuestKind.Dynamic);
w.InputText("Search", "q.search", _questSearch, 64, s => { _questSearch = s; _questPage = 0; });
w.Tooltip("Words to find in a row: a quest's flag or name; a tracker's place, area or notes.");
w.Tooltip(ilt ? "Words to find in a row: a quest's flag or name; a tracker's NPC, place, area, reward or notes."
: "Words to find in a row: a quest's flag or name; a tracker's place, area or notes.");
w.Checkbox("Done", "q.done", _qDone, v => { _qDone = v; _questPage = 0; });
w.Tooltip("Done quests; Legendary quests you have, markers found.");
w.Tooltip(ilt ? "Done quests; Legendary quests and stamps you have, markers found, guardians on cooldown."
: "Done quests; Legendary quests you have, markers found.");
w.SameLine();
w.Checkbox("Not done", "q.notdone", _qNotDone, v => { _qNotDone = v; _questPage = 0; });
w.SameLine();
@ -154,7 +191,8 @@ internal sealed partial class OracleView
if (v && _qKind == QuestKind.Quest) _qKind = null;
_questPage = 0;
});
w.Tooltip("Only the trackers, with their status above the list: Legendary Key quests and exploration markers.");
w.Tooltip(ilt ? "Only the trackers, with their status above the list: Legendary Key quests, exploration markers, Dynamic Stamps and the Temple guardians."
: "Only the trackers, with their status above the list: Legendary Key quests and exploration markers.");
w.SameLine();
var kindItems = new List<string>(kinds.Count + 1) { "Everything" };
foreach (QuestKind k in kinds) kindItems.Add(KindNames[(int)k]);
@ -166,6 +204,13 @@ internal sealed partial class OracleView
_questPage = 0;
});
w.Tooltip("One kind of row, or everything.");
if (_qKind == QuestKind.Dynamic)
{
w.SameLine();
var areaItems = new List<string>(DynamicStampList.Areas.Count + 1) { "All areas" };
areaItems.AddRange(DynamicStampList.Areas);
w.Combo("##dyarea", "dy.area", Math.Clamp(_dynArea, 0, areaItems.Count - 1), areaItems, v => { _dynArea = v; _questPage = 0; });
}
w.Combo("Sort", "q.sort", _questSort, QuestSorts, i => { _questSort = Math.Clamp(i, 0, QuestSorts.Length - 1); _questPage = 0; });
if (_qTrackers || _qKind is QuestKind k2 && k2 != QuestKind.Quest) DrawTrackerSummary(w, kinds);
@ -179,19 +224,21 @@ internal sealed partial class OracleView
bool selected = HasSelection();
w.BeginChild("q.list", 0f, selected ? QuestListHeightWithPanel : 0f, border: true);
w.TextDisabled("*");
w.Tooltip("Track: list the quest in the Quest Timers window. Trackers show their kind here instead (LEG, MRK).");
w.SameLine(28f);
w.Tooltip("Track: list the quest in the Quest Timers window. Trackers show their kind here instead (LEG, MRK"
+ (ilt ? ", DYN, GRD)." : ")."));
QuestColumns c = _cols;
w.SameLine(c.Done);
w.TextDisabled("Done");
w.SameLine(72f);
w.SameLine(c.Label);
w.TextDisabled("Quest");
w.SameLine(370f);
w.SameLine(c.Ready);
w.TextDisabled("Ready in");
w.SameLine(470f);
w.SameLine(c.Solves);
w.TextDisabled("Solves");
w.SameLine(530f);
w.SameLine(c.Extra);
w.TextDisabled("Rewards");
w.Tooltip("What you recorded for a quest (click it to edit): %XP, %Lum, Coins, Trinkets, Medallions, Yellow/Red/Blue powder, MMDs (D), at Level.\n"
+ "Trackers: a Legendary quest's luminance, a marker's location.");
+ "Trackers: a Legendary quest's luminance, a marker's location" + (ilt ? ", a stamp's area, a guardian's next turn-in." : "."));
DateTime now = _c.UtcNow;
bool canTrack = _c.Book.Loaded;
@ -205,6 +252,16 @@ internal sealed partial class OracleView
if (selected) DrawSelection(w);
}
/// <summary>The flags' state in one short line (the guide view's top row).</summary>
private void DrawQuestFlagStatus(UiWindow w)
{
QuestFlagStore flags = _c.Flags;
if (flags.ServerDisabled) w.TextColored(UiColors.Red, "/myquests is off on this server: no quest flags.");
else if (flags.Loading) w.TextColored(UiColors.Yellow, "Reading your quest flags...");
else if (flags.LastReadUtc == DateTime.MinValue) w.TextDisabled("Quest flags not read yet (Refresh).");
else w.TextDisabled($"{flags.Flags.Count} flags, read {flags.LastReadUtc.ToLocalTime():HH:mm}");
}
/// <summary>One list row: a quest (track, done, timer, solves, rewards) or a tracker (kind, status, its own columns).</summary>
private void DrawQuestRow(UiWindow w, QuestRow r, QuestFlagStore flags, DateTime now, bool canTrack)
{
@ -213,36 +270,45 @@ internal sealed partial class OracleView
Quest q = r.Q!;
string flag = q.Flag;
bool tracked = _c.Book.IsTracked(flag);
QuestColumns c = _cols;
w.ToggleButton("*", "q.t." + flag, tracked, () => { if (canTrack) _c.Book.ToggleTracked(flag); }, small: true);
w.SameLine(28f);
w.SameLine(c.Done);
DoneMark(w, r.Done);
w.SameLine(72f);
w.Selectable(Cut(q.Label, 44), "q.r." + flag, IsSelected(r), () => SelectRow(r), 290f);
w.Tooltip(flag + "\nClick: opens it below and prints its texts in chat.");
w.SameLine(370f);
w.SameLine(c.Label);
w.Selectable(Cut(q.Label, c.LabelChars), "q.r." + flag, IsSelected(r), () => SelectRow(r), c.LabelWidth);
w.Tooltip(q.Label.Length > c.LabelChars ? q.Label + "\n" + flag + "\nClick: opens it below and prints its texts in chat."
: flag + "\nClick: opens it below and prints its texts in chat.");
w.SameLine(c.Ready);
TimerText(w, q, flags, now, r.Done);
string solves = q.SolvesText(flags);
if (solves.Length > 0)
{
w.SameLine(470f);
w.SameLine(c.Solves);
w.Text(solves);
}
string reward = _c.Book.RewardText(flag);
if (reward.Length > 0)
{
w.SameLine(530f);
w.Text(Cut(reward, 18));
if (reward.Length > 18) w.Tooltip(reward);
w.SameLine(c.Extra);
w.Text(Cut(reward, c.ExtraChars));
if (reward.Length > c.ExtraChars) w.Tooltip(reward);
}
return;
}
// A tracker: its kind tag where the * is, then its mark, label and columns.
w.TextColored(UiColors.Gold, r.Kind == QuestKind.Legendary ? "LEG" : "MRK");
w.SameLine(28f);
QuestColumns col = _cols;
w.TextColored(UiColors.Gold, r.Kind switch
{
QuestKind.Legendary => "LEG",
QuestKind.Marker => "MRK",
QuestKind.Dynamic => "DYN",
_ => "GRD",
});
w.SameLine(col.Done);
TrackerMark(w, r);
w.SameLine(72f);
w.Selectable(Cut(r.Label, 44), "q.r." + r.Key, IsSelected(r), () => SelectRow(r), 290f);
w.SameLine(col.Label);
w.Selectable(Cut(r.Label, col.LabelChars), "q.r." + r.Key, IsSelected(r), () => SelectRow(r), col.LabelWidth);
string tip = TrackerTooltip(r);
if (tip.Length > 0) w.Tooltip(Cut(tip, 300));
switch (r.Kind)
@ -251,33 +317,58 @@ internal sealed partial class OracleView
{
LegendaryQuest l = r.L!;
TimeSpan? left = l.TimeLeft(flags, now);
w.SameLine(370f);
w.SameLine(col.Ready);
if (left == null) w.TextColored(UiColors.Grey, "not done");
else if (left.Value <= TimeSpan.Zero) w.TextColored(UiColors.Green, "ready");
else w.TextColored(UiColors.Yellow, TimeText.Friendly(left.Value));
if (l.Luminance > 0)
{
w.SameLine(530f);
w.SameLine(col.Extra);
w.TextDisabled(TimeText.Number(l.Luminance) + " lum");
}
break;
}
case QuestKind.Guardian:
{
IltGuardianRow g = r.G!;
w.SameLine(col.Ready);
w.TextColored(g.Ready ? UiColors.Green : g.Status == "Unknown" ? UiColors.Grey : UiColors.Yellow, Cut(g.Status, col.ReadyChars));
w.SameLine(col.Solves);
w.Text("#" + g.Count);
if (g.Eta.Length > 0)
{
w.SameLine(col.Extra);
w.TextDisabled(Cut(g.Eta, col.ExtraChars));
}
break;
}
default:
// Markers: where they are.
// Markers and stamps: where they are.
if (r.Group.Length > 0)
{
w.SameLine(530f);
w.TextDisabled(Cut(r.Group, 18));
w.SameLine(col.Extra);
w.TextDisabled(Cut(r.Group, col.ExtraChars));
}
break;
}
}
/// <summary>A tracker's done column: have / need (Legendary) or found / -- (markers).</summary>
/// <summary>A tracker's done column: have / need, found / --, or a guardian's ready / wait.</summary>
private static void TrackerMark(UiWindow w, QuestRow r)
{
if (r.Kind == QuestKind.Marker) DoneMark(w, r.Done);
else w.TextColored(r.Done ? UiColors.Green : UiColors.Red, r.Done ? "have" : "need");
switch (r.Kind)
{
case QuestKind.Marker:
DoneMark(w, r.Done);
break;
case QuestKind.Guardian:
// Done = turned in and on cooldown; not done = a turn-in is ready (or unknown).
w.TextColored(r.Done ? UiColors.Yellow : UiColors.Green, r.Done ? "wait" : "ready");
break;
default:
w.TextColored(r.Done ? UiColors.Green : UiColors.Red, r.Done ? "have" : "need");
break;
}
}
/// <summary>A tracker row's hover text: its notes or hint.</summary>
@ -285,9 +376,19 @@ internal sealed partial class OracleView
{
QuestKind.Legendary => r.L!.Note.Length > 0 ? $"{r.Group}: {r.L.Note}" : r.Group,
QuestKind.Marker => r.M!.Hint,
QuestKind.Dynamic => string.Join(" - ", Parts(r.D!.Area, r.D.Place, r.D.Reward.Length > 0 ? "gives " + r.D.Reward : "", r.D.Note)),
QuestKind.Guardian => $"{r.G!.Npc}: {(r.G.Exact ? "from /myquests (exact)" : "from /qb wait stamps (count and timer are estimates)")}",
_ => "",
};
/// <summary>The non-empty strings, in order.</summary>
private static List<string> Parts(params string[] items)
{
var list = new List<string>(items.Length);
foreach (string s in items) if (!string.IsNullOrWhiteSpace(s)) list.Add(s);
return list;
}
/// <summary>The timer column: "ready" (green once done), a countdown, "N left" (yellow) or done (grey).</summary>
private static void TimerText(UiWindow w, Quest q, QuestFlagStore flags, DateTime now, bool done)
{
@ -305,7 +406,8 @@ internal sealed partial class OracleView
/// <summary>
/// The trackers' status (what each old tab showed at its top), for the kinds the Show filter
/// lists: John's Legendary counter, and the markers found and the next one.
/// lists: John's Legendary counter, the markers found and the next one, and on Infinite Leaftide
/// the stamps had and the Temple guardians' switches, last answer and hand-in.
/// </summary>
private void DrawTrackerSummary(UiWindow w, List<QuestKind> kinds)
{
@ -353,6 +455,100 @@ internal sealed partial class OracleView
w.Tooltip("Opens it below the list (directions, RynthNav) and prints the directions in chat.");
}
}
if (Shows(QuestKind.Dynamic))
{
List<DynamicStamp> all = DynamicStampList.All;
IReadOnlySet<string> qbStamps = _c.Ilt.QbStampSet;
int have = 0;
foreach (DynamicStamp s in all) if (s.Have(flags, qbStamps)) have++;
int unlisted = DynamicStampList.Unlisted(flags, qbStamps).Count;
w.ProgressBar(all.Count == 0 ? 0f : (float)have / all.Count, -1f, 0f,
$"{have} / {all.Count} listed Dynamic stamps" + (unlisted > 0 ? $" (+{unlisted} not in the list)" : ""));
w.Tooltip("Dynamic stamps are one-time quest flags (Dynamic_1_...) from handing items to NPCs on Infinite Leaftide.\n"
+ "Done: in /myquests, or in the /qb list (/myquests leaves out flags the server has no quest text for).\n"
+ (DynamicStampList.Source == "wiki" ? "List: the wiki's Dynamic Stamps page (RynthILT reads it)." : "List: the players' ExtraDyn sheet (the wiki's page once RynthILT has read it).")
+ " Click a stamp for RynthNav's route to it and the Parchment hand-in."
+ (unlisted > 0 ? "\nStamps not in the sheet show as quests with Not in list." : ""));
DrawStampQbSource(w);
}
if (Shows(QuestKind.Guardian)) DrawGuardianControls(w);
}
// The /qb list was asked for this session on the stamps' behalf (once: the server allows one a minute).
private bool _qbAskedForStamps;
/// <summary>
/// Under the Dynamic stamps bar: whether the /qb list is in, which can mark stamps done that
/// /myquests leaves out. Asks RynthILT for it once per session while it hasn't been read, and
/// offers a button to read it again.
/// </summary>
private void DrawStampQbSource(UiWindow w)
{
if (!_c.InWorld) { _qbAskedForStamps = false; return; }
IltQuestBonusList? qb = _c.Ilt.QuestBonus;
if (qb == null || qb.Disabled) return; // no RynthILT, or /qb is off on this server
bool loaded = qb.Generation > 0;
if (!loaded && !_qbAskedForStamps)
{
_qbAskedForStamps = true;
_c.Send("/ilt qb");
}
w.TextDisabled(loaded
? $"Also counted from the /qb list ({TimeText.Number(_c.Ilt.QbStampSet.Count)} Dynamic flag(s) in it)."
: "Reading the /qb list for stamps /myquests leaves out...");
w.SameLine();
w.SmallButton("Read /qb", "dy.qb", () => { if (!_c.Send("/ilt qb")) _c.Print("Log in first."); });
w.Tooltip("RynthILT reads your quest bonus list (/qb list; the server allows once a minute).");
}
/// <summary>
/// The Temple guardians' controls (RynthILT's Guardian window): chat detection, auto hand-in and
/// buy-if-missing, which run inside RynthILT; the last answer with Hand in / Stop; and a refresh.
/// </summary>
private void DrawGuardianControls(UiWindow w)
{
IltGuardianView g = _c.Guardian;
if (!g.Loaded)
{
w.TextDisabled(_c.IltData.Connected
? "Temple guardians: this RynthILT is older than 0.2.20 (no guardian data for Oracle)."
: "Temple guardians: RynthILT isn't loaded (it runs the riddles, hand-ins and turn-in tracker).");
return;
}
int ready = 0;
foreach (IltGuardianRow r in g.Rows) if (r.Ready) ready++;
w.TextColored(UiColors.Gold, "Temple guardians");
w.SameLine();
w.TextDisabled($"{ready} of {g.Rows.Count} attribute turn-ins ready"
+ (g.SyncedUtc == DateTime.MinValue ? ", /qb not read this session" : $", /qb read {g.SyncedUtc.ToLocalTime():HH:mm}"));
w.SameLine();
w.SmallButton("Refresh", "gd.refresh", () => _c.GuardianCommand(IltGuardianView.RefreshVerb()));
w.Tooltip("RynthILT re-reads /myquests and /qb list for the turn-ins (the server allows each once a minute).");
w.Checkbox("Detect from chat", "gd.chat", g.Chat, v => _c.GuardianCommand(IltGuardianView.SwitchVerb("chat", v)));
w.Tooltip("Translate the guardians' tells as they arrive and show the answer here.");
w.SameLine();
w.Checkbox("Auto hand-in", "gd.auto", g.Auto, v => _c.GuardianCommand(IltGuardianView.SwitchVerb("auto", v)));
w.Tooltip("After a chat answer, RynthILT gives one of the item to the guardian automatically.");
w.SameLine();
w.Checkbox("Buy if missing", "gd.buy", g.Buy, v => _c.GuardianCommand(IltGuardianView.SwitchVerb("buy", v)));
w.Tooltip("Temple guardian: when you carry none, RynthILT buys one from the open or nearest vendor first.");
bool recent = g.Answer.Length > 0 && g.AnswerAgeSec >= 0 && g.AnswerAgeSec < GuardianAnswerShownSec;
if (recent || g.Running)
{
w.TextColored(UiColors.Green, g.Answer);
if (g.Heard.Length > 0) w.Tooltip("Heard: " + Cut(g.Heard, 300));
w.SameLine();
w.TextDisabled("-> " + g.Npc);
w.SameLine();
if (g.Running) w.SmallButton("Stop", "gd.stop", () => _c.GuardianCommand(IltGuardianView.StopVerb()));
else w.SmallButton("Hand in", "gd.handin", () => _c.GuardianCommand(IltGuardianView.HandInVerb()));
}
else w.TextDisabled("No guardian answer yet.");
w.TextDisabled("Hand-in: " + g.Status + (_c.GuardianMessage.Length > 0 ? " - " + _c.GuardianMessage : ""));
}
// ── The opened row ──────────────────────────────────────────────────────
@ -361,12 +557,14 @@ internal sealed partial class OracleView
private bool HasSelection() => _selKind switch
{
QuestKind.Quest => _questSel.Length > 0,
QuestKind.Dynamic => _dynNav != null,
_ => _selKey.Length > 0,
};
private bool IsSelected(QuestRow r) => r.Kind switch
{
QuestKind.Quest => _selKind == QuestKind.Quest && r.Q!.Flag == _questSel,
QuestKind.Dynamic => _selKind == QuestKind.Dynamic && ReferenceEquals(r.D, _dynNav),
_ => _selKind == r.Kind && _selKey == r.Key,
};
@ -383,6 +581,7 @@ internal sealed partial class OracleView
bool same = IsSelected(r);
_questSel = "";
_selKey = "";
_dynNav = null;
_questStopIdx = 0;
_questNavStatus = "";
if (same) return;
@ -392,6 +591,11 @@ internal sealed partial class OracleView
case QuestKind.Quest:
OpenQuest(r.Q!);
break;
case QuestKind.Dynamic:
// A stamp also asks RynthNav for the route at once, as its tab did.
_selKey = r.Key;
SelectDynamicStamp(r.D!, r.Done);
break;
default:
_selKey = r.Key;
break;
@ -406,7 +610,7 @@ internal sealed partial class OracleView
LoadRewardEdit(q.Flag);
}
/// <summary>The opened row's panel: a quest, a Legendary quest or a marker.</summary>
/// <summary>The opened row's panel: a quest, a Dynamic Stamp's nav box, a Legendary quest, a marker or a guardian.</summary>
private void DrawSelection(UiWindow w)
{
switch (_selKind)
@ -422,9 +626,44 @@ internal sealed partial class OracleView
Marker? m = MarkerList.All.Find(x => "mk:" + x.Number == _selKey);
if (m != null) DrawSelectedMarker(w, m);
break;
case QuestKind.Dynamic:
DrawDynamicNavBox(w);
break;
case QuestKind.Guardian:
IltGuardianRow? g = null;
foreach (IltGuardianRow r in _c.Guardian.Rows)
if ("gd:" + r.Attribute == _selKey) { g = r; break; }
DrawSelectedGuardian(w, g);
break;
}
}
private void DrawSelectedGuardian(UiWindow w, IltGuardianRow? g)
{
if (g != null)
{
w.SeparatorText("Temple guardian: " + g.Attribute);
w.TextDisabled("NPC");
w.SameLine(90f);
w.Text(g.Npc);
w.TextDisabled("Turn-ins");
w.SameLine(90f);
w.Text(g.Count.ToString());
w.TextDisabled("Status");
w.SameLine(90f);
w.TextColored(g.Ready ? UiColors.Green : g.Status == "Unknown" ? UiColors.Grey : UiColors.Yellow, g.Status);
if (g.Eta.Length > 0)
{
w.SameLine(260f);
w.TextDisabled("Next: " + g.Eta);
}
w.TextDisabled(g.Exact ? "From /myquests (exact)." : $"From /qb wait stamps: the count and timer are estimates (cooldown taken as {_c.Guardian.CooldownHours} h).");
}
else w.SeparatorText("Temple guardians");
DrawGuardianControls(w);
w.Button("Close", "gd.sel.close", () => _selKey = "");
}
private void DrawSelectedLegendary(UiWindow w, LegendaryQuest l)
{
QuestFlagStore flags = _c.Flags;
@ -446,6 +685,7 @@ internal sealed partial class OracleView
}
if (l.Note.Length > 0) w.TextWrapped(Cut(l.Note, 600));
DrawGoTo(w, StopsFor("lg:" + l.Name, () => NavTargets.Stops(l.Note)));
DrawHandIn(w, GuideFor(l.Flags.Length > 0 ? l.Flags[0] : "", l.Name, l.CommonName), "lg.sel", t => _questNavStatus = t);
w.Button("Print in chat", "lg.sel.print", () => PrintLegendary(l, status));
w.Tooltip("The quest, its flags and status, the notes, wiki and video links.");
w.SameLine();
@ -575,6 +815,8 @@ internal sealed partial class OracleView
string details = q.Details();
if (details.Length > 0) w.TextWrapped(Cut(details, 600));
DrawGoTo(w, StopsFor("q:" + q.Flag, () => NavTargets.Stops(q.Info + " - " + q.Hint)));
DrawHandIn(w, GuideFor(q.Flag, q.Name), "q.sel", t => _questNavStatus = t);
if (_questNavStatus.Length > 0 && NavTargets.Stops(q.Info + " - " + q.Hint).Count == 0) w.TextDisabled(_questNavStatus);
bool loaded = _c.Book.Loaded;
bool tracked = _c.Book.IsTracked(q.Flag);
@ -664,8 +906,10 @@ internal sealed partial class OracleView
private List<QuestRow> QuestRows(List<QuestKind> kinds)
{
string key = $"{_questSearch}|{_qDone}{_qNotDone}{_qRepeatable}{_qOneTime}{_qNew}{_qServer}{_qTracked}{_qKill}|{_questSort}"
+ $"|{_qTrackers}|{_qKind}|{string.Join(",", kinds)}"
+ $"|{_qTrackers}|{_qKind}|{_dynArea}|{string.Join(",", kinds)}"
+ $"|{_c.Flags.Revision}|{_c.Catalog.Revision}|{(_qTracked ? _c.Book.Revision : 0)}";
// Infinite Leaftide: the guardians and a new /qb list (it can mark Dynamic stamps done).
if (kinds.Contains(QuestKind.Dynamic)) key += $"|{_c.GuardianRevision}|{_c.Ilt.Revision}";
bool timeSorted = _questSort == 4;
if (key == _questKey && (!timeSorted || _c.NowMs - _questBuiltMs < 5000)) return _questRows;
_questKey = key;
@ -675,11 +919,25 @@ internal sealed partial class OracleView
string[] terms = _questSearch.Split(' ', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
_questRows.Clear();
// The Dynamic stamps the list matched (Infinite Leaftide): shown as stamp rows, not again as unknown quest flags.
bool stamps = kinds.Contains(QuestKind.Dynamic);
IReadOnlySet<string>? qbStamps = stamps ? _c.Ilt.QbStampSet : null;
var stampFlags = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
if (stamps)
foreach (DynamicStamp s in DynamicStampList.All)
if (s.MatchedFlag(flags, qbStamps) is string f)
{
// The errand's flag and its "_d" delivery flag are both this stamp's row.
stampFlags.Add(f);
stampFlags.Add(DynamicStampList.ErrandOf(f) + DynamicStampList.DeliverySuffix);
}
if (KindListed(QuestKind.Quest, kinds))
{
foreach (Quest q in _c.Catalog.Quests)
{
if (_qNew && !q.IsNew) continue;
if (q.IsNew && stampFlags.Contains(q.Flag)) continue;
if (_qServer && q.Server.Length == 0) continue;
if (_qTracked && !_c.Book.IsTracked(q.Flag)) continue;
if (_qKill && !(flags.TryGet(q.Flag, out QuestFlag kf) && QuestTimer.IsKillTask(kf))) continue;
@ -709,6 +967,23 @@ internal sealed partial class OracleView
QuestRow r = MarkerRow(MarkerList.All[i], flags, i);
if (KeepTracker(r, repeatable: false, tracked: false, $"{r.Label} {r.M!.Location} {r.M.Hint}", terms)) _questRows.Add(r);
}
if (KindListed(QuestKind.Dynamic, kinds))
for (int i = 0; i < DynamicStampList.All.Count; i++)
{
DynamicStamp s = DynamicStampList.All[i];
if (_dynArea > 0 && (_dynArea > DynamicStampList.Areas.Count || DynamicStampList.Areas[_dynArea - 1] != s.Area)) continue;
var r = new QuestRow { Kind = QuestKind.Dynamic, Key = "dy:" + s.Stamp, Label = s.Label, Group = s.Area, Order = i, Done = s.Have(flags, qbStamps), D = s };
if (KeepTracker(r, repeatable: false, tracked: false, $"{s.Npc} {s.Place} {s.Reward} {s.Area} {s.Stamp} {s.Note}", terms)) _questRows.Add(r);
}
if (KindListed(QuestKind.Guardian, kinds))
for (int i = 0; i < _c.Guardian.Rows.Count; i++)
{
IltGuardianRow g = _c.Guardian.Rows[i];
var r = new QuestRow { Kind = QuestKind.Guardian, Key = "gd:" + g.Attribute, Label = g.Attribute + " (" + g.Npc + ")", Group = g.Npc, Order = i, Done = !g.Ready, G = g };
if (KeepTracker(r, repeatable: true, tracked: false, $"{g.Attribute} {g.Npc} {g.Status}", terms)) _questRows.Add(r);
}
}
DateTime now = _c.UtcNow;
@ -757,7 +1032,7 @@ internal sealed partial class OracleView
return MatchesAll(hay, terms);
}
/// <summary>Ready soonest: held repeatable quests and Legendary quests by time left; the rest after.</summary>
/// <summary>Ready soonest: held repeatable quests and Legendary quests by time left, ready guardians first; the rest after.</summary>
private static double RowReadyKey(QuestRow r, QuestFlagStore flags, DateTime now)
{
switch (r.Kind)
@ -767,13 +1042,20 @@ internal sealed partial class OracleView
case QuestKind.Legendary:
TimeSpan? left = r.L!.TimeLeft(flags, now);
return left == null ? double.MaxValue : Math.Max(0, left.Value.TotalSeconds);
case QuestKind.Guardian:
return r.G!.Ready ? 0 : double.MaxValue;
default:
return double.MaxValue;
}
}
/// <summary>Most solves: a repeatable quest's solves.</summary>
private static int RowSolves(QuestRow r, QuestFlagStore flags) => r.Kind == QuestKind.Quest ? Solves(r.Q!, flags) : 0;
/// <summary>Most solves: a repeatable quest's solves, a guardian's turn-ins.</summary>
private static int RowSolves(QuestRow r, QuestFlagStore flags) => r.Kind switch
{
QuestKind.Quest => Solves(r.Q!, flags),
QuestKind.Guardian => r.G!.Count,
_ => 0,
};
/// <summary>Held repeatables by time left (ready ones first); everything else after them.</summary>
private static double ReadyKey(Quest q, QuestFlagStore flags, DateTime now) =>
@ -784,3 +1066,54 @@ internal sealed partial class OracleView
private static int Solves(Quest q, QuestFlagStore flags) =>
flags.TryGet(q.Flag, out QuestFlag f) && q.IsRepeatable(flags) ? f.Solves : 0;
}
/// <summary>
/// The Quests list's column positions for the window's width: the quest name takes what the
/// fixed columns (Ready in, Solves) and the Rewards column leave, so a wide window shows whole
/// names and rewards instead of a band of empty space. Without a width (an engine that sends no
/// Geometry events, or before the first one) it is the old fixed layout. Logical units at UI
/// scale 1, as SameLine takes them.
/// </summary>
internal readonly record struct QuestColumns(float Done, float Label, float LabelWidth, int LabelChars,
float Ready, int ReadyChars, float Solves, float Extra, int ExtraChars)
{
/// <summary>The old fixed layout (the list as it was laid out for a 600-wide window).</summary>
public static readonly QuestColumns Fixed = new(28f, 72f, 290f, 44, 370f, 14, 470f, 530f, 18);
// The child's border, padding and scrollbar take this much of the window's content width.
private const float ListChrome = 34f;
// A rough average glyph width of the default font, for cutting text to a column.
private const float CharWidth = 7f;
private const float ReadyWidth = 100f, SolvesWidth = 60f, Gap = 8f;
/// <summary>
/// The layout for <paramref name="contentWidth"/>: scales all columns to fit the window's
/// width. The label column gets at most half the available space so the gap between the
/// quest name and the Ready column stays reasonable at any window width.
/// </summary>
public static QuestColumns For(float contentWidth)
{
float width = contentWidth - ListChrome;
if (!(width > 0f) || !float.IsFinite(width)) return Fixed;
// Right-side fixed minimums.
const float MinReady = 80f, MinSolves = 50f, MinExtra = 100f;
float rightMin = MinReady + MinSolves + MinExtra + Gap * 3;
float available = width - Fixed.Label - Gap;
if (available < rightMin + 80f) return Fixed; // too narrow to lay out dynamically
// Label gets up to half, capped at 50% of the space after the left columns.
float maxLabel = available * 0.50f;
float labelWidth = Math.Min(maxLabel, Fixed.LabelWidth + (available - rightMin - Fixed.LabelWidth) * 0.35f);
labelWidth = Math.Max(Fixed.LabelWidth, labelWidth);
// Distribute the rest among right-side columns proportionally.
float rightSpace = available - labelWidth;
float readyX = Fixed.Label + labelWidth + Gap;
float readyW = rightSpace * 0.35f;
float solvesX = readyX + readyW;
float solvesW = rightSpace * 0.20f;
float extraX = solvesX + solvesW;
float extraW = rightSpace - readyW - solvesW;
return new QuestColumns(Fixed.Done, Fixed.Label, labelWidth, Math.Max(10, (int)(labelWidth / CharWidth)),
readyX, Math.Max(8, (int)((readyW - Gap) / CharWidth)), solvesX, extraX,
Math.Max(8, (int)((extraW - Gap) / CharWidth)));
}
}

View file

@ -33,8 +33,8 @@ internal sealed partial class OracleView
private DateTime _refreshAtUtc, _refreshDoneUtc;
private readonly Dictionary<string, long> _refreshSent = new();
/// <summary>The page a status line belongs to (each tab is one page).</summary>
private static string RefreshScope(string tab) => tab;
/// <summary>The page a status line belongs to (each tab is one page; the Gear tab, one per view).</summary>
private string RefreshScope(string tab) => tab == TabGear ? tab + GearView : tab;
private void DrawRefreshRow(UiWindow w, TabDef def)
{

View file

@ -0,0 +1,129 @@
// The Quests tab's Society and Contracts lists (2026-11-21, Silentkelpie: "lay out tabs for quests, kill task,
// socity quests, contracts ... pull a dynamic feed from https://asheron.fandom.com/wiki/Category:Society_Quests
// for socity quests, .../Category:Contracts for contracts"). On every server.
// - Society: the wiki's society quests by rank (Joining, Initiate, Adept, Knight, Lord, Master), each the wiki
// quest view with its steps, Run this quest and loot profile. The rank is the quest box's "Society Rank",
// else the society category the page is in.
// - Contracts: the AC Community Wiki's contract items: what each is, where it comes from (Go: RynthNav to the
// person), and the quests it is for (Open; their state on the left). A contract's quest is looked up in the
// wiki in use, then in the AC Community Wiki's.
using System;
using System.Collections.Generic;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
internal sealed partial class OracleView
{
/// <summary>Society ranks in order (the wiki's names).</summary>
internal static readonly string[] SocietyRanks = { "Joining", "Initiate", "Adept", "Knight", "Lord", "Master" };
/// <summary>A rank's place in <see cref="SocietyRanks"/>; past the end for any other.</summary>
internal static int RankOrder(string rank)
{
for (int i = 0; i < SocietyRanks.Length; i++)
if (string.Equals(SocietyRanks[i], rank, StringComparison.OrdinalIgnoreCase)) return i;
return SocietyRanks.Length;
}
/// <summary>A quest's society rank: the wiki in use, else the AC Community Wiki's categories.</summary>
internal string SocietyRankOf(GuideQuest q)
{
string r = _c.Wiki.SocietyRankOf(q);
if (r.Length == 0 && !_c.WikiIsFandom) r = _c.Fandom.Guide.SocietyRankOf(q);
return r;
}
private void SocietyRows(string[] terms, bool hide)
{
var order = new Dictionary<string, int>(StringComparer.Ordinal);
var seen = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
void Add(GuideQuest q)
{
if (!seen.Add(q.Title)) return;
string rank = SocietyRankOf(q);
if (rank.Length == 0) return;
if (!MatchesAll(rank + " " + WikiHay(q), terms)) return;
GuideRow r = WikiRow(q);
if (hide && r.Done) return;
r.Label = rank + ": " + q.Title;
_gRows.Add(r);
order[r.Key] = RankOrder(rank);
}
foreach (GuideQuest q in _c.Wiki.Quests) Add(q);
if (!_c.WikiIsFandom)
foreach (GuideQuest q in _c.Fandom.Guide.Quests) Add(q);
_gRows.Sort((a, b) =>
{
int k = order[a.Key].CompareTo(order[b.Key]);
return k != 0 ? k : string.Compare(a.Label, b.Label, StringComparison.OrdinalIgnoreCase);
});
}
private GuideRow ContractRow(GuideContract c)
{
var r = new GuideRow { Key = "c:" + c.Title, Label = c.Name, C = c };
// The state of the quest it is for (the first the wiki knows).
foreach (string t in c.Quests)
if (_c.FindWiki(t) is GuideQuest q)
{
GuideRow qr = WikiRow(q);
if (qr.Status.Length > 0 && qr.Status != "no stamps") { r.Status = qr.Status; r.Color = qr.Color; r.Done = qr.Done; return r; }
break;
}
if (c.Level.Length > 0) { r.Status = "L" + c.Level; r.Color = UiColors.Grey; }
return r;
}
private void ContractRows(string[] terms, bool hide)
{
foreach (GuideContract c in _c.Fandom.Guide.Contracts)
{
if (!MatchesAll($"{c.Name} {c.Description} {c.Where} {string.Join(" ", c.Quests)}", terms)) continue;
GuideRow r = ContractRow(c);
if (hide && r.Done) continue;
_gRows.Add(r);
}
_gRows.Sort((a, b) => string.Compare(a.Label, b.Label, StringComparison.OrdinalIgnoreCase));
}
private void DrawContract(UiWindow w, GuideContract c)
{
w.TextColored(UiColors.Gold, c.Name);
if (c.Level.Length > 0) w.TextDisabled("Recommended level " + c.Level);
if (c.Description.Length > 0) w.TextWrapped(c.Description);
if (c.Where.Length > 0)
{
w.Text("Where: " + c.Where);
if (c.Npc.Length > 0)
{
w.SmallButton("Go to " + Cut(c.Npc, 28), "g.c.go", () => _gMsg = SendRynthNav("go", new[] { c.Npc }));
w.Tooltip("RynthNav goes to " + c.Npc + ".");
}
}
if (c.Quests.Count > 0)
{
w.Spacing();
w.Text(c.Quests.Count == 1 ? "The quest it is for:" : "The quests it is for:");
for (int i = 0; i < c.Quests.Count; i++)
{
string t = c.Quests[i];
GuideQuest? q = _c.FindWiki(t);
if (q == null) { w.TextDisabled(" " + t + " (no quest page on the wiki)"); continue; }
GuideRow qr = WikiRow(q);
w.SmallButton("Open##g.c.q" + i, "g.c.q." + i, () => { _gTab = GuideTab.Wiki; _gPage = 0; _gSel = "w:" + q.Title; _gSearch = ""; });
w.Tooltip("Opens the quest: its steps, Run this quest and its loot profile.");
w.SameLine();
w.Text(q.Title);
if (qr.Status.Length > 0)
{
w.SameLine();
w.TextColored(qr.Color, qr.Status);
}
}
}
w.Spacing();
w.TextDisabled("From the AC Community Wiki: " + c.Url);
}
}

View file

@ -10,11 +10,7 @@ internal sealed partial class OracleView
{
private void DrawSociety(UiWindow w)
{
CharacterSnapshot c = _c.Character;
var s = new SocietyStanding(
c.Int(_c.Host, CharacterSnapshot.IntSocietyCelhan),
c.Int(_c.Host, CharacterSnapshot.IntSocietyEldweb),
c.Int(_c.Host, CharacterSnapshot.IntSocietyRadblo));
SocietyStanding s = Standing();
QuestFlagStore flags = _c.Flags;
DateTime now = _c.UtcNow;

View file

@ -0,0 +1,251 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.Plugin.RynthOracle.Ui;
namespace RynthCore.Plugin.RynthOracle.Views;
// The ILT Tracker window (Infinite Leaftide only). Was the T11 Tracking Oracle tab (2026-11-11), renamed
// ILT Tracker (2026-11-21), then moved off the Oracle tab strip onto its own RynthCore bar button
// (2026-11-22, Silentkelpie: "turn it into its own icon on the bar like conquest"). Hub pages live in
// RynthILT's "ILT Features" bar window. Item bounties, levelled charms / infusion, school gems, lum
// tokens, T11 gear, quest bonus / QB Deeds and the wiki login how-to. Data: Data/T11Tracking.cs
// (T11Scanner), read while this window is open; Views/IltTrackerTab.cs for QB + wiki.
internal sealed partial class OracleView
{
/// <summary>Bar window title (also the old tab name; kept for /ro tracker and saved settings).</summary>
public const string TabT11 = "ILT Tracker";
/// <summary>The tab's name before 2026-11-21: a saved tab of that name opens the ILT Tracker window.</summary>
public const string TabT11Old = "T11 Tracking";
private static readonly uint T11Gold = UiFormat.Rgb(230, 190, 90);
private string _t11Msg = "";
/// <summary>Help text for the ILT Tracker window's Refresh button.</summary>
public string IltTrackerHelp =>
"Asks for /bonus and the /qb list, re-reads your packs and bounty slots (/bounty sync), and checks your gear's T11 modifiers.";
private RefreshResult RefreshT11()
{
_c.T11.ForgetAsked();
_c.RescanT11();
bool sent = _c.Send("/bounty sync");
if (sent)
{
_c.Send("/bonus");
_c.Send("/ilt qb");
}
StartGearCheck();
return new RefreshResult(sent
? "Asked for your XP multipliers (/bonus), the /qb list and your bounty slots (/bounty sync), re-read your packs and checked your gear."
: "Re-read your packs and checked your gear.");
}
/// <summary>The standalone ILT Tracker bar window body (Refresh + the old ILT Tracker tab page).</summary>
public void DrawIltTracker(UiWindow w)
{
w.Button("Refresh", "ilttracker.refresh", () =>
{
RefreshResult r = RefreshT11();
_t11Msg = r.What;
}, small: true);
w.Tooltip(IltTrackerHelp);
w.SameLine();
w.TextDisabled("Hub pages (Banking, Gear, Charms, …): the ILT Features button on the bar.");
w.Separator();
DrawT11(w);
}
private void DrawT11(UiWindow w)
{
T11Scanner t = _c.T11;
if (_t11Msg.Length > 0) w.TextColored(UiColors.Yellow, _t11Msg);
DrawIltQuestBonus(w);
DrawIltBonusTracker(w);
DrawT11Bounties(w, t);
DrawT11Charms(w, t);
DrawT11SchoolGems(w, t);
DrawT11Tokens(w, t);
DrawT11Gear(w);
DrawIltWikiGuide(w);
}
// ── Item bounties ────────────────────────────────────────────────────
private void DrawT11Bounties(UiWindow w, T11Scanner t)
{
int active = t.Slots.Count(s => !s.Empty);
if (!w.CollapsingHeader($"Item bounties ({active} active, {t.Bounties.Count} carried)", "t11.h.bounty", defaultOpen: true)) return;
w.SmallButton("Sync", "t11.b.sync", () => _t11Msg = _c.Send("/bounty sync") ? "Asked the server for your bounty slots." : "Log in first.");
w.Tooltip("/bounty sync: the server sends your slots again (no chat).");
w.SameLine();
w.SmallButton("/bounty", "t11.b.list", () => _c.Send("/bounty"));
w.Tooltip("The server's text view: the kill bounties where you stand, then your slots.");
w.SameLine();
w.SmallButton("Kill bounties", "t11.b.panel", () => _t11Msg = _c.RunCommand("/rc bounties show") ? "" : "RynthCore's Bounties panel isn't there (it needs RynthILT).");
w.Tooltip("RynthCore's Bounties panel: every kill bounty on the server and your progress on each.");
if (t.Slots.Count == 0)
w.TextDisabled(t.BountyText.Length == 0
? "No bounty slots from the server yet (Sync asks for them; the server needs item bounties on)."
: "The server's bounty format isn't one this RynthOracle reads (update RynthOracle).");
foreach (ItemBountySlot s in t.Slots)
{
w.TextColored(UiColors.Gold, s.Key);
w.SameLine(40f);
if (s.Empty)
{
w.TextDisabled(s.Key.StartsWith("R", StringComparison.Ordinal) ? "empty: use a bounty on a ring to start it here" : "empty: use a bounty on a bracelet to start it here");
continue;
}
w.Text(Cut(s.Name, 34));
w.Tooltip(s.Name + "\n" + s.Task + (s.Reward.Length > 0 ? "\nReward: " + s.Reward : "") + (s.RewardUse.Length > 0 ? "\n" + s.RewardUse : ""));
w.SameLine(300f);
string count = s.Kills > 0
? $"{s.Progress.ToString("0.##", CultureInfo.InvariantCulture)} / {s.Kills:N0}"
: $"{s.Progress.ToString("0.##", CultureInfo.InvariantCulture)} / ?";
w.ProgressBar(s.Fraction, 170f, 0f, count);
w.SameLine();
w.TextDisabled((s.Species && s.Target.Length > 0 ? s.Target + ", " : "") + (s.PlaceShort.Length > 0 ? s.PlaceShort : "T" + s.Tier));
if (s.Reward.Length > 0)
{
w.Dummy(1f, 0f);
w.SameLine(40f);
w.TextDisabled("Reward: " + s.Reward + (s.Kills > 0 && s.Left > 0 ? $" | {s.Left.ToString("N0", CultureInfo.InvariantCulture)} kills to go" : ""));
}
}
if (t.Bounties.Count > 0)
{
w.Spacing();
w.TextColored(T11Gold, "Carried, not started (use one on a ring or bracelet):");
foreach (T11Item b in t.Bounties)
{
w.BulletText(b.Stack > 1 ? $"{b.Name} x{b.Stack}" : b.Name);
w.Tooltip(b.Desc);
}
}
}
// ── Levelled charms and infusion ─────────────────────────────────────
private void DrawT11Charms(UiWindow w, T11Scanner t)
{
long coins = t.InfusionCoins;
if (!w.CollapsingHeader($"Levelled charms and infusion ({t.Charms.Count} charms, {coins:N0} coins in gems)", "t11.h.charms", defaultOpen: true)) return;
w.TextDisabled("Level 1-100, T11+ only (held to the zone's cap). A Charm Infusion Gem used on a charm puts its coins in.");
if (t.Charms.Count == 0)
w.TextDisabled("No levelled charm carried (Split Arrow, Chain, Pandemic, Improved Cleave, Armor Breaker, Shield Arc).");
foreach (LevelledCharmRow c in t.Charms)
{
w.TextColored(c.Active ? UiColors.Green : UiColors.Grey, c.Active ? "ON " : "OFF");
w.SameLine(40f);
w.Text(c.Name);
w.SameLine(170f);
if (!c.Known)
{
w.TextDisabled("reading its level...");
continue;
}
float frac = c.Level >= 100 ? 1f : c.PercentToNext / 100f;
w.ProgressBar(frac, 150f, 0f, c.Level >= 100 ? "Level 100 (max)" : $"Level {c.Level} ({c.PercentToNext}%)");
w.SameLine();
w.TextDisabled($"{c.CoinsIn:N0} coins in" + (c.Level < 100 && c.CoinsToNext > 0 ? $", {c.CoinsToNext:N0} to level {c.Level + 1}" : ""));
if (c.Level < 100 && c.CoinsToNext > 0 && coins > 0)
w.Tooltip(coins >= c.CoinsToNext
? $"Your gems hold {coins:N0} coins: enough for level {c.Level + 1}."
: $"Your gems hold {coins:N0} coins: {c.CoinsToNext - coins:N0} short of level {c.Level + 1}.");
uint id = c.Id;
w.SameLine();
w.SmallButton("Toggle", "t11.c.t." + id, () => _t11Msg = _c.IltData.ToggleCharm(_c.Host, _c.NowMs, id) ? "" : "RynthILT didn't toggle it (update RynthILT, or the charm moved).");
}
w.Spacing();
if (t.Infusion.Count == 0)
{
w.TextDisabled("No Charm Infusion Gems carried (Enephior sells them 1:1 for Prestige Coins).");
return;
}
w.TextColored(T11Gold, $"Charm Infusion Gems: {coins:N0} coins");
w.Text(string.Join(" ", t.Infusion.Select(g =>
$"({T11Tracking.InfusionGems[g.Wcid]:N0}) x{g.Stack}")));
}
// ── School gems ──────────────────────────────────────────────────────
private void DrawT11SchoolGems(UiWindow w, T11Scanner t)
{
if (!w.CollapsingHeader($"School gems ({t.SchoolGems.Sum(g => g.Stack)} carried)", "t11.h.school", defaultOpen: true)) return;
w.TextDisabled("T15-T25: +1 to a school past the 4,000 cap, up to the tier's ceiling (4,500 at T15 ... 9,500 at T25). Only the earner can use one.");
foreach (var (wcid, school, kind) in T11Tracking.SchoolGems)
{
var mine = t.SchoolGems.Where(g => g.Wcid == wcid).ToList();
w.TextColored(mine.Count > 0 ? UiColors.Gold : UiColors.Grey, $"{school} ({kind})");
w.SameLine(220f);
if (mine.Count == 0) { w.TextDisabled("none"); continue; }
var byTier = mine.GroupBy(g => g.GemTier).OrderBy(g => g.Key)
.Select(g => (g.Key > 0 ? "T" + g.Key : "tier ?") + " x" + g.Sum(x => x.Stack));
w.Text(string.Join(" ", byTier));
string earned = mine.Select(g => EarnedBy(g.Desc + "\n" + g.Use)).FirstOrDefault(s => s.Length > 0) ?? "";
if (earned.Length > 0) w.Tooltip(earned);
}
}
/// <summary>"Earned by Silentkelpie at T16" out of a school gem's text, or "".</summary>
private static string EarnedBy(string text)
{
int i = text.IndexOf("Earned by", StringComparison.OrdinalIgnoreCase);
if (i < 0) return "";
int end = text.IndexOfAny(new[] { '\n', '\r' }, i);
return (end < 0 ? text.Substring(i) : text.Substring(i, end - i)).Trim();
}
// ── Lum tokens ───────────────────────────────────────────────────────
private void DrawT11Tokens(UiWindow w, T11Scanner t)
{
int n = t.LumTokens.Sum(g => g.Stack);
if (!w.CollapsingHeader($"Lum tokens ({n} carried)", "t11.h.tokens", defaultOpen: n > 0)) return;
if (n == 0)
{
w.TextDisabled("No Bounty Reward Tokens or Event Lum Tokens carried.");
return;
}
foreach (var g in t.LumTokens.GroupBy(x => x.Name).OrderBy(g => g.Key))
w.BulletText($"{g.Key} x{g.Sum(x => x.Stack)}");
w.SmallButton("Bank them", "t11.tok.bank", () => _t11Msg = _c.Send("/b lum") ? "Sent /b lum: the tokens go to your banked luminance." : "Log in first.");
w.Tooltip("/b lum: every luminance token in your packs is banked as luminance (a double click banks one).");
}
// ── T11 gear (moved from the Gear tab) ───────────────────────────────
private void DrawT11Gear(UiWindow w)
{
RatingsReport? r = _c.Gear.Ratings;
var rows = r == null ? new List<RatingRow>() : r.Rows.Where(x => x.T11.Length > 0).ToList();
if (!w.CollapsingHeader($"T11 gear ({rows.Count} item(s))", "t11.h.gear", defaultOpen: true)) return;
w.SmallButton(_c.Gear.Busy ? "Checking..." : "Check gear", "t11.g.check", StartGearCheck);
w.Tooltip("The Gear tab's Check: worn items (and packs, when its option is on) are appraised, then their T11 modifiers listed here.");
if (r == null)
{
w.TextDisabled("Press Check gear to read your T11 gear's modifiers.");
return;
}
if (r.T11Totals.Count > 0)
w.TextColored(T11Teal, "T11 worn: " + string.Join(" | ", r.T11Totals.Select(x => x.Name + " " + x.Value)));
if (rows.Count == 0)
{
w.TextDisabled("No T11 gear read (worn" + (r.IncludePack ? " or in your packs" : "; the Gear tab's \"Include pack items\" adds your packs") + ").");
return;
}
foreach (RatingRow row in rows.OrderByDescending(x => x.Piece.Equipped))
{
GearPiece p = row.Piece;
w.TextColored(p.Equipped ? WornGreen : PackGrey, p.Equipped ? "Worn" : "Pack");
w.SameLine(45f);
w.TextColored(p.ZoneLocked ? UiColors.Yellow : UiFormat.Rgb(230, 230, 230), Cut(p.Name, 30));
w.Tooltip(p.Name + (p.ZoneLocked ? "\nZone locked: power reduced outside its zone." : ""));
w.SameLine(260f);
w.TextWrapped(row.T11);
}
}
}