Class TerrainPaintData
- Namespace
- GridPlacement.GDScript
- Assembly
- MoonBark.GridPlacement.GDScript.dll
Specialized [ManipulationData] for the TERRAIN action.\n\nCarries 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.\n\nLifecycle (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]
class TerrainPaintData extends ManipulationData
Properties
terrain_name
The terrain name to be painted (e.g. "dungeon_floor"). This is the single source of truth for terrain identification.
var terrain_name: StringName
terrain_set
The resolved terrain set index from the TileSet.
var terrain_set: int = -1
terrain
The resolved terrain index within the terrain set.
var terrain: int = -1
terrain_cell
The grid cell where the terrain will be painted. This enables per-cell cost deduction, undo journaling, and effects.
var terrain_cell: Vector2i
target_map
The TileMapLayer where the terrain will be painted.
var target_map: TileMapLayer
vetoed
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.
var vetoed: bool = false
Methods
veto
func veto() -> void: