Cleans up everything
Should close the element, in case its supported
Closes this element when its background is clicked
Calls closeMethod if an overlay is opened
Closes the overlay and aborts placement
Internal mouse/touch down pre handler
Draws the overlay, updates lots of stuff
Should draw any overlays (screen space)
Draws the placement helper which shows the free tiles
Draws the radius helper which shows the range of transporters
Finds a good next tile for placement which is directly next to the current tile
the new tile
Finds an initial spot to place the building on, starting at the screen center and searching in a circle arround it
Focuses the screen on a given tile
Forwards the game speed keybindings so you can toggle pause / Fastforward in the building tooltip and such
Forwards the map movement keybindings so you can move the map with the arrow keys
Forwards the game speed keybindings so you can toggle pause / Fastforward in the building tooltip and such
Returns the button to accept the placement
Initializes all keybindings and their labels on the elements
Creates a new client action to use
Initializes the placement helper canvas which shows the free tiles
Internal mouse/touch move pre handler
Moves the current tile by the given delta
delta tile x
delta tile y
Structure placed handler
Pinch pre handler, aborts pinch if dragging
Recomputes the placement helper canvas which shows the free tiles
Updates the placement error message, called from the trackedstate
Registers a new click detector
Rejects the placement
Rerenders the placement costs
Starts the placement on a given building
Helper method to construct a new click detector
The element to listen on
The handler to call on this object
Click detector arguments
Mouse/touch up handler
Updates the overlay
Accepts the placement of the building