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>
This commit is contained in:
@@ -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)
|
||||
|
||||
+5
-16
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user