New component library at client/ui/implant/: - ImplantTheme: shared Resource with colors, spacing, font sizes - ImplantPanel: PanelContainer root with themed background/border - ImplantHeader: title + subtitle - ImplantSeparator: themed horizontal rule with above/below spacing - ImplantDataRow: single-line text with optional color override - ImplantTextBlock: RichTextLabel for wrapping narrative text - default_implant.tres: default theme resource Star map info panel refactored from 140 lines of manual draw_string calls to 50 lines of component composition via _rebuild_info_panel(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
866 B
GDScript
29 lines
866 B
GDScript
@tool
|
|
class_name ImplantDataRow
|
|
extends Label
|
|
## Single-line data display — text with optional color override.
|
|
|
|
var _color_override: Color = Color.TRANSPARENT # transparent = use theme default
|
|
|
|
|
|
func _init(text: String = "", color: Color = Color.TRANSPARENT) -> void:
|
|
self.text = text
|
|
_color_override = color
|
|
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
|
|
|
|
|
func set_content(text_value: String, color: Color = Color.TRANSPARENT) -> void:
|
|
text = text_value
|
|
_color_override = color
|
|
if _color_override.a > 0.0:
|
|
add_theme_color_override("font_color", _color_override)
|
|
|
|
|
|
func apply_implant_theme(t: ImplantTheme) -> void:
|
|
add_theme_font_size_override("font_size", t.font_body)
|
|
if _color_override.a > 0.0:
|
|
add_theme_color_override("font_color", _color_override)
|
|
else:
|
|
add_theme_color_override("font_color", t.text_dim)
|
|
custom_minimum_size.y = t.line_height
|