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:
parent
0134122c28
commit
60387668d0
11 changed files with 269 additions and 16 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue