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 over

  • Signal: active_target_node_changed(active: Node) - Signal for when the currently active target node changes

  • Signal: 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 started

  • Signal: confirmed(data: ManipulationData) - Emitted when a manipulation action is confirmed

  • Signal: finished(data: ManipulationData) - Emitted when a manipulation action is finished

  • Signal: canceled(data: ManipulationData) - Emitted when a manipulation action is canceled

  • Signal: failed(data: ManipulationData) - Emitted when a manipulation action fails

Properties

  • Property: data: [ManipulationData](./manipulation-data/): - Data of the active manipulation

  • Property: active_manipulatable : [Manipulatable](./manipulatable/): - The current targeted (hovered, etc) manipulatable component, if any

  • Property: 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

1
get_manipulator() -> GBOwner

Gets the active manipulator from the _owner_context GBOwnerContext.


set_targeted

1
set_targeted(p_node : Node) -> void

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

1
is_targeted_movable() -> bool

Checks if the currently targeted manipulatable is movable.

return: bool - True if targeted object can be moved, false otherwise


validate_setup

1
validate_setup() -> bool

Checks if the state is ready for manipulation.


get_editor_issues

1
get_editor_issues() -> Array[String]

Returns an array of editor-time validation issues for this resource


get_runtime_issues

1
get_runtime_issues() -> Array[String]

Returns an array of runtime validation issues for this resource


Private Methods

_init

1
_init(p_owner_context: GBOwnerContext) -> void

Flags: private


_on_data_status_changed

1
_on_data_status_changed(p_status: GBEnums.Status)

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