feat(ui): centralize retail selection state
This commit is contained in:
parent
c7607f019c
commit
7983309d23
30 changed files with 591 additions and 108 deletions
|
|
@ -10,5 +10,6 @@ public interface IPluginHost
|
|||
IPluginLogger Log { get; }
|
||||
IGameState State { get; }
|
||||
IEvents Events { get; }
|
||||
ISelectionService Selection { get; }
|
||||
IUiRegistry Ui { get; }
|
||||
}
|
||||
|
|
|
|||
19
src/AcDream.Plugin.Abstractions/ISelectionService.cs
Normal file
19
src/AcDream.Plugin.Abstractions/ISelectionService.cs
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue