Skip to main content

DialogMenu

Index

Interfaces

InitProperties

InitProperties:

All valid init properties that a DialogMenu subclass may choose to implement.

Init properties represent a set of DialogMenu.Init-initialized properties which are exclusively active during the matching screen's lifetime.

C

optionalfocusGroup

focusGroup?: AssetGroup

MenuButtonData

MenuButtonData<T>:

Type parameters

click

click: (button: HTMLButtonElement, ev: MouseEvent, properties: T, equippedItem?: Item) => any

Type declaration

    • (button: HTMLButtonElement, ev: MouseEvent, properties: T, equippedItem?: Item): any
    • Parameters

      • button: HTMLButtonElement

        The button in question

      • ev: MouseEvent

        The mouse event associated with the button click

      • properties: T

        The InitProperties associated with the specific dialog menu

      • optionalequippedItem: Item

        The equipped item in question (if any)

      Returns any

optionalvalidate

validate?: Record<string, MenuButtonValidator<T>>

An object mapping labels to custom validation functions for button clicks.

MenuButtonValidateData

MenuButtonValidateData:

An object representing the validation output of a menubar button, determining whether it should be clickable or not

state

state: hidden | disabled

The button's validation state:

  • null: Validation successful
  • "hide": Validation failure; hide the button
  • "disabled": Validation failure; disable the button but do not hide it

optionalstatus

status?: string

An optional status message to-be returned if the validation fails.

ReloadOptions

ReloadOptions:

Customization options for DialogMenu.Reload

optionalreset

reset?: boolean

Whether to hard reset and reconstruct the button grid, rather than just re-evaluating the existing button's states via a soft reset.

optionalresetDialogItems

resetDialogItems?: boolean

Whether to regenerate the subscreen's underlying item or activity list (see DialogBuildActivities and DialogInventoryBuild).

Defaults to true if ReloadOptions.reset is specified.

optionalresetScrollbar

resetScrollbar?: boolean

Reset the position of the scroll bar to the checked button, or, if unavailable, the top of the button grid.

Defaults to true if ReloadOptions.reset is specified.

optionalstatus

status?: string

The to-be assigned custom status message

optionalstatusTimer

statusTimer?: number

Display the ReloadOptions.status message on a timer; units are in ms

ReloadParam

ReloadParam<T>:

Internal DialogMenu.Reload parameters for dialog subscreens without a focus group


Type parameters

newProperties

newProperties: T

oldProperties

oldProperties: T

root

root: HTMLElement

textCache

textCache: TextCache

Type Aliases

MenuButtonValidator

MenuButtonValidator<T>: (button: HTMLButtonElement, properties: T, equippedItem?: Item | null) => MenuButtonValidateData | null

A custom validation function for determining whether the button should be enabled, disabled or hidden.

@returns

A nullish object if the validation passes or an object representing the validation state


Type parameters

Type declaration

    • Parameters

      • button: HTMLButtonElement

        The button in question

      • properties: T

        The InitProperties associated with the specific dialog menu

      • optionalequippedItem: Item | null

        The equipped item in question (if any)

      Returns MenuButtonValidateData | null