Home Reference Source
import {HUDModalDialogs} from 'shapez.io/js/game/hud/parts/modal_dialogs.js'
public class | source

HUDModalDialogs

Extends:

BaseHUDPart → HUDModalDialogs

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public

Method Summary

Public Methods
public
public

close()

public

closeDialog(dialog: *)

public

createElements(parent: *): *

public
public

initializeToElement(element: *)

public

internalShowDialog(dialog: *)

public
public
public
public

showFeatureRestrictionInfo(feature: string, textPrefab: string): *

public

showInfo(title: string, text: string, buttons: Array<string>): *

public
public

showOptionChooser(title: *, options: *): *

public

showWarning(title: string, text: string, buttons: Array<string>): *

public

update()

Inherited Summary

From class BaseHUDPart
public
public

root: *

public

Cleans up the hud element, if overridden make sure to call super.cleanup

public

Cleans up all click detectors

public

close()

Should close the element, in case its supported

public

closeOnBackgroundClick(element: HTMLElement, closeMethod: function)

Closes this element when its background is clicked

public

createElements(parent: HTMLElement)

Should create all require elements

public

draw(parameters: DrawParameters)

Should draw the hud

public

Should draw any overlays (screen space)

public

Forwards the game speed keybindings so you can toggle pause / Fastforward in the building tooltip and such

public

Forwards the map movement keybindings so you can move the map with the arrow keys

public

Should initialize the element, called after the elements have been created

public

Should return true if this overlay is open and currently blocking any user interaction

public

Registers a new click detector

public

Should return false if the game should be paused

public

Should return true if the widget has a modal dialog opened and thus the game does not need to update / redraw

public

trackClicks(element: Element, handler: function, args: import("../../core/click_detector").ClickDetectorConstructorArgs=)

Helper method to construct a new click detector

public

update()

Should update any required logic

Public Constructors

public constructor() source

Override:

BaseHUDPart#constructor

Public Members

public app: Application source

public dialogParent: * source

public dialogStack: *[] source

public domWatcher: * source

Public Methods

public cleanup() source

Cleans up the hud element, if overridden make sure to call super.cleanup

Override:

BaseHUDPart#cleanup

public close() source

Should close the element, in case its supported

Override:

BaseHUDPart#close

public closeDialog(dialog: *) source

Params:

NameTypeAttributeDescription
dialog *

public createElements(parent: *): * source

Should create all require elements

Override:

BaseHUDPart#createElements

Params:

NameTypeAttributeDescription
parent *

Return:

*

public initialize() source

Should initialize the element, called after the elements have been created

Override:

BaseHUDPart#initialize

public initializeToElement(element: *) source

Params:

NameTypeAttributeDescription
element *

public internalShowDialog(dialog: *) source

Params:

NameTypeAttributeDescription
dialog *

public isBlockingOverlay(): * source

Should return true if this overlay is open and currently blocking any user interaction

Override:

BaseHUDPart#isBlockingOverlay

Return:

*

public shouldPauseGame(): * source

Should return false if the game should be paused

Override:

BaseHUDPart#shouldPauseGame

Return:

*

public shouldPauseRendering(): * source

Should return true if the widget has a modal dialog opened and thus the game does not need to update / redraw

Override:

BaseHUDPart#shouldPauseRendering

Return:

*

public showFeatureRestrictionInfo(feature: string, textPrefab: string): * source

Params:

NameTypeAttributeDescription
feature string
textPrefab string

Return:

*

public showInfo(title: string, text: string, buttons: Array<string>): * source

Params:

NameTypeAttributeDescription
title string
text string
buttons Array<string>

Return:

*

public showLoadingDialog(): * source

Return:

*

public showOptionChooser(title: *, options: *): * source

Params:

NameTypeAttributeDescription
title *
options *

Return:

*

public showWarning(title: string, text: string, buttons: Array<string>): * source

Params:

NameTypeAttributeDescription
title string
text string
buttons Array<string>

Return:

*

public update() source

Should update any required logic

Override:

BaseHUDPart#update