feat(ui): show all system names on star map, centered below dots
All named systems get a label below their dot. text_dim for default, text_primary for selected/hovered. Removed duplicate label from _draw_selection (now handled by _draw_systems). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+21
-16
@@ -415,6 +415,26 @@ func _draw_systems(center: Vector2) -> void:
|
||||
|
||||
draw_circle(pos, radius, color)
|
||||
|
||||
# System name label — centered below the dot
|
||||
var label: String = node.get("proper_name", "")
|
||||
if not label.is_empty() and label != sid:
|
||||
var label_color: Color
|
||||
if sid == _selected_system or sid == _hovered_system:
|
||||
label_color = COLOR_TEXT
|
||||
else:
|
||||
label_color = COLOR_TEXT_DIM
|
||||
var font := get_theme_default_font()
|
||||
var label_size := font.get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, -1, 9)
|
||||
draw_string(
|
||||
font,
|
||||
pos + Vector2(-label_size.x / 2.0, radius + 10.0),
|
||||
label,
|
||||
HORIZONTAL_ALIGNMENT_LEFT,
|
||||
-1,
|
||||
9,
|
||||
label_color,
|
||||
)
|
||||
|
||||
|
||||
func _draw_edges(center: Vector2) -> void:
|
||||
# Only draw edges connected to the selected system (full web is unreadable at 301 systems)
|
||||
@@ -435,24 +455,9 @@ func _draw_selection(center: Vector2) -> void:
|
||||
if not _node_positions.has(_selected_system):
|
||||
return
|
||||
var pos: Vector2 = center + _node_positions[_selected_system] * _zoom
|
||||
# Selection ring only — label is drawn by _draw_systems()
|
||||
draw_arc(pos, SELECTION_RING_RADIUS, 0.0, TAU, 24, COLOR_SELECTION, 1.2, true)
|
||||
|
||||
# Draw label next to selection
|
||||
var node: Dictionary = _node_lookup.get(_selected_system, {})
|
||||
var label: String = node.get("proper_name", _selected_system)
|
||||
if label.is_empty():
|
||||
label = _selected_system
|
||||
var font := get_theme_default_font()
|
||||
draw_string(
|
||||
font,
|
||||
pos + Vector2(SELECTION_RING_RADIUS + 4, 4),
|
||||
label,
|
||||
HORIZONTAL_ALIGNMENT_LEFT,
|
||||
-1,
|
||||
12,
|
||||
COLOR_SELECTION
|
||||
)
|
||||
|
||||
|
||||
## Rebuild the info panel with components for the selected system (D-169).
|
||||
func _rebuild_info_panel() -> void:
|
||||
|
||||
Reference in New Issue
Block a user