Scene-free intent mapper: converts raw InputEvents and placement state into discrete InputIntent values. The host's _unhandled_input becomes a thin forwarder that matches on the returned intent. Extracted to make the input-to-intent branching directly unit-testable without a scene runner. Usage: var handler := PlacementInputHandler.new() handler.configure(actions) var intent := handler.resolve(event, brush_state, has_entry, has_terrain, mode, box_enabled) handler.handle_intent(intent, host, is_in_mode)
Source: addons/grid_placement/systems/building/placement_input_handler.gd
Syntax
class PlacementInputHandler extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
DEMOLISH_BOX_CLICK_SLOP_PX | Field | How far a demolish box may grow before it stops being a plain click, in pixels. The box gesture is a drag-select; a box this small is the click the press would have been, and it must do what that press would have done. Raised from 6 after the gesture was reported as "a click turns into a drag box too easily": at 6 px a normal click's drift crossed it, which painted a red marquee and then refused with "no demolishable objects in the box" instead of demolishing the piece under the cursor. Nothing usable is drag-selected inside 12 px, so the larger threshold costs no real gesture. |
configure | Method | |
resolve | Method | |
is_in_mode | Property | |
is_demolish | Property | |
is_move | Property | |
hotkey | Property | |
transform | Property | |
release | Property | |
is_confirm_pressed | Method |