class_name LuneStatusBadge extends PanelContainer ## Small labelled state (RUHIG, KRITISCH, BEREIT, BOT, COOLDOWN …). Always colour plus text ## and, where it helps, a symbol; never colour alone. Styles come from the theme cache. var _row: HBoxContainer var _glyph: LuneGlyph var _label: Label var text: String = "" func _init() -> void: mouse_filter = Control.MOUSE_FILTER_IGNORE size_flags_vertical = Control.SIZE_SHRINK_CENTER _row = HBoxContainer.new() _row.add_theme_constant_override("separation", 4) _row.mouse_filter = Control.MOUSE_FILTER_IGNORE add_child(_row) _glyph = LuneGlyph.make("", Color.WHITE, 12.0, _row) _glyph.visible = false _label = LuneUiTheme.label("", "HudBadge", _row) func set_state(text_value: String, color: Color, glyph: String = "", filled: bool = false) -> void: text = text_value _label.text = text_value var ink: Color = Color("15110b") if filled else color.lightened(.15) _label.add_theme_color_override("font_color", ink) _glyph.visible = not glyph.is_empty() _glyph.glyph = glyph _glyph.color = ink add_theme_stylebox_override("panel", LuneUiTheme.badge_style(color, filled))