Skip to main content

_DialogItemMenu <T>

Hierarchy

Index

Constructors

constructor

  • Type parameters

    • T: string

    Parameters

    • mode: T

      The name of the mode associated with this instance

    Returns _DialogItemMenu<T>

Properties

clickStatusCallbacks

clickStatusCallbacks: { AsylumGGTSControlItem: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; CanInteract: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; DialogAllowItemClick: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; DialogCanUnlock: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; InventoryBlockedOrLimited: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; InventoryChatRoomAllow: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; InventoryDisallow: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; InventoryGroupIsAvailable: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string; SelfBondage: (C: Character, clickedItem: DialogInventoryItem, equippedItem: Item) => string } = ...

Type declaration

readonlydefaultShape

defaultShape: readonly [1005, 120, 995, 857] = ...

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

See DialogMenu.shape.

readonlyeventListeners

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 }

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

ids

ids: Readonly<{ grid: dialog-inventory-grid; icon: dialog-inventory-icon; paginate: dialog-inventory-paginate; root: dialog-inventory; status: dialog-inventory-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 or set the currently selected character.

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


    Returns Character

  • Parameters

    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
  • Called if the user clicks on the canvas


    Parameters

    • event: MouseEvent | TouchEvent

      The event that triggered this

    Returns void

Draw

  • Draw(): void
  • Called each frame when the screen needs to be drawn.


    Returns void

Exit

  • Exit(): void
  • Called when user presses Esc


    Returns void

GetClickStatus

  • 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

    Returns string

    • The error status or null if everything is ok

Init

  • Initialize the DialogMenu subscreen.

    Serves as a ["Load"] 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
  • Called if the the user presses any key


    Parameters

    • event: KeyboardEvent

      The event that triggered this

    Returns boolean

Load

  • Load(): void
  • Called when screen is loaded using CommonSetScreen


    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
  • Called when screen size or position changes or after screen load


    Parameters

    • load: boolean

      If the reason for call was load (true) or window resize (false)

    Returns void

Unload

  • Unload(): void
  • Called when this screen is being replaced


    Returns void

_ClickButton

  • 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: DialogInventoryItem

      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

  • Return the underlying item or activity object of the passed grid button.

    @abstract

    Parameters

    • button: HTMLButtonElement

      The clicked button

    Returns DialogInventoryItem

    • The button's underlying item or activity object

_Load

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

    @abstract

    Returns HTMLElement

_ReloadButtonGrid

  • _ReloadButtonGrid(root: HTMLElement, buttonGrid: HTMLElement, options: Pick<ReloadOptions, reset | resetScrollbar | resetDialogItems>): void
  • A DialogMenu.Reload helper function for reloading DialogMenu.ids.grid elements.

    @abstract

    Parameters

    • root: HTMLElement
    • buttonGrid: HTMLElement
    • options: Pick<ReloadOptions, reset | resetScrollbar | resetDialogItems>

    Returns void

_ReloadIcon

  • _ReloadIcon(root: HTMLElement, icon: HTMLElement, options: Pick<ReloadOptions, never>): void

_ReloadStatus

  • _ReloadStatus(root: HTMLElement, status: HTMLElement, options: Pick<ReloadOptions, status | statusTimer>): void