feat(ui): drive toolbar use state from selection

Port the retail selected-object availability predicate into Core and project it through the shared interaction owner. The imported hand now follows canonical selection/object notices, keeps weapon and targeted-tool activation on the existing wield/use cursor paths, and ghosts empty or explicitly unusable selections per the connected UX requirement.

Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-23 08:07:47 +02:00
parent 0134122c28
commit 60387668d0
11 changed files with 269 additions and 16 deletions

View file

@ -496,6 +496,23 @@ public sealed class ItemInteractionController : IDisposable
return true;
}
/// <summary>
/// Projects retail <c>gmToolbarUI::HandleSelectionChanged @ 0x004BF380</c>
/// from the live selected object's public description. This is deliberately
/// a read-only query; activation still flows through <see cref="ActivateItem"/>.
/// </summary>
public bool IsToolbarUseEnabled(uint selectedObjectId)
{
if (selectedObjectId == 0
|| _objects.Get(selectedObjectId) is not { } item)
return false;
return ItemInteractionPolicy.IsToolbarUseEnabled(
item.Type,
item.CombatUse ?? 0,
item.Useability ?? ItemUseability.Undef);
}
public bool ActivateItem(uint itemGuid)
{
if (itemGuid == 0) return false;