RynthSuite/Plugins/RynthCore.Plugin.RynthAi/IltHub/IltSections.cs
BlankenshipG 09b14d4ed1 feat(rynthai): ILT Hub, HUDs, item info, chat translation, ground loot and nav editing
- ILT Hub (overlay window, /ra hub): character progression, pets, quests,
  gear, banking, guardian, buff keepers, session rates, USD import.
- Floating HUDs: combat tracker, item count HUD, Mini Remote (/ra remote,
  /ra huds).
- Item info (Mag-style describer) on select, with its own settings window.
- Chat translation (/ra translate) for chosen channels.
- Ground loot: loose items matching the loot profile are picked up when no
  corpse is in range (CorpseOpenController).
- Nav: breadcrumb recorder, route overlay, and the route editor commands
  the engine Nav panel sends (multi-select move/duplicate/delete, reverse,
  snap to path, pauses, portals, simplify, trail -> route).
- Pets: refill-loop guard for essences the server just confirmed full;
  optional ILT Hub hooks (summon on empty, hold, yield a cosmetic pet).
- QuestTracker: quiet refreshes, Disabled / LastStatus for the hub.
- WorldObjectCache: typed items (keys, gems, comps, food) are placed in
  inventory or landscape by ownership instead of staying Unknown.
- Install-aware data folders (RynthInstallPaths) and a per-category
  diagnostics log (Diagnostics/RynthLog, diagnostics.json).
- Monster Editor: VirindiTank USD import and "Import UB damage insights"
  (ub-mob-seed.json); RynthAi loads the seed (UbMobSeedStore).

Kept as on rynth/main: combat (ammo, off-hand/shield rules), AutoStack in
InventoryManager, LegacyAdvancedSettingsUi and the version stamping. No
host API slots are used; new engine data comes from optional exports
(RynthPluginRenderOverlay, RynthPluginGetProgressionJson,
RynthPluginGetCharmsJson).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-05 16:52:13 -04:00

97 lines
3.7 KiB
C#

// IltSections.cs - The ILT Hub's sections, each its own window, opened from the Mini Remote's
// Options or "/ra hub open <section>". Open flags live in IltCharacterState (per character).
using System;
namespace RynthCore.Plugin.RynthAi.IltHub;
/// <summary>Section windows. Values index per-section arrays, so new sections go at the end.</summary>
internal enum IltSection
{
Character,
Quests,
Pet,
Banking,
Gear,
Games,
Guardian,
}
internal static class IltSections
{
/// <summary>Menu order (the old Hub's tab order, then the Guardian window).</summary>
public static readonly IltSection[] All =
{
IltSection.Character, IltSection.Quests, IltSection.Pet,
IltSection.Banking, IltSection.Gear, IltSection.Games, IltSection.Guardian,
};
public static string Label(IltSection s) => s switch
{
IltSection.Character => "Character",
IltSection.Quests => "Quests",
IltSection.Pet => "Pets",
IltSection.Banking => "Banking",
IltSection.Gear => "Gear",
IltSection.Games => "Games",
IltSection.Guardian => "Guardian",
_ => s.ToString(),
};
/// <summary>Parses a "/ra hub open" section name (a few aliases accepted).</summary>
public static bool TryParse(string text, out IltSection section)
{
switch ((text ?? string.Empty).Trim().ToLowerInvariant())
{
case "character": case "char": case "rates": section = IltSection.Character; return true;
case "quests": case "quest": section = IltSection.Quests; return true;
case "pets": case "pet": section = IltSection.Pet; return true;
case "banking": case "bank": section = IltSection.Banking; return true;
case "gear": section = IltSection.Gear; return true;
case "games": case "game": section = IltSection.Games; return true;
case "guardian": case "temple": case "riddle": section = IltSection.Guardian; return true;
default: section = IltSection.Character; return false;
}
}
public static bool IsOpen(IltCharacterState cs, IltSection s) => s switch
{
IltSection.Character => cs.CharacterWindowOpen,
IltSection.Quests => cs.QuestTrackerPoppedOut,
IltSection.Pet => cs.PetsWindowOpen,
IltSection.Banking => cs.BankingWindowOpen,
IltSection.Gear => cs.GearWindowOpen,
IltSection.Games => cs.GamesWindowOpen,
IltSection.Guardian => cs.GuardianWindowOpen,
_ => false,
};
public static void SetOpen(IltCharacterState cs, IltSection s, bool open)
{
switch (s)
{
case IltSection.Character: cs.CharacterWindowOpen = open; break;
case IltSection.Quests: cs.QuestTrackerPoppedOut = open; break;
case IltSection.Pet: cs.PetsWindowOpen = open; break;
case IltSection.Banking: cs.BankingWindowOpen = open; break;
case IltSection.Gear: cs.GearWindowOpen = open; break;
case IltSection.Games: cs.GamesWindowOpen = open; break;
case IltSection.Guardian: cs.GuardianWindowOpen = open; break;
}
}
/// <summary>True when any section window is open.</summary>
public static bool AnyOpen(IltCharacterState cs)
{
foreach (IltSection s in All)
if (IsOpen(cs, s)) return true;
return false;
}
/// <summary>"show" / "hide" / "toggle" (anything else toggles) applied to the current state.</summary>
public static bool Resolve(string mode, bool current) => (mode ?? string.Empty).ToLowerInvariant() switch
{
"show" or "on" or "open" => true,
"hide" or "off" or "close" => false,
_ => !current,
};
}