Skip to content

LSDE Dialog Engine / BlockHandlerArgs

Interface: BlockHandlerArgs<B, C> ​

Defined in: types.ts:473

Arguments passed to any block handler.

Remarks ​

Every block handler receives this common structure. The generic B parameter provides the block type (DialogBlock, ChoiceBlock, etc.) and C provides the type-specific context (DialogContext, ChoiceContext, etc.).

The engine uses a two-tier handler system:

  1. Tier 2 (scene): registered via handle.onDialog(), handle.onChoice(), etc.
  2. Tier 1 (global): registered via engine.onDialog(), engine.onChoice(), etc.

When a block is dispatched, the scene handler (Tier 2) is called first. The global handler (Tier 1) is then called after, unless context.preventGlobalHandler() was invoked.

A block-specific override via handle.onBlock(blockId, handler) takes highest priority.

See ​

Type Parameters ​

B ​

B extends BlueprintBlock

C ​

C extends BaseBlockContext

Properties ​

block ​

block: B

Defined in: types.ts:477

The block being executed, typed to match the handler (e.g. DialogBlock for onDialog).


context ​

context: C

Defined in: types.ts:479

Type-specific context providing actions for this block (e.g. selectChoice, resolve).


next ​

next: () => void

Defined in: types.ts:481

Advance the flow to the next block. Must be called exactly once to continue traversal.

Returns ​

void


scene ​

scene: SceneHandle

Defined in: types.ts:475

The scene handle that owns this block. Use it to inspect state, cancel the scene, etc.