NameplateManager ​
Inherits: CanvasLayer
Manages the creation, positioning, and cleanup of UI nameplates for various entities in the game.
Description ​
This class handles:
- Creating appropriate nameplates for different entity types (companions, minions, bosses, pets)
- Positioning nameplates in screen space based on entity's 3D position
- Scaling nameplates based on camera distance
- Draw order based on distance to camera (closer = on top)
- Priority drawing for targeted entities
- Safely handling entity/nameplate lifecycle to prevent freed instance errors
- Providing methods to add, remove, and clear nameplates
The manager uses a deferred removal system to prevent modifying collections during iteration and includes multiple validity checks to handle cases where entities or nameplates are freed.
Variables ​
Dictionary | nameplates | {} |
Array | pending_removal | [] |
bool | combat_visibility_enabled | false # Whether "show in combat only" is active |
int | active_combat_count | 0 |
CameraController | camera_controller | |
WorldContainer | world_container | |
PartyManager | party_manager |
Methods ​
void | connect_signals( system_hub: GameHost.SystemHub ) |
void | enable_processing() |
void | disable_processing() |
void | add_nameplate( owner: Variant ) |
void | remove_nameplate( owner: Variant ) |
void | clear_all_nameplates() |
void | show_floating_text( owner: Variant, text: String, color: Color ) |
Signals ​
effect_tooltip_requested( effect: EffectInstance ) ​
Tooltip signals - route from nameplates to UIManager
hide_tooltip( force_hide: bool ) ​
Asks the interface to hide the tooltip (force hides it at once).
Variable descriptions ​
Dictionary nameplates = ​
Dictionary to store owner -> nameplate mappings (Entity or InteractableObject)
Array pending_removal = [] ​
Array for safely queuing owners for removal without modifying the dictionary during iteration
bool combat_visibility_enabled = false # Whether "show in combat only" is active ​
Combat visibility tracking
int active_combat_count = 0 ​
Track number of active encounters
CameraController camera_controller ​
SystemRefs
WorldContainer world_container ​
The container of the current world.
PartyManager party_manager ​
The manager of the party.
Method descriptions ​
void connect_signals( system_hub: GameHost.SystemHub ) ​
Connect to the PartyManager's signal for entity being freed
void enable_processing() ​
Enable nameplate processing - call this when level is fully loaded
void disable_processing() ​
Disable nameplate processing - call this during loading
void add_nameplate( owner: Variant ) ​
Creates and adds a nameplate for the given owner (Entity or InteractableObject)
void remove_nameplate( owner: Variant ) ​
Removes a nameplate for the specified owner (Entity or InteractableObject)
void clear_all_nameplates() ​
Removes all nameplates and clears the dictionary
void show_floating_text( owner: Variant, text: String, color: Color ) ​
Floats text up from the owner's nameplate marker (Entity or InteractableObject)