feat(D.2b): IUiRegistry plugin UI surface + buffered drain into UiHost
Adds the plugin-facing UI registration surface (Task 9, final D.2b task). Plugins call host.Ui.AddMarkupPanel(path, binding) from Enable(); calls are buffered in BufferedUiRegistry before the GL window opens, then drained into UiHost.Root in GameWindow.OnLoad inside the RetailUi block after the first- party vitals panel. Faulty plugin markup is isolated (try/catch per panel, logged + skipped). IPluginHost.Ui added; AppPluginHost wired; StubHost in Core.Tests updated; BufferedUiRegistryTests confirms drain-once semantics. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
07bf6cbf60
commit
019350fa31
8 changed files with 102 additions and 4 deletions
|
|
@ -10,4 +10,5 @@ public interface IPluginHost
|
|||
IPluginLogger Log { get; }
|
||||
IGameState State { get; }
|
||||
IEvents Events { get; }
|
||||
IUiRegistry Ui { get; }
|
||||
}
|
||||
|
|
|
|||
14
src/AcDream.Plugin.Abstractions/IUiRegistry.cs
Normal file
14
src/AcDream.Plugin.Abstractions/IUiRegistry.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
namespace AcDream.Plugin.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin-facing UI registration. A plugin ships a markup file (KSML-style) +
|
||||
/// a binding object exposing the data properties the markup binds to, and
|
||||
/// registers it from <c>Enable()</c>. Calls made before the GL window opens are
|
||||
/// buffered and drained once the UI host exists.
|
||||
/// </summary>
|
||||
public interface IUiRegistry
|
||||
{
|
||||
/// <param name="markupPath">Absolute path to the plugin's panel markup file.</param>
|
||||
/// <param name="binding">Object whose properties the markup's {Bindings} resolve against.</param>
|
||||
void AddMarkupPanel(string markupPath, object binding);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue