Anchored Hotbar Swap Controller
Reusable anchored hotbar swap state machine:
keep the first swap as restore anchor
swap selected inventory items into one fixed hotbar slot
restore anchor after no active switching for swapDelayProvider ticks
Constructors
Properties
Get the related CoroutineScope of receiver EventListener.
Returns whether the listenable is running or not, this is based on the parent listenable and if no parent is present, it will return the opposite of isDestructed.
Functions
Children EventListener
Clear a pending swap request when no inventory swap is needed this tick.
Returns computed ReadWriteProperty based on the accumulator of specific event.
Parent EventListener
Remove cached scope and cancel it.
Request swapping sourceSlot into the anchored hotbar slot on next inventory scheduling pass.
Registers an event hook for events of type T and launches a sequence
Start a Job on event.
Registers a repeatable sequence which repeats the execution of code on GameTickEvent.
Mark switching as still active, delaying restore countdown.
Unregisters the event handler from the manager. This decision is FINAL! After the class was unregistered we cannot restore the handlers.
Wrap the original interceptor and make it auto-detect the listener's running state at suspension to determine whether to resume the continuation.