acdream/src/AcDream.Plugins.MossTank/MossTankPlugin.cs
Erik ece2104189 chore(plugins): remove the Smoke gate plugin; MossTank shelf icon 0x06002C41
Owner direction 2026-09-06: the owner visually accepted all three connected
gates from the plugin-shelf/DAT-icon work — the movable plugin shelf
(Slice A), the DAT icon markup (Slice B), and the retained-UI outline-order
fix (761a7519f). With that gate passed, the Smoke plugin's job as the gate
artifact is done, so it is deleted outright rather than merely hidden:
src/AcDream.Plugins.Smoke/ (SmokePlugin.cs, SmokeIconPanel.cs, csproj, lock
files).

Reference sites cleaned:
- AcDream.slnx: removed the project entry.
- src/AcDream.App/AcDream.App.csproj: removed the Smoke ProjectReference and
  the CopySmokePluginToBuildOutput/CopySmokePluginToPublishOutput targets;
  the MossTank equivalents are untouched.
- .github/workflows/headless-portability.yml: the Linux package-contract
  step no longer asserts a Smoke plugin.dll/plugin.json pair — repointed at
  MossTank's, since the step's job was to prove the plugin-copy packaging
  mechanism works end to end, not specifically to prove Smoke.
- tests/AcDream.Core.Tests/Plugins/PluginManifestTests.cs: the inline JSON
  fixture used Smoke's manifest values as arbitrary test data; swapped for
  MossTank's so the parser test still proves the same thing.
- tests/AcDream.App.Tests/Rendering/LinuxPlatformBoundaryTests.cs: the
  shipped-plugin-copy shape test counted 4 GetTargetPath targets (Smoke +
  MossTank, build + publish); now 2 (MossTank only).
- tests/AcDream.App.Tests/Plugins/AppAutomationSurfaceIconInstalledDatTests.cs:
  reworded a doc comment that named the now-deleted SmokeIconPanel.
- README.md, docs/plugin-ui-markup.md: dropped Smoke-specific mentions,
  kept the icon markup example/grammar (now citing MossTank's own real
  IconSurfaceId).
- docs/plans/2026-09-06-plugin-shelf-and-dat-icons.md: recorded the owner's
  2026-09-06 acceptance and the Smoke removal in the review ledger; deleted
  the now-moot "before shipment" Smoke-in-release-zip warning.
- docs/reviews/coverage-ledger.md, docs/reviews/findings-ledger.md: left
  untouched — both are frozen audit snapshots ("complete for baseline
  <hash>"), so their Smoke rows are historical record, not live claims.
- docs/ISSUES.md: left untouched — its Smoke mentions are inside closed
  issue #193's historical write-up of a past investigation.

MossTank plugin shelf icon: MossTankPlugin.cs's PluginPanelDescriptor now
sets IconSurfaceId = 0x06002C41 (IconText = "MT" remains the fallback).
Verified against the installed retail DAT with a new InstalledDat-lane test,
tests/AcDream.App.Tests/UI/MossTankIconInstalledDatTests.cs, mirroring
RetailMarkupIconResolverInstalledDatTests's convention: confirms the id is a
real Portal/HighRes RenderSurface and that RetailMarkupIconResolver.ResolveDid
returns a non-zero texture for it.

Verified: dotnet build AcDream.slnx -c Release green; a stale
plugins/AcDream.Plugins.Smoke output folder from a prior build was deleted
and a fresh build does not recreate it. Full App suite: 7,363 passed / 97
skipped / 36 failed (was 7,362/97/36) — the failing set is unchanged and
none are plugin-related; the one new pass is the MossTank DAT-icon test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-06 16:49:17 +02:00

79 lines
2.7 KiB
C#

using AcDream.Plugin.Abstractions;
namespace AcDream.Plugins.MossTank;
/// <summary>
/// MossTank — a self-buffing plugin, and the first consumer of acdream's
/// plugin automation surface.
/// </summary>
/// <remarks>
/// Named for the mosswart, and for the Virindi Tank lineage this milestone is
/// modelled on. The buff policy lives here rather than in the host on purpose:
/// the host publishes spell data and a cast primitive, the plugin decides what
/// to cast. See <c>docs/research/2026-07-29-vtank-plugin-automation-requirements.md</c>.
/// </remarks>
public sealed class MossTankPlugin : IAcDreamPlugin
{
private IPluginHost? _host;
private MossTankPanel? _panel;
private Action<double>? _tick;
private IDisposable? _commandRegistration;
public void Initialize(IPluginHost host)
{
_host = host;
_panel = new MossTankPanel(host);
host.Log.Info("MossTank initialized");
}
public void Enable()
{
if (_host is null || _panel is null)
return;
// Markup ships beside the plugin assembly, so it is found relative to
// this DLL rather than the host's working directory -- plugins are
// loaded from their own directory and the two are not the same.
string directory =
Path.GetDirectoryName(typeof(MossTankPlugin).Assembly.Location) ?? ".";
_host.Ui.AddPanel(
new PluginPanelDescriptor("main", "MossTank")
{
IconText = "MT",
// A real installed portal.dat RenderSurface — see
// MossTankIconInstalledDatTests for the DAT-presence proof.
// IconText remains the fallback if this id is ever absent
// from an install.
IconSurfaceId = 0x06002C41u,
StartVisible = true,
ShowInSidePanel = true,
},
Path.Combine(directory, "mosstank.xml"),
_panel);
_commandRegistration = _host.Commands.Register(
"vt",
_panel.ExecuteVtankCommand);
_tick = _panel.OnTick;
_host.Events.Tick += _tick;
_host.Log.Info(
_host.Automation.IsAvailable
? "MossTank enabled"
: "MossTank enabled (no live session yet; the Buff button will "
+ "report 'Not in world' until one is up)");
}
public void Disable()
{
if (_host is not null && _tick is not null)
_host.Events.Tick -= _tick;
_commandRegistration?.Dispose();
_commandRegistration = null;
_tick = null;
_panel?.Disable();
_host?.Log.Info("MossTank disabled");
}
}