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

HUDBlueprintPlacer

Extends:

BaseHUDPart → HUDBlueprintPlacer

Member Summary

Public Members
public
public
public

currentBlueprint: TypedTrackedState<Blueprint>

public
public
public

Method Summary

Public Methods
public
public

Called when an array of bulidings was selected

public

createElements(parent: *)

public

draw(parameters: DrawParameters)

public
public

Called when the blueprint was changed

public

Called when the blueprint is now affordable or not

public

onEditModeChanged(layer: Layer)

Called when the layer was changed

public

onMouseDown(pos: Vector, button: enumMouseButton): *

mouse down pre handler

public

Mose move handler

public

Attempts to paste the last blueprint

public

Attempts to rotate the current blueprint

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 Members

public costDisplayParent: * source

public costDisplayText: * source

public currentBlueprint: TypedTrackedState<Blueprint> source

public domAttach: * source

public lastBlueprintUsed: Blueprint source

public trackedCanAfford: * source

Public Methods

public abortPlacement(): * source

Return:

*

public createBlueprintFromBuildings(uids: Array<number>) source

Called when an array of bulidings was selected

Params:

NameTypeAttributeDescription
uids Array<number>

public createElements(parent: *) source

Should create all require elements

Override:

BaseHUDPart#createElements

Params:

NameTypeAttributeDescription
parent *

public draw(parameters: DrawParameters) source

Should draw the hud

Override:

BaseHUDPart#draw

Params:

NameTypeAttributeDescription
parameters DrawParameters

public initialize() source

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

Override:

BaseHUDPart#initialize

public onBlueprintChanged(blueprint: Blueprint) source

Called when the blueprint was changed

Params:

NameTypeAttributeDescription
blueprint Blueprint

public onCanAffordChanged(canAfford: boolean) source

Called when the blueprint is now affordable or not

Params:

NameTypeAttributeDescription
canAfford boolean

public onEditModeChanged(layer: Layer) source

Called when the layer was changed

Params:

NameTypeAttributeDescription
layer Layer

public onMouseDown(pos: Vector, button: enumMouseButton): * source

mouse down pre handler

Params:

NameTypeAttributeDescription
pos Vector
button enumMouseButton

Return:

*

public onMouseMove(): * source

Mose move handler

Return:

*

public pasteBlueprint() source

Attempts to paste the last blueprint

public rotateBlueprint() source

Attempts to rotate the current blueprint

public update() source

Should update any required logic

Override:

BaseHUDPart#update