TargetInformer
Handle targeting state changes -...
Handle targeting state changes - shows info for any targeted object (hover).[br] [br] [b]Priority Logic:[/b] If manipulation is active (active_target_node != null) or building preview is active (preview != null), this handler returns early without updating the display. This ensures manipulation and building preview info takes precedence over targeting info.[br] [br] [code]p_new[/code]: [i]Node2D[/i] - Newly targeted node (can be null)[br] [code]_p_old[/code]: [i]Node2D[/i] - Previously targeted node (unused)
Version: v5.0.0
Inherits: GBControl
Source: target_informer.gd
Parsing: AST-based for maximum accuracy with symbol typing
Variables
_building_state:
When building preview changes, displays preview object information.
_manipulation_state:
Takes priority over targeting info when active manipulation exists.
_targeting_state:
Displays info for any targeted object (hover). Lowest priority: overridden by manipulation/building.
_mode_state:
When set, will hide when the mode is off and show otherwise. Optional.
_settings:
_name_label:
_position_label:
Methods
_ready
Signature: _ready() -> void
Initialize the target informer display when ready.
Returns: void
_process
Signature: _process(delta: float) -> void
Update the target information display every frame.
Returns: void
Parameters:
delta: float
resolve_gb_dependencies
Signature: resolve_gb_dependencies(p_container: GBCompositionContainer) -> void
p_container: GBCompositionContainer - Container with states and configuration
Returns: void
Parameters:
p_container: GBCompositionContainer
clear
Signature: clear() -> void
Clears all child controls from the info parent container.
Returns: void
refresh
Signature: refresh() -> void
Updates the target information display with current target data.
Returns: void
setup
Signature: setup() -> void
Returns: void
add_info_label
Signature: add_info_label(p_text: String) -> Label
p_text: String - Text to display in the label
Returns: Label
Parameters:
p_text: String
track_manipulatable_target
Signature: track_manipulatable_target() -> void
Returns: void
_format_position
Signature: _format_position(p_target: Node) -> String
p_target: Node - Node to format position for (must be Node2D or Node3D)
Returns: String
Parameters:
p_target: Node
_on_manipulation_target_changed
Signature: _on_manipulation_target_changed(p_target: Manipulatable) -> void
Handle case where settings aren’t configured yet
Returns: void
Parameters:
p_target: Manipulatable
_on_manipulation_started
Signature: _on_manipulation_started(p_data: ManipulationData) -> void
No active manipulation - check if there’s a targeting state target to show
Returns: void
Parameters:
p_data: ManipulationData
_on_manipulation_finished
Signature: _on_manipulation_finished(_p_data: ManipulationData) -> void
Returns: void
Parameters:
_p_data: ManipulationData
_on_manipulation_canceled
Signature: _on_manipulation_canceled(_p_data: ManipulationData) -> void
Returns: void
Parameters:
_p_data: ManipulationData
_on_target_tree_exiting
Signature: _on_target_tree_exiting() -> void
Returns: void
_on_building_preview_changed
Signature: _on_building_preview_changed(p_preview: Node) -> void
Returns: void
Parameters:
p_preview: Node
_on_mode_changed
Signature: _on_mode_changed(p_mode: GBEnums.Mode: Variant) -> void
No building preview - check if there’s a targeting state target to show
Returns: void
Parameters:
p_mode: GBEnums.Mode: Variant
_on_targeting_target_changed
Signature: _on_targeting_target_changed(p_new: Node2D, _p_old: Node2D) -> void
_p_old: Node2D - Previously targeted node (unused)
Returns: void
Parameters:
p_new: Node2D_p_old: Node2D