Specialized [ManipulationData] for the TERRAIN action. Carries the terrain name, resolved terrain set/terrain, target cell, and target map for painting operations. Exposes a [method veto] hook that listeners can call from the [signal PlacementState.pre_terrain_paint] callback to cancel the paint. Lifecycle (5.1.0-G): [codeblock] try_place_terrain_by_name: status = STARTED emit pre_terrain_paint(data) # listeners may call data.veto() if data.vetoed: status = CANCELED return apply_plan() status = FINISHED [/codeblock]
Source: addons/grid_placement/placement/terrain/terrain_paint_data.gd
Syntax
class TerrainPaintData extends ManipulationDataMembers
| Name | Kind | Summary |
|---|---|---|
terrain_name | Property | The terrain name to be painted (e.g. "dungeon_floor"). This is the single source of truth for terrain identification. |
terrain_set | Property | The resolved terrain set index from the TileSet. |
terrain | Property | The resolved terrain index within the terrain set. |
terrain_cell | Property | The grid cell where the terrain will be painted. This enables per-cell cost deduction, undo journaling, and effects. |
target_map | Property | The TileMapLayer where the terrain will be painted. |
vetoed | Property | True after any [signal PlacementState.pre_terrain_paint] listener calls [method veto]. [code]try_place_terrain_by_name[/code] checks this flag after the signal fires and short-circuits to [enum PlacementEnums.Status.CANCELED] when set, preserving the terrain from being painted. |
veto | Method |
Source
addons/grid_placement/placement/terrain/terrain_paint_data.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs