ManipulationSystem
Clears manipulation data reference when the provided data matches the active state.
Clears manipulation data reference when the provided data matches the active state.
Version: v5.0.0
Inherits: GBSystem
Source: manipulation_system.gd
Parsing: AST-based for maximum accuracy with symbol typing
Variables
_logger:
_physics_disabled_objects: Array[CollisionObject2D]
Objects with physics layers disabled during move operations.
Type: Array[CollisionObject2D]
Default: []
_systems_context: GBSystemsContext
Systems context for plugin integration.
Type: GBSystemsContext
_indicator_context: IndicatorContext
Placement context for validation and rules.
Type: IndicatorContext
_states: GBStates
Shared states for plugin systems.
Type: GBStates
_manipulation_settings: ManipulationSettings
Settings for manipulation system behavior (includes messages).
Type: ManipulationSettings
_actions: GBActions
Input actions configuration.
Type: GBActions
Signals
move_indicators_ready(indicators: Array[RuleCheckIndicator]: Variant)
Passes the array of created indicators for debugging and validation
Parameters:
indicators: Array[RuleCheckIndicator]: Variant
Methods
create_with_injection
Signature: static create_with_injection(p_parent : Node: Variant, container: GBCompositionContainer) -> ManipulationSystem
Creates a ManipulationSystem with dependency injection from container.
Returns: ManipulationSystem
Static: true
Parameters:
p_parent : Node: Variantcontainer: GBCompositionContainer
_are_dependencies_ready
Signature: _are_dependencies_ready() -> bool
Returns true if the system can safely process operations.
Returns: bool
get_runtime_issues
Signature: get_runtime_issues() -> Array
Returns: Array
resolve_gb_dependencies
Signature: resolve_gb_dependencies(p_container : GBCompositionContainer: Variant) -> void
Returns: void
Parameters:
p_container : GBCompositionContainer: Variant
_ensure_manipulation_settings
Signature: _ensure_manipulation_settings() -> void
The default will be replaced with the real settings when resolve_gb_dependencies() is called.
Returns: void
_check_dependencies_resolved
Signature: _check_dependencies_resolved() -> bool
Returns false and logs error if not resolved.
Returns: bool
_get_unsupported_node_type_message
Signature: _get_unsupported_node_type_message(p_node_class: String) -> String
[param p_node_class] The class name of the unsupported node
Returns: String
Parameters:
p_node_class: String
try_move
Signature: try_move(p_root : Node: Variant) -> ManipulationData
p_root: Node - Container node to search for Manipulatable component
Returns: ManipulationData
Parameters:
p_root : Node: Variant
_start_move
Signature: _start_move(p_data : ManipulationData: Variant) -> bool
Returns true if setup succeeded; false if rule setup failed.
Returns: bool
Parameters:
p_data : ManipulationData: Variant
try_placement
Signature: try_placement(p_move : ManipulationData: Variant) -> ValidationResults
p_move: ManipulationData - Movement data containing source and target information
Returns: ValidationResults
Parameters:
p_move : ManipulationData: Variant
is_ready
Signature: is_ready() -> bool
Checks if the manipulation system is ready for operations.
Returns: bool
cancel
Signature: cancel() -> void
Cancels the active manipulation action.
Returns: void
try_demolish
Signature: try_demolish(p_manipulatable: Manipulatable) -> ManipulationData
p_manipulatable: Manipulatable - Component to demolish
Returns: ManipulationData
Parameters:
p_manipulatable: Manipulatable
demolish
Signature: demolish(p_manipulatable: Manipulatable) -> bool
p_manipulatable: Manipulatable - Component to demolish; defaults to active manipulatable when null
Returns: bool
Parameters:
p_manipulatable: Manipulatable
rotate
Signature: rotate(p_target : Node: Variant, degrees: float) -> void
Delegates to ManipulationParent’s transform coordination.
Returns: void
Parameters:
p_target : Node: Variantdegrees: float
flip_horizontal
Signature: flip_horizontal(p_target : Node: Variant) -> void
Delegates to ManipulationParent’s transform coordination.
Returns: void
Parameters:
p_target : Node: Variant
flip_vertical
Signature: flip_vertical(p_target : Node: Variant) -> void
Delegates to ManipulationParent’s transform coordination.
Returns: void
Parameters:
p_target : Node: Variant
get_targeted
Signature: get_targeted() -> Node
Get the root node of the current targeted object for this manipulation system
Returns: Node
set_targeted
Signature: set_targeted(p_obj_root : Node: Variant) -> void
Sets the manipulation root to be the obj root
Returns: void
Parameters:
p_obj_root : Node: Variant
_unhandled_input
Signature: _unhandled_input(event: InputEvent) -> void
event: InputEvent - Input event to process for manipulation controls
Returns: void
Parameters:
event: InputEvent
_input
Signature: _input(event: InputEvent) -> void
Route standard input to unhandled to support tests or scenes that call _input directly.
Returns: void
Parameters:
event: InputEvent
_perform_manipulation_actions
Signature: _perform_manipulation_actions(event : InputEvent: Variant) -> void
We handle all logic in _unhandled_input.
Returns: void
Parameters:
event : InputEvent: Variant
_finish
Signature: _finish(p_data : ManipulationData: Variant) -> void
Finishes a manipulation action and cleans up resources.
Returns: void
Parameters:
p_data : ManipulationData: Variant
_on_mode_changed
Signature: _on_mode_changed(p_mode : GBEnums.Mode: Variant) -> void
active_target_node is still set from previous manipulation
Returns: void
Parameters:
p_mode : GBEnums.Mode: Variant
_process
Signature: _process(_delta: float) -> void
While moving, keep the target copy aligned with the positioner so tests detect movement shifts.
Returns: void
Parameters:
_delta: float
_on_target_changed
Signature: _on_target_changed(p_new : Node: Variant, p_old : Node: Variant) -> void
NOTE: _process removed. Movement visuals are driven by reparenting the move copy under the positioner.
Returns: void
Parameters:
p_new : Node: Variantp_old : Node: Variant
_on_preview_changed
Signature: _on_preview_changed(p_preview : Node: Variant) -> void
If its layer lacks Targetable (12) hint to add it
Returns: void
Parameters:
p_preview : Node: Variant
_send_manipulation_failed
Signature: _send_manipulation_failed(p_manipulated : Manipulatable: Variant, p_action : GBEnums.Action: Variant) -> void
Sends manipulation failed signal for failed operations.
Returns: void
Parameters:
p_manipulated : Manipulatable: Variantp_action : GBEnums.Action: Variant
_disable_selected_physics
Signature: _disable_selected_physics(p_container : Node2D: Variant) -> void
Disables physics layers for objects during manipulation.
Returns: void
Parameters:
p_container : Node2D: Variant
_enable_selected_physics
Signature: _enable_selected_physics() -> void
Re-enables physics layers that were disabled during manipulation.
Returns: void
_on_source_tree_exiting
Signature: _on_source_tree_exiting() -> void
Automatically cancels manipulation to prevent operating on deleted objects.
Returns: void
_disconnect_source_monitoring
Signature: _disconnect_source_monitoring(p_data: ManipulationData) -> void
Disconnects source object monitoring signal if connected.
Returns: void
Parameters:
p_data: ManipulationData
_get_demolish_display_name
Signature: _get_demolish_display_name(p_manipulatable: Manipulatable) -> String
Gets a display name appropriate for demolish messaging, preferring the manipulatable root when available.
Returns: String
Parameters:
p_manipulatable: Manipulatable
_clear_manipulation_data
Signature: _clear_manipulation_data(p_data: ManipulationData) -> void
Clears manipulation data reference when the provided data matches the active state.
Returns: void
Parameters:
p_data: ManipulationData
_debug_node
Signature: _debug_node(n: Variant) -> void
Returns: void
Parameters:
n: Variant
_describe_layers
Signature: _describe_layers(obj: Variant) -> void
Returns: void
Parameters:
obj: Variant