feat(suite): Vaulted Dungeons tab, Oracle breeding/charms, Mini Remote Options
Port tonight's Suite work onto standing sk for upstream release prep: ILT Vaulted Dungeons (Options-gated), chat 0x1C channels, Oracle Charms/Pet Breeding, Mini Remote Options opens Settings. HandWrittenVersion stays 0.5.0-legacy-ui. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
dc8cc9bc81
commit
0532d8d981
43 changed files with 2129 additions and 197 deletions
|
|
@ -8,9 +8,8 @@ namespace RynthCore.Plugin.RynthOracle.Views;
|
|||
|
||||
/// <summary>
|
||||
/// Character: level and experience, luminance, the status summary (upstream's Status HUD: buff,
|
||||
/// house, beer, page and rare timers, key skills, aetheria surges), RynthAi's session (the generic
|
||||
/// part of the Mini Remote's old Character tab, moved here 2026-10-13) and the full buff list.
|
||||
/// Infinite Leaftide's charms stay RynthILT's (its Charms tab in the Mini Remote).
|
||||
/// house, beer, page and rare timers, key skills, aetheria surges), RynthAi's session, RynthILT's
|
||||
/// charms (the Mini Remote's Character and Charms tabs moved here 2026-10-13) and the full buff list.
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
|
|
@ -57,6 +56,7 @@ internal sealed partial class OracleView
|
|||
Field(w, "Summoning", SkillText(c.Summoning), 300f, 400f);
|
||||
|
||||
DrawSession(w);
|
||||
DrawCharms(w);
|
||||
|
||||
var list = new List<ActiveEnchantment>(c.Enchantments);
|
||||
list.Sort((a, b) => a.Remaining.CompareTo(b.Remaining));
|
||||
|
|
@ -105,6 +105,97 @@ internal sealed partial class OracleView
|
|||
|
||||
private static string RateText(double perHour) => perHour > 0 ? TimeText.Number((long)Math.Round(perHour)) : "0";
|
||||
|
||||
/// <summary>
|
||||
/// "Charms": RynthILT's Infinite Leaftide charm list (the Mini Remote's old Charms tab), with a
|
||||
/// Toggle for each carried charm and Guardian Hand. Nothing is listed here: RynthILT sends the
|
||||
/// list, so a charm it learns about shows up without an Oracle update.
|
||||
/// </summary>
|
||||
private void DrawCharms(UiWindow w)
|
||||
{
|
||||
Shared.IltCharmsView v = _c.Charms;
|
||||
if (!v.Loaded)
|
||||
{
|
||||
if (_c.Server.Is(ServerTags.InfiniteLeaftide))
|
||||
{
|
||||
w.SeparatorText("Charms");
|
||||
w.TextDisabled("Load RynthILT to list your Infinite Leaftide charms here.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!v.Available) return; // not an ILT world: no charms
|
||||
|
||||
w.SeparatorText("Charms");
|
||||
w.TextDisabled($"{v.Acquired} acquired, {v.Active} on (from RynthILT{(v.World.Length > 0 ? ", " + v.World : "")}).");
|
||||
if (_c.CharmMessage.Length > 0) w.TextDisabled(_c.CharmMessage);
|
||||
|
||||
if (w.CollapsingHeader($"Charms ({v.Charms.Count})", "c.charms", defaultOpen: true))
|
||||
{
|
||||
if (v.Charms.Count == 0) w.TextDisabled("RynthILT hasn't listed any charms yet.");
|
||||
for (int i = 0; i < v.Charms.Count; i++)
|
||||
{
|
||||
Shared.IltCharmRow r = v.Charms[i];
|
||||
CharmState(w, r.Active);
|
||||
w.SameLine(50f);
|
||||
if (r.Carried) w.Text(Cut(r.Name, 30));
|
||||
else w.TextDisabled(Cut(r.Name, 30));
|
||||
if (r.Effect.Length > 0) w.Tooltip(r.Effect);
|
||||
w.SameLine(270f);
|
||||
w.TextDisabled(r.MaxTier > 0 ? $"T{r.Tier}/{r.MaxTier}" : r.Tier > 0 ? $"T{r.Tier}" : "-");
|
||||
w.SameLine(330f);
|
||||
w.TextDisabled(AcquiredText(r));
|
||||
if (r.Server == "off")
|
||||
{
|
||||
w.SameLine(430f);
|
||||
w.TextColored(UiColors.Red, "server off");
|
||||
}
|
||||
if (r.Carried && r.ToggleId != 0)
|
||||
{
|
||||
w.SameLine(510f);
|
||||
uint id = r.ToggleId;
|
||||
w.SmallButton("Toggle", "c.charm." + i, () => _c.ToggleCharm(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (v.Hands.Count > 0 && w.CollapsingHeader($"Guardian Hands ({v.Hands.Count})", "c.hands", defaultOpen: true))
|
||||
{
|
||||
for (int i = 0; i < v.Hands.Count; i++)
|
||||
{
|
||||
Shared.IltHandRow h = v.Hands[i];
|
||||
CharmState(w, h.Active);
|
||||
w.SameLine(50f);
|
||||
w.Text(Cut(h.Name, 30));
|
||||
if (h.Server == "off")
|
||||
{
|
||||
w.SameLine(430f);
|
||||
w.TextColored(UiColors.Red, "server off");
|
||||
}
|
||||
w.SameLine(510f);
|
||||
uint id = h.Id;
|
||||
w.SmallButton("Toggle", "c.hand." + i, () => _c.ToggleCharm(id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>ON in green, OFF in red, "?" in grey (status not read yet).</summary>
|
||||
private static void CharmState(UiWindow w, string active)
|
||||
{
|
||||
switch (active)
|
||||
{
|
||||
case "on": w.TextColored(UiColors.Green, "ON"); break;
|
||||
case "off": w.TextColored(UiColors.Red, "OFF"); break;
|
||||
default: w.TextColored(UiColors.Grey, "?"); break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Carried (with the count), stored (seen on this character before) or not acquired.</summary>
|
||||
internal static string AcquiredText(Shared.IltCharmRow r) => r.Acquired switch
|
||||
{
|
||||
"carried" => r.Count > 1 ? $"carried x{r.Count}" : "carried",
|
||||
"seen" => r.LastSeen.Length > 0 ? "seen " + r.LastSeen : "seen",
|
||||
_ => "not acquired",
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The buff timer: the soonest-ending long (over 15 minutes) buff that isn't a beer, a debuff
|
||||
/// or one of the not-really-buffs, with how many there are (upstream's rule).
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ internal sealed partial class OracleView
|
|||
{
|
||||
public const string TabQuests = "Quests", TabCharacter = "Character", TabAugs = "Augs", TabSociety = "Society",
|
||||
TabMarkers = "Markers", TabTitles = "Titles", TabVoid = "Void", TabFellowship = "Fellowship",
|
||||
TabBoards = "Leaderboards", TabConquest = "Conquest", TabAbout = "About";
|
||||
TabBoards = "Leaderboards", TabConquest = "Conquest", TabBreeding = "Pet Breeding", TabAbout = "About";
|
||||
|
||||
/// <summary>A tab: shown where any of its server tags matches the server; no tags = everywhere (retail).</summary>
|
||||
private sealed record TabDef(string Name, string[] Servers, Action<UiWindow> Draw, bool LiveTimers);
|
||||
|
|
@ -40,6 +40,7 @@ internal sealed partial class OracleView
|
|||
// Server-specific: each parser and its commands only exist on its own server.
|
||||
new(TabBoards, new[] { Data.ServerTags.Conquest, Data.ServerTags.Aelrynth }, DrawBoards, false),
|
||||
new(TabConquest, new[] { Data.ServerTags.Conquest }, DrawConquest, true),
|
||||
new(TabBreeding, new[] { Data.ServerTags.InfiniteLeaftide }, DrawBreeding, false),
|
||||
new(TabAbout, any, DrawAbout, false),
|
||||
};
|
||||
}
|
||||
|
|
|
|||
204
Plugins/RynthCore.Plugin.RynthOracle/Views/PetBreedingTab.cs
Normal file
204
Plugins/RynthCore.Plugin.RynthOracle/Views/PetBreedingTab.cs
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using RynthCore.Plugin.RynthOracle.Ui;
|
||||
using RynthCore.Plugin.Shared;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Views;
|
||||
|
||||
/// <summary>
|
||||
/// "Pet Breeding" (Infinite Leaftide): RynthILT's breeding tracker, the same one as RynthAi's Mini
|
||||
/// Remote Pets > Breeding tab. RynthILT reads the essences, learns the server's rules and runs the
|
||||
/// actions; this tab draws its JSON ("RynthILT.Data" GetPetBreedingJson) and sends its verbs back.
|
||||
/// Dance and supply uses ask here first (RynthILT doesn't ask again).
|
||||
/// </summary>
|
||||
internal sealed partial class OracleView
|
||||
{
|
||||
/// <summary>Essence rows drawn at most (each is about eight ops; the window's op budget is shared).</summary>
|
||||
private const int BreedingMaxRows = 40;
|
||||
|
||||
/// <summary>The breeding verb waiting for Yes / No, with its question ("" = none).</summary>
|
||||
private string _breedConfirmVerb = "", _breedConfirmText = "";
|
||||
/// <summary>The essence the supplies are used on (index into the essence list).</summary>
|
||||
private int _breedTarget;
|
||||
|
||||
private void DrawBreeding(UiWindow w)
|
||||
{
|
||||
IltBreedingView v = _c.Breeding;
|
||||
w.SeparatorText("Pet Breeding");
|
||||
if (!v.Loaded)
|
||||
{
|
||||
w.TextDisabled(_c.IltData.Connected && !_c.IltData.PetBreedingSupported
|
||||
? "This RynthILT is older than 0.2.7 and has no breeding tracker; update RynthILT."
|
||||
: "Load RynthILT (0.2.7 or later) to track pet breeding here. Reading...");
|
||||
return;
|
||||
}
|
||||
|
||||
uint col = v.Enabled == "off" ? UiColors.Red : v.Enabled == "on" ? UiColors.Green : UiColors.Yellow;
|
||||
w.TextColored(col, v.Enabled switch
|
||||
{
|
||||
"off" => "Pet breeding is off on this server.",
|
||||
"on" => $"Pet breeding: on. Breeding room: {v.Room}.",
|
||||
_ => "Pet breeding: not confirmed yet (Diagnostics in the breeding room checks).",
|
||||
});
|
||||
if (v.Bond == "off") w.TextColored(UiColors.Yellow, "Pet bond is off here, so bond can't reach the breeding minimum.");
|
||||
|
||||
w.SmallButton("Refresh", "br.refresh", () => _c.BreedingCommand(IltBreedingView.RefreshVerb()));
|
||||
w.Tooltip("Re-appraise every essence (charges, rest timers, bond, growth).");
|
||||
w.SameLine();
|
||||
w.SmallButton("Diagnostics", "br.debug", () => _c.BreedingCommand(IltBreedingView.DebugVerb()));
|
||||
w.Tooltip("@breed-debug: whether you're in the breeding room, your pet, partners nearby.");
|
||||
w.SameLine();
|
||||
w.SmallButton("Dance", "br.dance", () => AskBreeding(IltBreedingView.DanceVerb(),
|
||||
"Dance now? If your partner dances in time with both pets summoned in the same room, the breed happens."));
|
||||
w.Tooltip("@dance: both owners must dance within a few seconds.");
|
||||
w.SameLine();
|
||||
w.SmallButton("Mini Remote", "br.remote", () => _c.RunCommand("/ra hub open breeding"));
|
||||
w.Tooltip("RynthAi's Mini Remote, Pets > Breeding (the same tracker, with the pair planner).");
|
||||
|
||||
if (_breedConfirmVerb.Length > 0)
|
||||
{
|
||||
w.TextColored(UiColors.Gold, _breedConfirmText);
|
||||
string verb = _breedConfirmVerb;
|
||||
w.SmallButton("Yes", "br.yes", () => { _breedConfirmVerb = ""; _c.BreedingCommand(verb); });
|
||||
w.SameLine();
|
||||
w.SmallButton("No", "br.no", () => _breedConfirmVerb = "");
|
||||
}
|
||||
if (v.Message.Length > 0) w.TextDisabled(v.Message);
|
||||
else if (_c.BreedingMessage.Length > 0) w.TextDisabled(_c.BreedingMessage);
|
||||
if (v.FreeSlots == 0) w.TextColored(UiColors.Yellow, "Your main pack is full: as the dam's owner you couldn't receive the baby.");
|
||||
|
||||
DrawBreedEssences(w, v);
|
||||
DrawBreedPairs(w, v);
|
||||
DrawBreedSupplies(w, v);
|
||||
DrawBreedRules(w, v);
|
||||
DrawBreedEvents(w, v);
|
||||
}
|
||||
|
||||
/// <summary>Holds a verb until the player clicks Yes.</summary>
|
||||
private void AskBreeding(string verb, string question)
|
||||
{
|
||||
_breedConfirmVerb = verb;
|
||||
_breedConfirmText = question;
|
||||
}
|
||||
|
||||
private void DrawBreedEssences(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
int ready = 0;
|
||||
foreach (IltBreedEssenceRow e in v.Essences) if (e.Ready) ready++;
|
||||
if (!w.CollapsingHeader($"Essences ({ready} ready of {v.Essences.Count})", "br.ess", defaultOpen: true)) return;
|
||||
if (v.Essences.Count == 0) { w.TextDisabled("No combat pet essences in your pack."); return; }
|
||||
for (int i = 0; i < v.Essences.Count && i < BreedingMaxRows; i++)
|
||||
{
|
||||
IltBreedEssenceRow e = v.Essences[i];
|
||||
w.TextColored(e.Ready ? UiColors.Green : e.Problems.Count > 0 && e.ReadyIn > 0 ? UiColors.Yellow : UiColors.Grey, Cut(e.Status, 22));
|
||||
w.SameLine(170f);
|
||||
w.Text(Cut(e.Name, 32));
|
||||
w.Tooltip(BreedTooltip(e));
|
||||
w.SameLine(410f);
|
||||
w.TextDisabled($"{(e.Male ? "M" : "F")} T{(e.Tier > 0 ? e.Tier.ToString(CultureInfo.InvariantCulture) : "?")} B{e.Bond} "
|
||||
+ $"Mut {e.Mutations}{(e.PotencyMutations > 0 ? "+" + e.PotencyMutations + "p" : "")}");
|
||||
}
|
||||
if (v.Essences.Count > BreedingMaxRows) w.TextDisabled($"... and {v.Essences.Count - BreedingMaxRows} more (see the Mini Remote).");
|
||||
}
|
||||
|
||||
private static string BreedTooltip(IltBreedEssenceRow e)
|
||||
{
|
||||
var lines = new List<string> { $"{e.Name}: {(e.Male ? "stud" : "dam")}, tier {e.Tier}, bond {e.Bond}" };
|
||||
if (e.Male) lines.Add($"Charges {e.Charges}/{e.ChargesMax}");
|
||||
if (e.Juvenile) lines.Add($"Growing: {e.Stage}, {Math.Max(0, e.KillsRequired - e.Kills)} kills to Adult");
|
||||
if (e.Boosters.Count > 0) lines.Add("Boosters: " + string.Join(", ", e.Boosters));
|
||||
foreach (string p in e.Problems) lines.Add("- " + p);
|
||||
return string.Join("\n", lines);
|
||||
}
|
||||
|
||||
private static void DrawBreedPairs(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
if (v.Pairs.Count == 0) return;
|
||||
if (!w.CollapsingHeader($"Ready pairs ({v.Pairs.Count})", "br.pairs", defaultOpen: true)) return;
|
||||
w.TextDisabled("Stat mutation odds; fewer inherited mutations keep the odds up. Each owner dances with their own pet.");
|
||||
for (int i = 0; i < v.Pairs.Count; i++)
|
||||
{
|
||||
IltBreedPairRow p = v.Pairs[i];
|
||||
w.Text($"{Cut(p.Stud, 26)} x {Cut(p.Dam, 26)}");
|
||||
w.SameLine(400f);
|
||||
w.TextDisabled($"{Pct(p.ChanceWorst)}-{Pct(p.ChanceBest)}, inherits {p.InheritMin}-{p.InheritMax}");
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawBreedSupplies(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
long carried = 0;
|
||||
foreach (IltBreedSupplyRow s in v.Supplies) carried += s.Count;
|
||||
if (!w.CollapsingHeader($"Supplies ({carried} carried)", "br.sup", defaultOpen: false)) return;
|
||||
w.TextDisabled("Ivo sells these at the Seedy Motel. Boosters are spent by the essence's next breed.");
|
||||
|
||||
IltBreedEssenceRow? target = null;
|
||||
if (v.Essences.Count > 0)
|
||||
{
|
||||
var names = new List<string>(v.Essences.Count);
|
||||
foreach (IltBreedEssenceRow e in v.Essences) names.Add(Cut(e.Name, 34));
|
||||
int index = Math.Clamp(_breedTarget, 0, v.Essences.Count - 1);
|
||||
w.Combo("Use on", "br.target", index, names, i => _breedTarget = i);
|
||||
target = v.Essences[index];
|
||||
}
|
||||
|
||||
for (int i = 0; i < v.Supplies.Count; i++)
|
||||
{
|
||||
IltBreedSupplyRow s = v.Supplies[i];
|
||||
w.TextColored(s.Count > 0 ? UiColors.Green : UiColors.Grey, $"{s.Count,3} {s.Name}");
|
||||
w.Tooltip(s.Price > 0 ? $"{s.Effect}\nIvo's price: {Price(s.Price)} pyreals" : s.Effect);
|
||||
if (!s.Apply || s.Count <= 0 || target == null) continue;
|
||||
w.SameLine(330f);
|
||||
if (System.Linq.Enumerable.Contains(s.Targets, target.Id))
|
||||
{
|
||||
string verb = IltBreedingView.ApplyVerb(s.Key, target.Id);
|
||||
string q = $"Use {s.Name} on {target.Name}? {s.Effect}";
|
||||
w.SmallButton("Use", "br.use." + i, () => AskBreeding(verb, q));
|
||||
}
|
||||
else w.TextDisabled("-");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawBreedRules(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
if (!w.CollapsingHeader("Server rules", "br.rules", defaultOpen: false)) return;
|
||||
w.TextDisabled("Values this server showed win over the ILT profile, which wins over ACE's defaults.");
|
||||
foreach (IltBreedRuleRow r in v.Rules)
|
||||
{
|
||||
w.Text(r.Label);
|
||||
if (r.Help.Length > 0) w.Tooltip(r.Help);
|
||||
w.SameLine(230f);
|
||||
w.Text(r.Value);
|
||||
w.SameLine(310f);
|
||||
w.TextColored(r.Source == "seen on server" ? UiColors.Green : UiColors.Grey, r.Source);
|
||||
}
|
||||
if (v.Debug is { } d)
|
||||
{
|
||||
w.Separator();
|
||||
w.TextDisabled($"Last diagnostics ({d.When} UTC):");
|
||||
if (d.Location.Length > 0) w.BulletText("You: " + d.Location);
|
||||
if (d.Match.Length > 0) w.BulletText(d.Match == "valid" ? "In the breeding room" : "Not in the breeding room");
|
||||
if (d.Pet.Length > 0) w.BulletText("Pet: " + d.Pet + (d.Sex.Length > 0 ? " (" + d.Sex + ")" : ""));
|
||||
if (d.Partners >= 0) w.BulletText($"Partners nearby: {d.Partners}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawBreedEvents(UiWindow w, IltBreedingView v)
|
||||
{
|
||||
if (!w.CollapsingHeader($"Recent events ({v.Events.Count})", "br.events", defaultOpen: false)) return;
|
||||
if (v.Events.Count == 0) w.TextDisabled("Nothing yet: rituals, births, growth and charges land here.");
|
||||
foreach (IltBreedEventRow e in v.Events)
|
||||
{
|
||||
w.TextDisabled(e.When);
|
||||
w.SameLine(130f);
|
||||
w.TextWrapped(e.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private static string Pct(double v) => (v * 100).ToString("0.#", CultureInfo.InvariantCulture) + "%";
|
||||
|
||||
private static string Price(long p) => p >= 1_000_000
|
||||
? (p / 1_000_000.0).ToString("0.##", CultureInfo.InvariantCulture) + "M"
|
||||
: p.ToString("N0", CultureInfo.InvariantCulture);
|
||||
}
|
||||
Loading…
Reference in a new issue