_DialogPermissionMenu <T>
Hierarchy
- DialogMenu
- _DialogPermissionMenu
Index
Constructors
constructor
Type parameters
- T: string
Parameters
mode: T
Returns _DialogPermissionMenu<T>
Properties
clickStatusCallbacks
readonlydefaultShape
The default position & shape of the current subscreen as defined by the root element.
See DialogMenu.shape.
readonlyeventListeners
An object containg all event listeners referenced in the DialogMenu subclass.
Type declaration
_ClickButton: (this: HTMLButtonElement, ev: MouseEvent) => string
Parameters
this: HTMLButtonElement
ev: MouseEvent
Returns string
_ClickDisabledButton: (this: HTMLButtonElement, ev: MouseEvent) => string
Parameters
this: HTMLButtonElement
ev: MouseEvent
Returns string
_ClickPaginateNext: (this: HTMLButtonElement, ev: MouseEvent) => void
Parameters
this: HTMLButtonElement
ev: MouseEvent
Returns void
_ClickPaginatePrev: (this: HTMLButtonElement, ev: MouseEvent) => void
Parameters
this: HTMLButtonElement
ev: MouseEvent
Returns void
ids
An object containg all DOM element IDs referenced in the DialogMenu subclass.
readonlymode
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
value: Character
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
value: AssetItemGroup
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
value: RectTuple
Returns void
Methods
Click
Called if the user clicks on the canvas
Parameters
event: MouseEvent | TouchEvent
The event that triggered this
Returns void
Draw
Called each frame when the screen needs to be drawn.
Returns void
Exit
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
C: Character
The target character
clickedObj: DialogInventoryItem
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 ["Load"] wrapper with added parameters.
Parameters
C: Character
The character in question
focusGroup: AssetItemGroup
The focused item group
style: { shape?: RectTuple } = null
Misc styling for the subscreen
optionalshape: RectTuple
Returns HTMLDivElement
The div containing the dialog subscreen root element or
null
if the screen failed to initialize
KeyDown
Called if the the user presses any key
Parameters
event: KeyboardEvent
The event that triggered this
Returns boolean
Load
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
C: Character = null
The selected character; defaults to DialogMenu.C and will update the property inplace otherwise
focusGroup: AssetItemGroup = null
The selected group; defaults to DialogMenu.focusGroup and will update the property inplace otherwise
optionaloptions: ReloadOptions = null
Further customization options
Returns Promise<boolean>
- Whether an update was triggered or aborted
Resize
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
Called when this screen is being replaced
Returns void
_ClickButton
Helper function for handling the clicks of succesfully validated grid button clicks.
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
Parameters
id: string
Returns HTMLDivElement
_GetClickedObject
Return the underlying item or activity object of the passed grid button.
Parameters
button: HTMLButtonElement
The clicked button
Returns DialogInventoryItem
- The button's underlying item or activity object
_Load
Construct and return the (unpopulated) DialogMenu.ids.root element.
Returns HTMLElement
_ReloadButtonGrid
A DialogMenu.Reload helper function for reloading DialogMenu.ids.grid elements.
Parameters
root: HTMLElement
buttonGrid: HTMLElement
options: Pick<ReloadOptions, reset | resetScrollbar | resetDialogItems>
Returns void
_ReloadIcon
A DialogMenu.Reload helper function for reloading DialogMenu.ids.icon elements.
Parameters
root: HTMLElement
icon: HTMLElement
options: Pick<ReloadOptions, never>
Returns void
_ReloadStatus
A DialogMenu.Reload helper function for reloading DialogMenu.ids.status elements.
Parameters
root: HTMLElement
status: HTMLElement
options: Pick<ReloadOptions, status | statusTimer>
Returns void
The name of the mode associated with this instance