Manages placement mode state as a proper state machine. Replaces the overlapping BuildMode and PlaceSubmode enums in PlacementSystem, eliminating the mode-flap bug class caused by inconsistent state combinations and the "no place-pending value" hack. [b]States:[/b] IDLE — Not placing anything. Maps to ModeState.OFF ROUTER — PLACE mode active, waiting for tool/category selection OBJECT — Actively placing an object (placeable selected) TERRAIN — Actively painting terrain (terrain name selected) [b]Two-way sync with ModeState:[/b] Out: IDLE → OFF, all others → PLACE (canonical) In: non-PLACE/BUILD modes force IDLE (MOVE/DEMOLISH/INFO/OFF) Scene-free (extends RefCounted). Directly unit-testable.
Source: addons/grid_placement/systems/building/place_mode_machine.gd
Syntax
class PlaceModeMachine extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
state_changed | Event | Placement mode states. Emitted when placement state changes. |
current_state | Property | |
set_mode_state | Method | |
enter_idle | Method | |
enter_router | Method | |
enter_object | Method | |
enter_terrain | Method | |
is_active | Method | |
is_router | Method | |
is_placing_object | Method | |
is_painting_terrain | Method | |
old_state | Property |
Source
addons/grid_placement/systems/building/place_mode_machine.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs