fix(ui): address PR #115 review — 8 items
- Fix stale test path UILayer/HUD → InsertOverlay/HUD - Fix D-record citation D-051 → D-049 in main.tscn - Add null guards to hud.gd update methods (pre-_ready safety) - Minimap: dirty-flag queue_redraw instead of per-frame - Remove redundant _panel.size.x, debug print - Fix DebugOverlay/GauntletHUD positioning comments Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+6
-3
@@ -21,7 +21,6 @@ func _ready() -> void:
|
||||
_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, 16) # top-left; replaces standalone TimeDisplay
|
||||
add_child(_panel)
|
||||
@@ -34,10 +33,10 @@ func _ready() -> void:
|
||||
_panel.add_component(_health_row)
|
||||
_panel.add_component(_perception_row)
|
||||
|
||||
print("HUD: Initialized")
|
||||
|
||||
|
||||
func update_from_hud_data(data: Dictionary) -> void:
|
||||
if not _perception_row:
|
||||
return
|
||||
if data.has("perception_mode"):
|
||||
var prefix := UIStrings.get_text("hud.perception_mode_prefix")
|
||||
if prefix.is_empty():
|
||||
@@ -47,10 +46,14 @@ func update_from_hud_data(data: Dictionary) -> void:
|
||||
|
||||
|
||||
func update_health(health: int) -> void:
|
||||
if not _health_row:
|
||||
return
|
||||
_health_row.text = UIStrings.get_text("hud.health") + ": " + str(health)
|
||||
|
||||
|
||||
func update_from_state() -> void:
|
||||
if not _time_row:
|
||||
return
|
||||
var gt: Dictionary = GameState.game_time
|
||||
if gt.is_empty():
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user