From eeac6405d64a46bfe7567f42433edd9f8793ea0d Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 5 Apr 2026 12:35:37 +0200 Subject: [PATCH] =?UTF-8?q?fix(ui):=20HUD=20layout=20pass=20=E2=80=94=20re?= =?UTF-8?q?solve=20overlapping=20elements=20(#792)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- client/ui/debug_overlay.gd | 1 + client/ui/hud.gd | 21 +++++---------------- client/ui/interaction_prompt.tscn | 3 ++- client/ui/stance_indicator.tscn | 6 +++--- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/client/ui/debug_overlay.gd b/client/ui/debug_overlay.gd index 610ae751b..bd78d9119 100644 --- a/client/ui/debug_overlay.gd +++ b/client/ui/debug_overlay.gd @@ -76,6 +76,7 @@ var _tick_deltas: Array = [] # ms between consecutive snapshots func _ready() -> void: _dev_mode = OS.is_debug_build() visible = false + position.y = 150.0 # Below TimeDisplay (16-70) + HUD status panel (80-140) _cached_font = ThemeDB.fallback_font # Clear NPC path history on session change to prevent entity ID collisions GameState.connect("game_id_changed", _on_game_id_changed) diff --git a/client/ui/hud.gd b/client/ui/hud.gd index 9456ed4e6..f065ddaf5 100644 --- a/client/ui/hud.gd +++ b/client/ui/hud.gd @@ -1,13 +1,11 @@ extends Control ## HUD — implant-styled status panel (D-169, D-170). -## Displays health, perception mode, time in an ImplantPanel. +## Displays health and perception mode. Time is handled by TimeDisplay. var _panel: ImplantPanel var _health_row: ImplantDataRow var _perception_row: ImplantDataRow -var _time_row: ImplantDataRow -var _theme: ImplantTheme func _ready() -> void: @@ -16,25 +14,23 @@ func _ready() -> void: if old: old.queue_free() - _theme = load("res://ui/implant/default_implant.tres") as ImplantTheme + var theme_res := load("res://ui/implant/default_implant.tres") as ImplantTheme _panel = ImplantPanel.new() _panel.name = "StatusPanel" - _panel.theme_resource = _theme + _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, 16) + _panel.position = Vector2(16, 80) # below TimeDisplay (occupies 16-70) add_child(_panel) - _panel.move_child(_panel.get_node("Content"), 0) # ensure content is first + _panel.move_child(_panel.get_node("Content"), 0) _health_row = ImplantDataRow.new("Health: 100") _perception_row = ImplantDataRow.new("Mode: Baseline") - _time_row = ImplantDataRow.new("Time: 08:00") _panel.add_component(_health_row) _panel.add_component(_perception_row) - _panel.add_component(_time_row) print("HUD: Initialized") @@ -47,13 +43,6 @@ func update_from_hud_data(data: Dictionary) -> void: else: _perception_row.text = prefix + ": " + data.perception_mode.capitalize() - if data.has("time"): - var prefix := UIStrings.get_text("hud.time_prefix") - if prefix.is_empty(): - _time_row.text = data.time - else: - _time_row.text = prefix + ": " + data.time - func update_health(health: int) -> void: _health_row.text = UIStrings.get_text("hud.health") + ": " + str(health) diff --git a/client/ui/interaction_prompt.tscn b/client/ui/interaction_prompt.tscn index 3ed02c5a0..6f540c9d6 100644 --- a/client/ui/interaction_prompt.tscn +++ b/client/ui/interaction_prompt.tscn @@ -8,8 +8,9 @@ anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 offset_left = 200.0 -offset_top = -60.0 +offset_top = -240.0 offset_right = -200.0 +offset_bottom = -210.0 grow_horizontal = 2 grow_vertical = 0 mouse_filter = 2 diff --git a/client/ui/stance_indicator.tscn b/client/ui/stance_indicator.tscn index e53d37364..2b3ddf454 100644 --- a/client/ui/stance_indicator.tscn +++ b/client/ui/stance_indicator.tscn @@ -2,16 +2,16 @@ [ext_resource type="Script" path="res://ui/stance_indicator.gd" id="1_stance"] -; D-053: Stance indicator — top-right HUD element +; D-053: Stance indicator — below minimap, right-aligned [node name="StanceIndicator" type="Control"] layout_mode = 3 anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 offset_left = -100.0 -offset_top = 16.0 +offset_top = 192.0 offset_right = -16.0 -offset_bottom = 42.0 +offset_bottom = 218.0 grow_horizontal = 0 mouse_filter = 2 script = ExtResource("1_stance")