feat(ui): centralize retail selection state

This commit is contained in:
Erik 2026-07-11 00:51:20 +02:00
parent c7607f019c
commit 7983309d23
30 changed files with 591 additions and 108 deletions

View file

@ -10,5 +10,6 @@ public interface IPluginHost
IPluginLogger Log { get; }
IGameState State { get; }
IEvents Events { get; }
ISelectionService Selection { get; }
IUiRegistry Ui { get; }
}

View file

@ -0,0 +1,19 @@
namespace AcDream.Plugin.Abstractions;
/// <summary>A plugin-safe selection transition matching retail's selected-target callback.</summary>
public readonly record struct SelectionChangedEvent(
uint? PreviousObjectId,
uint? SelectedObjectId);
/// <summary>
/// Shared selected-object service. Plugins read and change the same selection
/// used by the world, radar, inventory, paperdoll, and toolbar.
/// </summary>
public interface ISelectionService
{
uint? SelectedObjectId { get; }
uint? PreviousObjectId { get; }
event Action<SelectionChangedEvent> Changed;
bool Select(uint objectId);
bool Clear();
}