Table of Contents

Class ManipulationState

Namespace
GridPlacement.GDScript
Assembly
MoonBark.GridPlacement.GDScript.dll
class ManipulationState extends PlacementResource
ManipulationState

Properties

refunders

Registered [Refunder] consumers (5.1.0-D). Each is called from the [signal pre_demolish] handler with the live target and the [BuildCost] stamped at placement time; any refunder returning true vetoes the demolish. Consumers append on bootstrap: [code]container.get_states().manipulation.refunders.append(MyRefunder.new())[/code]

var refunders: Array[Refunder] = []

cost

var cost: BuildCost = BuildCost.resolve_for(p_data.demolish_target)

data

Data of the active manipulation

var data: ManipulationData:

active_manipulatable

The current targeted (hovered, etc) manipulatable component, if any

var active_manipulatable: Manipulatable:

active_target_node

Compatibility alias required by older tests referencing 'current_target'. Accepts either a Manipulatable directly or a Node/Node2D whose descendant has a Manipulatable.

var active_target_node: Node:

m

var m: Manipulatable = PlacementSearchUtils.find_first(value, Manipulatable)

parent

Node which is actually manipulated to effect all children including the active target node and any other nodes that need to move to be updated with the base The ManipulationParent node responsible for coordinating transforms during manipulation. Enforces ManipulationParent class to ensure proper transform coordination methods are available. This ensures indicators rotate/flip with manipulated objects via transform inheritance.

var parent: ManipulationParent:

parent_3d

3D mirror of [member parent].

var parent_3d: ManipulationParent3D:

passing

var passing = true

issues

var issues: Array[String] = []

issues

var issues: Array[String] = []

Methods

get_manipulator

func get_manipulator() -> PlacementOwner:

Returns

set_targeted

func set_targeted(p_node : Node) -> void:

Parameters

p_node

Returns

is_targeted_movable

func is_targeted_movable() -> bool:

Returns

validate_setup

func validate_setup() -> bool:

Returns

get_editor_issues

func get_editor_issues() -> Array[String]:

Returns

get_runtime_issues

func get_runtime_issues() -> Array[String]:

Returns

Events

data_changed

The manipulation state holds reference to the object being manipulated and its temporary manipulated copy. It also is the source of signals regarding object manipulation like when moving or demolishing an object is started, canceled, or stopped. Emitted when the active manipulation on an object changes Null means there is no manipulation currently active on the state.

signal data_changed(manipulation: ManipulationData)

active_manipulatable_changed

The manipulatable that is being hovered over

signal active_manipulatable_changed(active: Manipulatable)

active_target_node_changed

Signal for when the currently active target node changes

signal active_target_node_changed(active: Node)

parent_changed

When the node for performing transform adjustments to (rotate, flip, etc) during a manipulation changes

signal parent_changed(parent: Node)

action_performed

Emitted when any manipulation action is performed (started, finished, failed, or canceled). Consolidated signal for new consumers. Compat shim: individual signals still emit for 5.1.0.

signal action_performed(data: ManipulationData)

started

Emitted when a manipulation action is started @deprecated Prefer [signal action_performed] for new connections.

signal started(data: ManipulationData)

pre_demolish

Emitted after demolish validation passes and before [code]queue_free[/code] runs. Listeners may call [code]data.veto()[/code] from this callback to cancel the demolition; the CANCELED status is then emitted and the [Node] is preserved. The data is always a [DemolishData] (the demolish path is the only path that fires this signal — move/rotate/flip do not). Additive in 5.1.0-C; existing [code]started[/code] / [code]finished[/code] / [code]failed[/code] timing is unchanged.

signal pre_demolish(data: DemolishData)

confirmed

Emitted when a manipulation action is confirmed

signal confirmed(data: ManipulationData)

finished

Emitted when a manipulation action is finished @deprecated Prefer [signal action_performed] for new connections.

signal finished(data: ManipulationData)

canceled

Emitted when a manipulation action is canceled @deprecated Prefer [signal action_performed] for new connections.

signal canceled(data: ManipulationData)

failed

Emitted when a manipulation action fails @deprecated Prefer [signal action_performed] for new connections.

signal failed(data: ManipulationData)