RynthSuite/Plugins/RynthCore.Plugin.RynthOracle/OracleContext.cs
BlankenshipG 0532d8d981 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>
2026-10-18 15:59:53 -04:00

85 lines
4.7 KiB
C#

using System;
using RynthCore.Plugin.RynthAi;
using RynthCore.Plugin.RynthOracle.Data;
using RynthCore.PluginSdk;
namespace RynthCore.Plugin.RynthOracle;
/// <summary>Everything the views read and the actions they can take. Pump thread only.</summary>
internal sealed class OracleContext
{
public RynthCoreHost Host;
public readonly OracleSettings Settings = new();
public readonly QuestFlagStore Flags = new();
public readonly QuestCatalog Catalog = new();
public readonly QuestCatalogUpdater Updater = new();
/// <summary>This character's tracked quests and recorded rewards (loaded once the name is known).</summary>
public readonly QuestBook Book = new();
public readonly CharacterSnapshot Character = new();
public readonly VoidTracker Void = new();
public readonly FellowshipTracker Fellowship = new();
public readonly ServerIdentity Server = new();
/// <summary>RynthILT's server profile (Leaftide features, fellowship rules); None without RynthILT.</summary>
public readonly IltServerLink Ilt = new();
/// <summary>RynthILT's "RynthILT.Data" (the Character tab's charms list and Toggle buttons).</summary>
public readonly RynthCore.Plugin.Shared.RynthIltDataClient IltData = new();
/// <summary>The charms RynthILT last reported (None without RynthILT); read while the Character tab shows.</summary>
public RynthCore.Plugin.Shared.IltCharmsView Charms = RynthCore.Plugin.Shared.IltCharmsView.None;
/// <summary>RynthAi's session (the one session every tracker shows); read while the Character tab shows.</summary>
public readonly RynthCore.Plugin.Shared.RynthAiSessionClient AiSession = new();
/// <summary>The last session RynthAi reported; SessionKnown false without RynthAi.</summary>
public RynthCore.Plugin.Shared.SessionStatsV1 Session;
public bool SessionKnown;
/// <summary>The last charm Toggle's outcome, shown under the charms list.</summary>
public string CharmMessage = "";
/// <summary>RynthILT's pet breeding tracker (None without it); read while the Pet Breeding tab shows.</summary>
public RynthCore.Plugin.Shared.IltBreedingView Breeding = RynthCore.Plugin.Shared.IltBreedingView.None;
/// <summary>The last breeding button's outcome, shown under the tab's buttons.</summary>
public string BreedingMessage = "";
/// <summary>Set by the plugin: sends a verb to RynthILT's breeding tracker (RynthIltDataApi PetBreedingCommand).</summary>
public Func<string, bool> BreedingCommand = _ => false;
/// <summary>RynthCore's server list (API v86) and the active server owner's settings; State null on older engines.</summary>
public readonly RynthCore.Plugin.Shared.ServerStateClient ServerState = new();
/// <summary>ConquestAC-only data (tag Conquest); fed only while on ConquestAC.</summary>
public readonly ConquestData Conquest = new();
/// <summary>Aelrynth's leaderboards (tag Aelrynth); fed only while on Aelrynth.</summary>
public readonly AelrynthBoards Boards = new();
/// <summary>Titles the character holds (engine API v75); TitlesKnown false until the engine has the list.</summary>
public readonly System.Collections.Generic.HashSet<int> EarnedTitles = new();
public bool TitlesKnown;
public uint CurrentTitle;
public bool InWorld;
public long NowMs;
public DateTime UtcNow;
/// <summary>The last thing the quest list check said, shown on the About tab.</summary>
public string UpdaterMessage = "";
/// <summary>Set by the plugin: sends /myquests (reply hidden when the setting says so).</summary>
public Action RequestQuests = () => { };
/// <summary>Set by the plugin: sends a chat command to the server as if typed (the views' buttons).</summary>
public Func<string, bool> Send = _ => false;
/// <summary>Set by the plugin: asks RynthILT to use a carried charm or Guardian Hand (its toggle id).</summary>
public Func<uint, bool> ToggleCharm = _ => false;
/// <summary>Set by the plugin: runs a chat command through RynthCore's plugin dispatch (another plugin's window).</summary>
public Func<string, bool> RunCommand = _ => false;
/// <summary>Set by the plugin: shows or hides the Quest Timers window.</summary>
public Action<bool> SetQuestTimersWindow = _ => { };
/// <summary>Set by the plugin: whether the Quest Timers window is showing.</summary>
public Func<bool> QuestTimersWindowVisible = () => false;
public Func<uint, int> Props => id => Character.Int(Host, id);
/// <summary>A line in the player's chat window only (nothing is sent to the server).</summary>
public void Print(string text)
{
if (!Host.WriteToChat("[RynthOracle] " + text, 1))
Host.Log("[RynthOracle] " + text);
}
}