ManipulationState
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Source File: addons/grid_building/systems/manipulation/manipulation_state.gd
Extends: GBResource
Signals
Signal:
data_changed(manipulation: ManipulationData)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:
active_manipulatable_changed(active: Manipulatable)- The manipulatable that is being hovered overSignal:
active_target_node_changed(active: Node)- Signal for when the currently active target node changesSignal:
parent_changed(parent: ManipulationParent)When the node for performing transform adjustments to (rotate, flip, etc) during a manipulation changes
Signal:
started(data: ManipulationData)- Emitted when a manipulation action is startedSignal:
confirmed(data: ManipulationData)- Emitted when a manipulation action is confirmedSignal:
finished(data: ManipulationData)- Emitted when a manipulation action is finishedSignal:
canceled(data: ManipulationData)- Emitted when a manipulation action is canceledSignal:
failed(data: ManipulationData)- Emitted when a manipulation action fails
Properties
Property:
data: [ManipulationData](./manipulation-data/):- Data of the active manipulationProperty:
active_manipulatable : [Manipulatable](./manipulatable/):- The current targeted (hovered, etc) manipulatable component, if anyProperty:
active_target_node: Node:Compatibility alias required by older tests referencing ‘current_target’. Accepts either a Manipulatable directly or a Node/Node2D whose descendant has a Manipulatable.
Property:
parent: [ManipulationParent](./manipulation-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.
Private Properties
- Property:
_owner_context: [GBOwnerContext](./gb-owner-context/)(private) - Property:
_active_target_node: Node(private) - Internal backing field for active_target_node property
Public Methods
get_manipulator
Gets the active manipulator from the _owner_context GBOwnerContext.
set_targeted
Sets the target node. Either takes a regular node or a manipulatable. Will set both the active_target_node and the active_manipulatable if possible
is_targeted_movable
Checks if the currently targeted manipulatable is movable.
return: bool - True if targeted object can be moved, false otherwise
validate_setup
Checks if the state is ready for manipulation.
get_editor_issues
Returns an array of editor-time validation issues for this resource
get_runtime_issues
Returns an array of runtime validation issues for this resource
Private Methods
_init
Flags: private
_on_data_status_changed
Flags: private
Private handler for status changes in manipulation data. Emits specific signals for each status so other nodes like UI can respond.
p_status: GBEnums.Status - New status of the manipulation data