ImplantDataRow uses clip_text + ellipsis instead of wrapping — each info item stays on one line. Panel position clamped so bottom edge never exceeds screen bounds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
985 B
GDScript
32 lines
985 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
|
|
clip_text = true
|
|
text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS
|
|
size_flags_horizontal = Control.SIZE_FILL
|
|
|
|
|
|
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
|