import {HUDBuildingPlacer} from 'shapez.io/js/game/hud/parts/building_placer.js'HUDBuildingPlacer
Extends:
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
domAttach: * |
|
| public |
element: * |
|
| public |
|
|
| public |
Stores the click detectors for the variants so we can clean them up later |
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
cleanup() |
|
| public |
Cleans up all variant click detectors |
|
| public |
createElements(parent: HTMLElement) |
|
| public |
draw(parameters: DrawParameters) |
|
| public |
drawDirectionLock(parameters: DrawParameters) |
|
| public |
drawLayerPeek(parameters: DrawParameters) |
|
| public |
drawMatchingAcceptorsAndEjectors(parameters: DrawParameters) |
|
| public |
drawRegularPlacement(parameters: DrawParameters) |
|
| public |
|
|
| public |
makeLockIndicatorSprite(layer: Layer): * Makes the lock indicator sprite for the given layer |
|
| public |
Rerenders the building info dialog |
|
| public |
Rerenders the variants displayed |
|
Inherited Summary
| From class BaseHUDPart | ||
| public |
|
|
| public |
root: * |
|
| public |
cleanup() 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 |
drawOverlays(parameters: DrawParameters) Should draw any overlays (screen space) |
|
| public |
forwardGameSpeedKeybindings(sourceMapper: KeyActionMapper) Forwards the game speed keybindings so you can toggle pause / Fastforward in the building tooltip and such |
|
| public |
forwardMapMovementKeybindings(sourceMapper: KeyActionMapper) 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 |
|
| From class HUDBuildingPlacerLogic | ||
| public get |
Returns the current base rotation for the current meta-building. |
|
| public set |
currentBaseRotation(rotation: number) Sets the base rotation for the current meta-building. |
|
| public get |
Returns the current direction lock corner, that is, the corner between mouse and original start point |
|
| public get |
Returns if the direction lock is currently active |
|
| public |
The current rotation |
|
| public |
The side for direction lock |
|
| public |
Whether the side for direction lock has not yet been determined. |
|
| public |
currentMetaBuilding: TypedTrackedState<MetaBuilding> The current building |
|
| public |
currentVariant: TypedTrackedState<string> Current building variant |
|
| public |
Whether we are currently drag-deleting |
|
| public |
Whether we are currently dragging |
|
| public |
We use a fake entity to get information about how a building will look once placed |
|
| public |
|
|
| public |
The tile we last dragged from |
|
| public |
The current rotation preference for each building. |
|
| public |
Stores which variants for each building we prefer, this is based on what the user last selected |
|
| public |
signals: {"variantChanged": *, "draggingStarted": *} |
|
| public |
Aborts any dragging |
|
| public |
abortPlacement(): * Aborts the placement |
|
| public |
checkForDirectionLockSwitch(args: any) Checks if the direction lock key got released and if such, resets the placement |
|
| public |
computeDirectionLockPath(): Array<{tile: Vector, rotation: number}>{tile:> Finds the path which the current direction lock will use |
|
| public |
Cycles through the variants |
|
| public |
Tries to delete the building under the mouse |
|
| public |
Performs the direction locked placement between two points after releasing the mouse |
|
| public |
Initializes the logic |
|
| public |
Initializes all bindings |
|
| public |
onEditModeChanged(layer: Layer) Called when the edit mode got changed |
|
| public |
onMouseDown(pos: Vector, button: enumMouseButton): * mouse down pre handler |
|
| public |
onMouseMove(pos: Vector): * mouse move pre handler |
|
| public |
Mouse up handler |
|
| public |
onSelectedMetaBuildingChanged(metaBuilding: MetaBuilding) Called when the selected buildings changed |
|
| public |
setVariant(variant: string) Sets the current variant to the given variant |
|
| public |
Starts the pipette function |
|
| public |
startSelection(metaBuilding: MetaBuilding) Selects a given building |
|
| public |
Switches the side for the direction lock manually |
|
| public |
tryPlaceCurrentBuildingAt(tile: Vector): boolean Tries to place the current building at the given tile |
|
| public |
Tries to rotate the current building |
|
| public |
update() |
|
Public Members
public buildingInfoElements: {} source
public currentInterpolatedCornerTile: * source
public domAttach: * source
public element: * source
public lockIndicatorSprites: {} source
public variantClickDetectors: Array<ClickDetectorConstructorArgs> source
Stores the click detectors for the variants so we can clean them up later
public variantsAttach: * source
public variantsElement: * source
Public Methods
public cleanup() source
Cleans up the hud element, if overridden make sure to call super.cleanup
Override:
BaseHUDPart#cleanuppublic createElements(parent: HTMLElement) source
Should create all require elements
Override:
BaseHUDPart#createElementsParams:
| Name | Type | Attribute | Description |
| parent | HTMLElement |
public draw(parameters: DrawParameters) source
Should draw the hud
Override:
BaseHUDPart#drawParams:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawDirectionLock(parameters: DrawParameters) source
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawLayerPeek(parameters: DrawParameters) source
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawMatchingAcceptorsAndEjectors(parameters: DrawParameters) source
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawRegularPlacement(parameters: DrawParameters) source
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public makeLockIndicatorSprite(layer: Layer): * source
Makes the lock indicator sprite for the given layer
Params:
| Name | Type | Attribute | Description |
| layer | Layer |
Return:
| * |
