Files
settled-reach/client/ui/hud.gd
T
jpmschweitzerandClaude Opus 4.6 eeac6405d6 fix(ui): HUD layout pass — resolve overlapping elements (#792)
- HUD status panel moved to y=80 (below TimeDisplay at 16-70)
- Removed redundant time row from HUD (TimeDisplay handles it)
- Debug overlay starts at y=150 (below HUD status panel)
- Stance indicator moved below minimap (y=192, was overlapping at y=16)
- Interaction prompt moved to y=-240 (above dialogue box at -200)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 12:35:37 +02:00

49 lines
1.4 KiB
GDScript

extends Control
## HUD — implant-styled status panel (D-169, D-170).
## Displays health and perception mode. Time is handled by TimeDisplay.
var _panel: ImplantPanel
var _health_row: ImplantDataRow
var _perception_row: ImplantDataRow
func _ready() -> void:
# Remove the old raw MarginContainer/labels if present
var old := get_node_or_null("MarginContainer")
if old:
old.queue_free()
var theme_res := load("res://ui/implant/default_implant.tres") as ImplantTheme
_panel = ImplantPanel.new()
_panel.name = "StatusPanel"
_panel.theme_resource = theme_res
_panel.custom_minimum_size.x = 200.0
_panel.size.x = 200.0
_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
_panel.position = Vector2(16, 80) # below TimeDisplay (occupies 16-70)
add_child(_panel)
_panel.move_child(_panel.get_node("Content"), 0)
_health_row = ImplantDataRow.new("Health: 100")
_perception_row = ImplantDataRow.new("Mode: Baseline")
_panel.add_component(_health_row)
_panel.add_component(_perception_row)
print("HUD: Initialized")
func update_from_hud_data(data: Dictionary) -> void:
if data.has("perception_mode"):
var prefix := UIStrings.get_text("hud.perception_mode_prefix")
if prefix.is_empty():
_perception_row.text = data.perception_mode.capitalize()
else:
_perception_row.text = prefix + ": " + data.perception_mode.capitalize()
func update_health(health: int) -> void:
_health_row.text = UIStrings.get_text("hud.health") + ": " + str(health)