HUDPinnedShapes
Extends:
Manages the pinned shapes on the left side of the screen
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Public Members | ||
| public |
element: * |
|
| public |
handles: Array<{ key: string, definition: ShapeDefinition, amountLabel: HTMLElement, lastRenderedValue: string, element: HTMLElement, detector?: ClickDetector, infoDetector?: ClickDetector, throughputOnly?: boolean }> Store handles to the currently rendered elements, so we can update them more convenient. |
|
| public |
Store a list of pinned shapes |
|
Method Summary
| Public Methods | ||
| public |
createElements(parent: *) |
|
| public |
deserialize(data: {shapes: Array<string>}): string Deserializes the pinned shapes |
|
| public |
findGoalValueForShape(key: string): * Finds the current goal for the given key. |
|
| public |
Initializes the hud component |
|
| public |
internalPinShape(param0: object) Pins a new shape |
|
| public |
isShapePinned(key: string): * Returns whether a given shape is currently pinned |
|
| public |
pinNewShape(definition: ShapeDefinition) Requests to pin a new shape |
|
| public |
Rerenders the whole component |
|
| public |
serialize(): {"shapes": *} Serializes the pinned shapes |
|
| public |
unpinShape(key: string) Unpins a shape |
|
| public |
update() Updates all amount labels |
|
| public |
Updates all shapes after an upgrade has been purchased and removes the unused ones |
|
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 |
|
Public Constructors
Public Members
public element: * source
public handles: Array<{ key: string, definition: ShapeDefinition, amountLabel: HTMLElement, lastRenderedValue: string, element: HTMLElement, detector?: ClickDetector, infoDetector?: ClickDetector, throughputOnly?: boolean }> source
Store handles to the currently rendered elements, so we can update them more convenient. Also allows for cleaning up handles.
Public Methods
public createElements(parent: *) source
Should create all require elements
Override:
BaseHUDPart#createElementsParams:
| Name | Type | Attribute | Description |
| parent | * |
public findGoalValueForShape(key: string): * source
Finds the current goal for the given key. If the key is the story goal, returns the story goal. If its the blueprint shape, no goal is returned. Otherwise it's searched for upgrades.
Params:
| Name | Type | Attribute | Description |
| key | string |
Return:
| * |
public isShapePinned(key: string): * source
Returns whether a given shape is currently pinned
Params:
| Name | Type | Attribute | Description |
| key | string |
Return:
| * |
public pinNewShape(definition: ShapeDefinition) source
Requests to pin a new shape
Params:
| Name | Type | Attribute | Description |
| definition | ShapeDefinition |
public unpinShape(key: string) source
Unpins a shape
Params:
| Name | Type | Attribute | Description |
| key | string |
public updateShapesAfterUpgrade() source
Updates all shapes after an upgrade has been purchased and removes the unused ones
