Resolved FeatureCatalog (both blocks kept; the main window's Tools buttons now open the Mossy Tracker and Metas panels). Tests from both sides adjusted to the combined plugin: quest tests look at quest frames only (chat is streamed too), and the stream tests ignore the /myquests request sent at login. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
67 lines
2.6 KiB
C#
67 lines
2.6 KiB
C#
using OpenAC.MosswartMassacre.Backend;
|
|
using OpenAC.MosswartMassacre.FlagTracker;
|
|
using OpenAC.MosswartMassacre.Infrastructure;
|
|
using OpenAC.MosswartMassacre.Metas;
|
|
using OpenAC.MosswartMassacre.Quests;
|
|
using OpenAC.MosswartMassacre.Streams;
|
|
using OpenAC.MosswartMassacre.Trackers;
|
|
|
|
namespace OpenAC.MosswartMassacre;
|
|
|
|
/// <summary>
|
|
/// Every feature the plugin runs, in the order the root logs them in. Each
|
|
/// slice of the port adds its features here and nowhere else.
|
|
/// </summary>
|
|
internal static class FeatureCatalog
|
|
{
|
|
public static void AddFeatures(MmContext context, BackendSession session, List<IMmFeature> features)
|
|
{
|
|
// Streams and session counters.
|
|
var delayed = new DelayedCommands(context);
|
|
var kills = new KillTracker(context.Clock);
|
|
var rares = new RareTracker(context, delayed);
|
|
var combat = new CombatStatsTracker(context);
|
|
var stats = new SessionStats(context, kills, rares);
|
|
var telemetry = new TelemetryStream(context, stats);
|
|
features.Add(stats);
|
|
features.Add(combat);
|
|
features.Add(new ChatRouter(context, kills, combat, rares));
|
|
features.Add(telemetry);
|
|
features.Add(new VitalsStream(context));
|
|
features.Add(new SpawnPortalStream(context));
|
|
features.Add(new BotControl(context));
|
|
var mainWindow = new Views.MainWindow(context, stats);
|
|
features.Add(mainWindow);
|
|
session.AddConnectionListener(telemetry);
|
|
|
|
// Cross-computer vital and debuff sharing.
|
|
var sharing = new Sharing.VitalSharing(context);
|
|
features.Add(sharing);
|
|
session.AddConnectionListener(sharing);
|
|
session.AddShareHandler(sharing);
|
|
features.Add(new Sharing.VitalSharingOverlay(context, sharing));
|
|
|
|
// The radar the backend turns on and off.
|
|
var radar = new Radar.RadarStream(context, cells: null);
|
|
features.Add(radar);
|
|
session.RadarToggle = on =>
|
|
{
|
|
if (on)
|
|
radar.Start();
|
|
else
|
|
radar.Stop();
|
|
};
|
|
|
|
// Quests, flag tracker, meta sync.
|
|
var quests = new QuestManager(context);
|
|
features.Add(quests);
|
|
var flagTracker = new FlagTrackerFeature(context, quests);
|
|
features.Add(flagTracker);
|
|
var metas = new MetaSyncFeature(context);
|
|
features.Add(metas);
|
|
if (flagTracker.Panel is { } trackerPanel)
|
|
mainWindow.FlagTrackerOpener = () => trackerPanel.IsVisible = true;
|
|
if (metas.Panel is { } metasPanel)
|
|
mainWindow.MetasOpener = () => metasPanel.IsVisible = true;
|
|
}
|
|
}
|