Display UI for showing information about objects being targeted, manipulated, or built
TargetInformer provides a dynamic UI component that displays object information based on the current game state. It responds to three different contexts with clear priority:
Priority System:
1. Manipulation (Highest Priority): Shows info for actively manipulated objects
2. Building: Shows info for building preview objects
3. Targeting (Lowest Priority): Shows info for hovered/targeted objects
Signal Flow:
- GridTargetingState.target_changed → Updates display on hover
- ManipulationState.active_target_node_changed → Overrides targeting info
- PlacementState.preview_changed → Shows building preview info
Usage:
var informer = TargetInformer.new() add_child(informer) informer.resolve_placement_dependencies(session) # Now responds automatically to targeting/manipulation/building changes
Override _to_string() on displayed object nodes to show custom names
Source: addons/grid_placement/ui/target_informer/target_informer.gd
Syntax
class TargetInformer extends PlacementControlMembers
| Name | Kind | Summary |
|---|---|---|
target | Property | |
get_targeting_state | Method | |
set_targeting_state | Method | |
get_building_state | Method | |
set_building_state | Method | |
get_manipulation_state | Method | |
set_manipulation_state | Method | |
get_mode_state | Method | |
set_mode_state | Method | |
info_parent | Property | |
resolve_placement_dependencies | Method | |
clear | Method | |
refresh | Method | |
setup | Method | |
add_info_label | Method | |
track_manipulatable_target | Method |