Hotbar Activation
Client preparation helpers for server-authoritative hotbar entries.Members
activateHotbarSlot
Activate a client slot according to its serialized activation metadata. Locked and unusable slots are ignored. Unknown handlers fall back to the normal authoritativeuseSlot interaction.
- Source:
packages/client/src/services/hotbar.ts - Kind:
function
Signature
Parameters
context:HotbarActivationContext
Returns
A promise resolved after client preparation has completed.entry
Serializable authoritative entry reference.- Source:
packages/client/src/services/hotbar.ts - Kind:
property - Defined in:
HotbarClientSlot
Signature
index
Zero-based persistent slot index.- Source:
packages/client/src/services/hotbar.ts - Kind:
property - Defined in:
HotbarClientSlot
Signature
locked
Whether the slot is outside the player’s current capacity.- Source:
packages/client/src/services/hotbar.ts - Kind:
property - Defined in:
HotbarClientSlot
Signature
lockedHint
Optional player-visible explanation for unlocking the slot.- Source:
packages/client/src/services/hotbar.ts - Kind:
property - Defined in:
HotbarClientSlot
Signature
registerHotbarActivationHandler
Register a client preparation handler for a serialized hotbar activation id. Targeting modules can use this to prepare a target and callcontext.use()
without coupling the generic hotbar component to their gameplay rules.
- Source:
packages/client/src/services/hotbar.ts - Kind:
function
Signature
Parameters
id:stringhandler:HotbarActivationHandler
Returns
A function that restores the previous handler for the same id.Examples
select
Select the slot without using its entry.- Source:
packages/client/src/services/hotbar.ts - Kind:
method - Defined in:
HotbarActivationContext
Signature
slot
Slot being activated.- Source:
packages/client/src/services/hotbar.ts - Kind:
property - Defined in:
HotbarActivationContext
Signature
use
Ask the server to use the entry with optional serializable target data.- Source:
packages/client/src/services/hotbar.ts - Kind:
method - Defined in:
HotbarActivationContext
Signature
Parameters
target?:unknown