fix: complete Task 5 visual HUD validation

This commit is contained in:
goose
2026-10-08 21:45:46 -04:00
parent 9921e02de3
commit 122fdac97c
7 changed files with 155 additions and 6 deletions
+3 -1
View File
@@ -33,7 +33,9 @@ os.makedirs("artifacts", exist_ok=True)
width, height = 1920, 1080
unknown = (1, 2, 5)
visible = (176, 176, 176)
explored = (19, 29, 39)
# Match the blue-black explored tile palette accepted by the real capture
# validator; do not model it as a single renderer-specific RGB tuple.
explored = (9, 14, 23)
def pixel_for_x(x):
if x < width // 3:
return unknown
+18
View File
@@ -211,6 +211,24 @@ func test_dynamic_hud_groups_refresh_from_live_game_values() -> void:
assert_string_contains(_combined_label_text(command_hints), "Ouvrir la porte")
_assert_controls_enclosed(command_bar, command_hints, "CommandBar")
func test_compact_1280_layout_scales_header_text_and_keeps_it_inside_the_top_bar() -> void:
var hud := game.get_node_or_null("HUD") as GameHud
assert_not_null(hud, "Game scene requires HUD")
if hud == null:
return
hud.apply_viewport_layout(Vector2(1280, 720))
var top_bar := hud.get_node_or_null("ResponsiveLayout/TopBar") as Control
var header := hud.get_node_or_null("HeaderValuesLabel") as Label
assert_not_null(top_bar, "ResponsiveLayout requires a TopBar")
assert_not_null(header, "HUD requires HeaderValuesLabel")
if top_bar == null or header == null:
return
assert_eq(header.get_theme_font_size(&"font_size"), 11, "The compact shell scales the 16px header value font to the 1280x720 artboard")
assert_true(top_bar.get_global_rect().encloses(header.get_global_rect()), "The compact header remains inside its TopBar")
assert_lte(header.get_minimum_size().y, header.size.y, "The compact header has enough height for its scaled text")
func test_long_deadline_text_wraps_and_stays_inside_the_left_rail() -> void:
var hud := game.get_node_or_null("HUD") as GameHud
assert_not_null(hud, "Game scene requires HUD")