Skip to main content

_DialogCraftedMenu <T>

Hierarchy

Index

Constructors

constructor

  • Type parameters

    • T: string

    Parameters

    • mode: T

      The name of the mode associated with this instance

    Returns _DialogCraftedMenu<T>

Properties

_initProperties

_initProperties: { C: Character; focusGroup: AssetItemGroup } = null

An object for storing all of this classes init properties.

Subclasses should generally implement a public getter/setter interface for safely manipulating each property stored herein.


Type declaration

_initPropertyNames

_initPropertyNames: readonly [C, focusGroup] = ...

A list of all init property names as supported by this class. Represents the set of keys that will be stored in _initProperties

@abstract

clickStatusCallbacks

clickStatusCallbacks: Record<string, (C: Character, clickedObj: any, equippedItem?: Item) => string> = {}

readonlydefaultShape

defaultShape: readonly [number, number, number, number] = ...

The default position & shape of the current subscreen as defined by the root element.

See DialogMenu.shape.

eventListeners

eventListeners: { _ClickButton: (this: HTMLButtonElement, ev: MouseEvent) => string; _ClickDisabledButton: (this: HTMLButtonElement, ev: MouseEvent) => string; _ClickPaginateNext: (this: HTMLButtonElement, ev: MouseEvent) => void; _ClickPaginatePrev: (this: HTMLButtonElement, ev: MouseEvent) => void; _WheelGrid: (this: HTMLDivElement, event: WheelEvent) => void }

An object containg all event listeners referenced in the DialogMenu subclass.


Type declaration

  • _ClickButton: (this: HTMLButtonElement, ev: MouseEvent) => string
    @returns

    A status message if an unexpected error is encountered and null otherwise

      • (this: HTMLButtonElement, ev: MouseEvent): string
      • Parameters

        • this: HTMLButtonElement
        • ev: MouseEvent

        Returns string

  • _ClickDisabledButton: (this: HTMLButtonElement, ev: MouseEvent) => string
    @returns

    A status message if an expected error is encountered and null otherwise

      • (this: HTMLButtonElement, ev: MouseEvent): string
      • Parameters

        • this: HTMLButtonElement
        • ev: MouseEvent

        Returns string

  • _ClickPaginateNext: (this: HTMLButtonElement, ev: MouseEvent) => void
      • (this: HTMLButtonElement, ev: MouseEvent): void
      • Parameters

        • this: HTMLButtonElement
        • ev: MouseEvent

        Returns void

  • _ClickPaginatePrev: (this: HTMLButtonElement, ev: MouseEvent) => void
      • (this: HTMLButtonElement, ev: MouseEvent): void
      • Parameters

        • this: HTMLButtonElement
        • ev: MouseEvent

        Returns void

  • _WheelGrid: (this: HTMLDivElement, event: WheelEvent) => void

    Provide more consistent mouse wheel scroll behavior by using browser-independent increments.

      • (this: HTMLDivElement, event: WheelEvent): void
      • Parameters

        • this: HTMLDivElement
        • event: WheelEvent

        Returns void

ids

ids: Readonly<{ crafter: dialog-crafted-crafter; description: dialog-crafted-description; footer: dialog-crafted-footer; gap: dialog-crafted-gap; icon: dialog-crafted-icon; info: dialog-crafted-info; name: dialog-crafted-name; private: dialog-crafted-private; property: dialog-crafted-property; root: dialog-crafted; status: dialog-crafted-status }> = ...

An object containg all DOM element IDs referenced in the DialogMenu subclass.

@abstract

readonlymode

mode: T

The name of the mode associated with this instance (see DialogMenuMode).

Accessors

C

  • get C(): PropType[C]
  • set C(value: PropType[C]): void
  • Get or set the currently selected character.

    Performs a hard DialogMenu.Reload if a new character is assigned.


    Returns PropType[C]

  • Parameters

    • value: PropType[C]

    Returns void

focusGroup

  • Get or set the currently selected group.

    Performs a hard DialogMenu.Reload if a new focus group is assigned.


    Returns AssetItemGroup

  • Parameters

    Returns void

shape

  • Get or set the position & shape of the current subscreen as defined by the root element.

    Performs a DialogMenu.Resize if a new shape is assigned.


    Returns RectTuple

  • Parameters

    Returns void

Methods

Click

  • Click(event: MouseEvent | TouchEvent): void
  • Parameters

    • event: MouseEvent | TouchEvent

    Returns void

Draw

  • Draw(): void
  • Returns void

Exit

  • Exit(): void
  • Returns void

GetClickStatus

  • GetClickStatus(C: Character, clickedObj: null, equippedItem?: Item): string
  • Return an error status (if any) for when an item or activity is clicked.

    Error statuses are used for evaluating whether the relevant grid buttons must be disabled or not.


    Parameters

    • C: Character

      The target character

    • clickedObj: null

      The item that is clicked

    • equippedItem: Item = null

      The item that is equipped (if any)

    Returns string

    • The error status or null if everything is ok

Init

  • Initialize the DialogMenu subscreen.

    Serves as a ScreenLoadHandler wrapper with added parameters.


    Parameters

    Returns HTMLDivElement

    The div containing the dialog subscreen root element or null if the screen failed to initialize

KeyDown

  • KeyDown(event: KeyboardEvent): boolean
  • Parameters

    • event: KeyboardEvent

    Returns boolean

Load

  • Load(): void
  • Returns void

Reload

  • Reload the subscreen, updating the DOM elements and, if required, re-assigning the character and focus group.


    Parameters

    Returns Promise<boolean>

    • Whether an update was triggered or aborted

Resize

  • Resize(load: boolean): void
  • Parameters

    • load: boolean

    Returns void

Run

  • Run(time: number): void
  • Parameters

    • time: number

    Returns void

Unload

  • Unload(): void
  • Returns void

_ClickButton

  • _ClickButton(button: HTMLButtonElement, C: Character, clickedObj: null, equippedItem: Item): void
  • Helper function for handling the clicks of succesfully validated grid button clicks.

    @abstract

    Parameters

    • button: HTMLButtonElement

      The clicked button

    • C: Character

      The target character

    • clickedObj: null

      The buttons underlying object (item or activity)

    • equippedItem: Item

      The currently equipped item

    Returns void

_ConstructPaginateButtons

  • _ConstructPaginateButtons(id: string): HTMLDivElement

  • Parameters

    • id: string

    Returns HTMLDivElement

_GetClickedObject

  • _GetClickedObject(button: HTMLButtonElement): null
  • Return the underlying item or activity object of the passed grid button.

    @abstract

    Parameters

    • button: HTMLButtonElement

      The clicked button

    Returns null

    • The button's underlying item or activity object

_Load

  • _Load(): HTMLElement
  • Construct and return the (unpopulated) DialogMenu.ids.root element.

    @abstract

    Returns HTMLElement

_Reload

_ReloadButtonGrid

  • _ReloadButtonGrid(root: HTMLElement, buttonGrid: HTMLElement, properties: { C: Character; focusGroup: AssetItemGroup }, options: Pick<ReloadOptions, reset | resetScrollbar | resetDialogItems>): void

_ReloadIcon

_ReloadMenubar

_ReloadStatus

_ReloadValidate