test: define final character HUD contracts
This commit is contained in:
+142
-84
@@ -157,7 +157,7 @@ func test_live_hud_content_is_enclosed_by_its_intended_shell_region() -> void:
|
||||
_assert_controls_enclosed(right_rail, [hud.get_node_or_null("EventLog") as Control], "RightRail")
|
||||
_assert_controls_enclosed(command_bar, _controls_in_group(hud, COMMAND_HINTS_GROUP), "CommandBar")
|
||||
|
||||
func test_dynamic_hud_groups_refresh_from_live_game_values() -> void:
|
||||
func test_dynamic_hud_groups_refresh_live_character_and_command_values_without_a_redundant_header() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
@@ -166,13 +166,13 @@ func test_dynamic_hud_groups_refresh_from_live_game_values() -> void:
|
||||
assert_not_null(layout, "HUD requires ResponsiveLayout")
|
||||
if layout == null:
|
||||
return
|
||||
var top_bar := layout.get_node_or_null("TopBar") as Control
|
||||
var left_rail := layout.get_node_or_null("LeftRail") as Control
|
||||
var command_bar := layout.get_node_or_null("CommandBar") as Control
|
||||
assert_not_null(top_bar, "ResponsiveLayout requires a TopBar")
|
||||
assert_not_null(left_rail, "ResponsiveLayout requires a LeftRail")
|
||||
assert_not_null(command_bar, "ResponsiveLayout requires a CommandBar")
|
||||
if top_bar == null or left_rail == null or command_bar == null:
|
||||
var header_values := hud.get_node_or_null("HeaderValuesLabel") as Label
|
||||
assert_not_null(left_rail)
|
||||
assert_not_null(command_bar)
|
||||
assert_not_null(header_values, "Legacy HeaderValuesLabel remains an explicitly hidden empty compatibility control")
|
||||
if left_rail == null or command_bar == null or header_values == null:
|
||||
return
|
||||
|
||||
var state := game.get_game_state()
|
||||
@@ -182,29 +182,15 @@ func test_dynamic_hud_groups_refresh_from_live_game_values() -> void:
|
||||
state.player.cell = state.floor_state.entrance
|
||||
hud.refresh(state, [], run)
|
||||
|
||||
var header_values := _labels_in_group(hud, HEADER_VALUES_GROUP)
|
||||
var character_values := _labels_in_group(hud, CHARACTER_VALUES_GROUP)
|
||||
var command_hints := _labels_in_group(hud, COMMAND_HINTS_GROUP)
|
||||
assert_gte(header_values.size(), 1, "TopBar exposes dynamic header values through the hud_header_values group")
|
||||
assert_gte(character_values.size(), 1, "LeftRail exposes dynamic character values through the hud_character_values group")
|
||||
assert_gte(command_hints.size(), 1, "CommandBar exposes dynamic hints through the hud_command_hints group")
|
||||
if header_values.is_empty() or character_values.is_empty() or command_hints.is_empty():
|
||||
assert_false(header_values.visible, "HeaderValuesLabel must not duplicate top-bar information")
|
||||
assert_eq(header_values.text, "", "HeaderValuesLabel must be empty when hidden")
|
||||
if character_values.is_empty() or command_hints.is_empty():
|
||||
return
|
||||
|
||||
var header_text := _combined_label_text(header_values)
|
||||
var character_text := _combined_label_text(character_values)
|
||||
var expected_room_id := ""
|
||||
for room: RoomState in state.floor_state.rooms:
|
||||
if room.bounds.has_point(state.player.cell):
|
||||
expected_room_id = String(room.id)
|
||||
break
|
||||
assert_ne(expected_room_id, "", "The player's authored room must be discoverable from its bounds")
|
||||
assert_string_contains(header_text, run.player_name)
|
||||
assert_string_contains(header_text, str(state.floor_state.floor_number))
|
||||
assert_string_contains(header_text, expected_room_id)
|
||||
assert_string_contains(header_text, str(state.explored_cells.size()))
|
||||
assert_string_contains(character_text, str(state.player.hit_points))
|
||||
_assert_controls_enclosed(top_bar, header_values, "TopBar")
|
||||
assert_string_contains(_combined_label_text(character_values), str(state.player.hit_points))
|
||||
_assert_controls_enclosed(left_rail, character_values, "LeftRail")
|
||||
|
||||
state.player.cell = Vector2i(35, 7)
|
||||
@@ -213,23 +199,19 @@ 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:
|
||||
func test_compact_1280_layout_keeps_the_hidden_legacy_header_out_of_the_top_bar_content() -> 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:
|
||||
assert_not_null(header, "HUD retains HeaderValuesLabel as a compatibility node")
|
||||
if 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")
|
||||
assert_false(header.visible, "The compact TopBar must not revive the removed header values")
|
||||
assert_eq(header.text, "")
|
||||
|
||||
func test_compact_1280_layout_contains_live_hud_regions_without_covering_the_play_area() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
@@ -371,27 +353,35 @@ func test_non_sixteen_by_nine_viewports_center_the_artboard_and_mask_every_outsi
|
||||
assert_eq(top.size.y, 0.0)
|
||||
assert_eq(bottom.size.y, 0.0)
|
||||
|
||||
func test_long_deadline_text_wraps_and_stays_inside_the_left_rail() -> void:
|
||||
func test_deadline_label_is_hidden_on_floor_zero_and_uses_only_the_live_collapse_countdown_afterward() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
return
|
||||
var state := game.get_game_state()
|
||||
var run := game.get_run_state()
|
||||
run.current_floor = 1
|
||||
run.ensure_floor_deadline(1)
|
||||
hud.refresh(state, [], run)
|
||||
await get_tree().process_frame
|
||||
|
||||
var left_rail := hud.get_node_or_null("ResponsiveLayout/LeftRail") as Control
|
||||
var deadline := hud.get_node_or_null("DeadlineLabel") as Label
|
||||
assert_not_null(left_rail, "ResponsiveLayout requires a LeftRail")
|
||||
assert_not_null(deadline, "HUD requires DeadlineLabel")
|
||||
if left_rail == null or deadline == null:
|
||||
if deadline == null:
|
||||
return
|
||||
assert_true(left_rail.get_global_rect().encloses(deadline.get_global_rect()))
|
||||
assert_lte(deadline.get_minimum_size().x, deadline.size.x)
|
||||
assert_gt(deadline.size.y, deadline.get_line_height())
|
||||
|
||||
run.current_floor = 0
|
||||
hud.refresh(state, [], run)
|
||||
assert_eq(deadline.text, "", "Floor zero has no collapse deadline")
|
||||
assert_false(deadline.visible, "Floor zero must not show an empty deadline slot")
|
||||
|
||||
run.current_floor = 1
|
||||
var floor_deadline := run.ensure_floor_deadline(1)
|
||||
floor_deadline.turns_remaining = 15 * floor_deadline.TURNS_PER_DAY
|
||||
hud.refresh(state, [], run)
|
||||
assert_true(deadline.visible)
|
||||
assert_eq(deadline.text, "Effondrement du niveau dans 15 jours")
|
||||
assert_eq(deadline.text.findn("escalier"), -1, "DeadlineLabel must not mention stairs")
|
||||
assert_eq(deadline.text.findn("Étage"), -1, "DeadlineLabel must not repeat the floor")
|
||||
|
||||
floor_deadline.rest()
|
||||
hud.refresh(state, [], run)
|
||||
assert_eq(deadline.text, "Effondrement du niveau dans 14 jours", "The displayed count must follow the live deadline")
|
||||
|
||||
func test_event_log_and_log_panel_never_intersect_the_hud_minimap_at_reference_and_compact_sizes() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
@@ -483,20 +473,21 @@ func _assert_named_non_overlapping_sections(layout: Control, rail_name: String,
|
||||
for other_index in range(index + 1, sections.size()):
|
||||
assert_false(sections[index].get_global_rect().intersects(sections[other_index].get_global_rect()), "%s must not overlap %s" % [sections[index].name, sections[other_index].name])
|
||||
|
||||
func test_character_section_exposes_live_name_and_level_labels() -> void:
|
||||
func test_character_section_title_shows_the_real_run_name_without_a_redundant_name_label() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
return
|
||||
var layout := hud.get_node_or_null("ResponsiveLayout") as Control
|
||||
var character_section := layout.get_node_or_null("CharacterSection") as Control if layout != null else null
|
||||
var section_title := layout.get_node_or_null("CharacterSectionTitle") as Label if layout != null else null
|
||||
var name_label := layout.get_node_or_null("CharacterNameLabel") as Label if layout != null else null
|
||||
var level_label := layout.get_node_or_null("CharacterLevelLabel") as Label if layout != null else null
|
||||
assert_not_null(layout, "HUD requires ResponsiveLayout")
|
||||
assert_not_null(character_section, "ResponsiveLayout requires CharacterSection")
|
||||
assert_not_null(name_label, "CharacterSection requires CharacterNameLabel")
|
||||
assert_not_null(section_title, "CharacterSection requires CharacterSectionTitle")
|
||||
assert_not_null(level_label, "CharacterSection requires CharacterLevelLabel")
|
||||
if layout == null or character_section == null or name_label == null or level_label == null:
|
||||
if layout == null or character_section == null or section_title == null or level_label == null:
|
||||
return
|
||||
|
||||
var state := game.get_game_state()
|
||||
@@ -505,12 +496,16 @@ func test_character_section_exposes_live_name_and_level_labels() -> void:
|
||||
state.player.progression.set_total_xp(125)
|
||||
hud.refresh(state, [], run)
|
||||
|
||||
assert_true(name_label.visible, "CharacterNameLabel must be visible")
|
||||
assert_true(level_label.visible, "CharacterLevelLabel must be visible")
|
||||
assert_true(character_section.get_global_rect().encloses(name_label.get_global_rect()), "CharacterSection must contain CharacterNameLabel")
|
||||
assert_true(character_section.get_global_rect().encloses(level_label.get_global_rect()), "CharacterSection must contain CharacterLevelLabel")
|
||||
assert_string_contains(name_label.text, run.player_name, "CharacterNameLabel must show the real player name")
|
||||
assert_string_contains(level_label.text, str(state.player.progression.level), "CharacterLevelLabel must show the real player level")
|
||||
assert_true(section_title.visible)
|
||||
assert_eq(section_title.text, run.player_name, "The card heading is the run's real name, not PERSONNAGE")
|
||||
assert_ne(section_title.text, "PERSONNAGE")
|
||||
assert_true(name_label == null or not name_label.visible, "CharacterNameLabel must be absent or invisible because the title already names the run")
|
||||
if name_label != null:
|
||||
assert_eq(name_label.text, "", "The hidden duplicate must not retain a second visible identity")
|
||||
assert_true(level_label.visible)
|
||||
assert_true(character_section.get_global_rect().encloses(section_title.get_global_rect()))
|
||||
assert_true(character_section.get_global_rect().encloses(level_label.get_global_rect()))
|
||||
assert_string_contains(level_label.text, str(state.player.progression.level))
|
||||
|
||||
func test_character_portrait_uses_mockup_width_and_preserves_its_aspect_ratio_at_reference_size() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
@@ -558,7 +553,7 @@ func test_section_titles_are_visible_contained_and_readable_at_reference_size()
|
||||
assert_true(section.get_global_rect().encloses(title.get_global_rect()), "%s must contain %s" % [section_names[index], title_names[index]])
|
||||
assert_gte(title.get_theme_font_size(&"font_size"), 16, "%s must use at least a 16px font at 1920x1080" % title_names[index])
|
||||
|
||||
func test_top_bar_contains_readable_non_overlapping_title_and_header_values() -> void:
|
||||
func test_top_bar_defaults_to_a_single_floor_title_without_legacy_values_or_notifications() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
@@ -569,16 +564,23 @@ func test_top_bar_contains_readable_non_overlapping_title_and_header_values() ->
|
||||
var top_bar := layout.get_node_or_null("TopBar") as Control if layout != null else null
|
||||
var title := hud.get_node_or_null("TitleLabel") as Label
|
||||
var header_values := hud.get_node_or_null("HeaderValuesLabel") as Label
|
||||
var achievement_toast := hud.get_node_or_null("AchievementToast") as Label
|
||||
var title_notification := hud.get_node_or_null("TitleNotificationLabel") as Label
|
||||
assert_not_null(top_bar, "ResponsiveLayout requires TopBar")
|
||||
assert_not_null(title, "TopBar requires TitleLabel")
|
||||
assert_not_null(header_values, "TopBar requires HeaderValuesLabel")
|
||||
if top_bar == null or title == null or header_values == null:
|
||||
assert_not_null(header_values, "Legacy HeaderValuesLabel must be explicitly hidden")
|
||||
assert_not_null(achievement_toast, "HUD retains AchievementToast")
|
||||
assert_not_null(title_notification, "HUD requires a separate temporary TitleNotificationLabel")
|
||||
if top_bar == null or title == null or header_values == null or achievement_toast == null or title_notification == null:
|
||||
return
|
||||
assert_true(top_bar.get_global_rect().encloses(title.get_global_rect()), "TopBar must contain TitleLabel")
|
||||
assert_true(top_bar.get_global_rect().encloses(header_values.get_global_rect()), "TopBar must contain HeaderValuesLabel")
|
||||
assert_false(title.get_global_rect().intersects(header_values.get_global_rect()), "TitleLabel and HeaderValuesLabel must not intersect")
|
||||
assert_gte(title.get_theme_font_size(&"font_size"), 20, "TitleLabel must use at least a 20px font at 1920x1080")
|
||||
assert_gte(header_values.get_theme_font_size(&"font_size"), 15, "HeaderValuesLabel must use at least a 15px font at 1920x1080")
|
||||
assert_true(title.visible, "TitleLabel is the sole default visible TopBar value")
|
||||
assert_eq(title.text, "Étage 0")
|
||||
assert_false(header_values.visible)
|
||||
assert_eq(header_values.text, "")
|
||||
assert_false(achievement_toast.visible)
|
||||
assert_false(title_notification.visible)
|
||||
assert_true(top_bar.get_global_rect().encloses(title.get_global_rect()))
|
||||
assert_gte(title.get_theme_font_size(&"font_size"), 20)
|
||||
|
||||
func test_command_bar_subzones_are_distinct_and_contain_their_text() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
@@ -721,26 +723,73 @@ func test_decorative_equipment_and_header_art_are_absent_or_hidden() -> void:
|
||||
var decorative := layout.get_node_or_null(decorative_name) as Control
|
||||
assert_true(decorative == null or not decorative.visible, "%s must be absent or invisible rather than adding decorative visual noise" % decorative_name)
|
||||
|
||||
func test_objectives_and_status_keep_the_requested_vertical_breathing_room() -> void:
|
||||
func test_objectives_and_status_keep_separate_titles_and_content_at_reference_and_compact_sizes() -> 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(1920, 1080))
|
||||
await get_tree().process_frame
|
||||
var layout := hud.get_node_or_null("ResponsiveLayout") as Control
|
||||
var objectives := layout.get_node_or_null("ObjectivesSection") as Control if layout != null else null
|
||||
var status := layout.get_node_or_null("StatusSection") as Control if layout != null else null
|
||||
var status_title := layout.get_node_or_null("StatusSectionTitle") as Label if layout != null else null
|
||||
assert_not_null(objectives)
|
||||
assert_not_null(status)
|
||||
assert_not_null(status_title)
|
||||
if objectives == null or status == null or status_title == null:
|
||||
return
|
||||
assert_gte(status.get_global_rect().position.y - objectives.get_global_rect().end.y, 24.0, "Objectives and Status need at least 24px of vertical separation at 1920x1080")
|
||||
assert_gte(status_title.get_global_rect().position.y - status.get_global_rect().position.y, 14.0, "ÉTAT title needs at least 14px top inset")
|
||||
for viewport_size: Vector2 in [Vector2(1920, 1080), Vector2(1280, 720)]:
|
||||
hud.apply_viewport_layout(viewport_size)
|
||||
await get_tree().process_frame
|
||||
var layout := hud.get_node_or_null("ResponsiveLayout") as Control
|
||||
var objectives := layout.get_node_or_null("ObjectivesSection") as Control if layout != null else null
|
||||
var status := layout.get_node_or_null("StatusSection") as Control if layout != null else null
|
||||
var objectives_title := layout.get_node_or_null("ObjectivesSectionTitle") as Label if layout != null else null
|
||||
var status_title := layout.get_node_or_null("StatusSectionTitle") as Label if layout != null else null
|
||||
var quest_content := hud.get_node_or_null("QuestTrackerLabel") as Control
|
||||
var status_content := hud.get_node_or_null("CharacterStatusLabel") as Control
|
||||
assert_not_null(objectives, "ObjectivesSection is required at %s" % viewport_size)
|
||||
assert_not_null(status, "StatusSection is required at %s" % viewport_size)
|
||||
assert_not_null(objectives_title)
|
||||
assert_not_null(status_title)
|
||||
assert_not_null(quest_content)
|
||||
assert_not_null(status_content)
|
||||
if objectives == null or status == null or objectives_title == null or status_title == null or quest_content == null or status_content == null:
|
||||
continue
|
||||
assert_true(status.get_global_rect().encloses(status_content.get_global_rect()), "CharacterStatusLabel belongs inside StatusSection at %s" % viewport_size)
|
||||
assert_true(objectives.get_global_rect().encloses(objectives_title.get_global_rect()))
|
||||
assert_true(objectives.get_global_rect().encloses(quest_content.get_global_rect()))
|
||||
assert_true(status.get_global_rect().encloses(status_title.get_global_rect()))
|
||||
assert_false(status_content.get_global_rect().intersects(objectives.get_global_rect()), "CharacterStatusLabel must not touch ObjectivesSection at %s" % viewport_size)
|
||||
assert_false(objectives_title.get_global_rect().intersects(quest_content.get_global_rect()), "Objectives title and content must be distinct at %s" % viewport_size)
|
||||
assert_false(status_title.get_global_rect().intersects(status_content.get_global_rect()), "Status title and content must be distinct at %s" % viewport_size)
|
||||
assert_false(objectives.get_global_rect().intersects(status.get_global_rect()), "Objectives and status frames must remain separate at %s" % viewport_size)
|
||||
if viewport_size == Vector2(1920, 1080):
|
||||
assert_gte(status.get_global_rect().position.y - objectives.get_global_rect().end.y, 24.0)
|
||||
assert_gte(status_title.get_global_rect().position.y - status.get_global_rect().position.y, 14.0)
|
||||
|
||||
func test_character_and_journal_titles_are_outlined_light_and_readable() -> void:
|
||||
func test_player_health_and_gold_use_the_final_compact_character_section_contract() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
return
|
||||
var state := game.get_game_state()
|
||||
var run := game.get_run_state()
|
||||
run.gold = 15
|
||||
hud.refresh(state, [], run)
|
||||
var layout := hud.get_node_or_null("ResponsiveLayout") as Control
|
||||
var character_section := layout.get_node_or_null("CharacterSection") as Control if layout != null else null
|
||||
var health := hud.get_node_or_null("PlayerHealthLabel") as Label
|
||||
var gold_icon := hud.get_node_or_null("GoldIcon") as TextureRect
|
||||
var gold_label := hud.get_node_or_null("GoldLabel") as Label
|
||||
assert_not_null(character_section)
|
||||
assert_not_null(health)
|
||||
assert_not_null(gold_icon, "CharacterSection requires GoldIcon")
|
||||
assert_not_null(gold_label)
|
||||
if character_section == null or health == null or gold_icon == null or gold_label == null:
|
||||
return
|
||||
assert_eq(health.text, "PV : %d/%d" % [state.player.hit_points, state.player.max_hit_points])
|
||||
assert_true(gold_icon.visible)
|
||||
assert_not_null(gold_icon.texture)
|
||||
if gold_icon.texture != null:
|
||||
assert_true(_texture_has_gold_coin_path(gold_icon.texture), "GoldIcon must use the gold_coin SVG or PNG asset")
|
||||
assert_eq(gold_label.text, "15", "GoldLabel contains the numeric value only")
|
||||
assert_true(character_section.get_global_rect().encloses(gold_icon.get_global_rect()))
|
||||
assert_true(character_section.get_global_rect().encloses(gold_label.get_global_rect()))
|
||||
var currency_bottom := maxf(gold_icon.get_global_rect().end.y, gold_label.get_global_rect().end.y)
|
||||
assert_gte(character_section.get_global_rect().end.y - currency_bottom, 16.0, "The currency icon/value union needs a >=16px bottom margin")
|
||||
|
||||
func test_character_and_journal_titles_use_the_final_large_outlined_light_style() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
@@ -751,14 +800,20 @@ func test_character_and_journal_titles_are_outlined_light_and_readable() -> void
|
||||
assert_not_null(layout)
|
||||
if layout == null:
|
||||
return
|
||||
for title_name: String in ["CharacterSectionTitle", "JournalSectionTitle"]:
|
||||
var title := layout.get_node_or_null(title_name) as Label
|
||||
assert_not_null(title, "ResponsiveLayout requires %s" % title_name)
|
||||
if title == null:
|
||||
for specification: Dictionary in [
|
||||
{"section": "CharacterSection", "title": "CharacterSectionTitle"},
|
||||
{"section": "JournalSection", "title": "JournalSectionTitle"},
|
||||
]:
|
||||
var section := layout.get_node_or_null(String(specification.section)) as Control
|
||||
var title := layout.get_node_or_null(String(specification.title)) as Label
|
||||
assert_not_null(section)
|
||||
assert_not_null(title, "ResponsiveLayout requires %s" % specification.title)
|
||||
if section == null or title == null:
|
||||
continue
|
||||
assert_gte(title.get_theme_font_size(&"font_size"), 16, "%s needs at least a 16px font at 1920x1080" % title_name)
|
||||
assert_gte(title.get_theme_constant(&"outline_size"), 2, "%s needs a >=2px contour" % title_name)
|
||||
assert_gte(title.get_theme_color(&"font_color").get_luminance(), 0.60, "%s needs a light font color" % title_name)
|
||||
assert_gte(title.get_theme_font_size(&"font_size"), 20, "%s needs a >=20px font at 1920x1080" % title.name)
|
||||
assert_gte(title.get_theme_constant(&"outline_size"), 3, "%s needs a >=3px contour" % title.name)
|
||||
assert_gte(title.get_theme_color(&"font_color").get_luminance(), 0.75, "%s needs a >=0.75 luminance" % title.name)
|
||||
assert_gte(title.get_global_rect().position.y - section.get_global_rect().position.y, 16.0, "%s needs a >=16px vertical inset" % title.name)
|
||||
|
||||
func test_command_bar_keeps_all_three_zones_readable_at_reference_and_compact_sizes() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
@@ -798,6 +853,9 @@ func test_command_bar_keeps_all_three_zones_readable_at_reference_and_compact_si
|
||||
assert_lte(help.get_minimum_size().x, help.size.x, "The right help zone must fit its complete label at %s" % viewport_size)
|
||||
assert_eq(prompt.text, "F : Distance • X : Magie • K : Familier", "The center zone must contain exactly the three requested command notions")
|
||||
|
||||
func _texture_has_gold_coin_path(texture: Texture2D) -> bool:
|
||||
return _texture_uses_path(texture, "res://assets/ui/dark_fantasy/gold_coin.svg") or _texture_uses_path(texture, "res://assets/ui/dark_fantasy/gold_coin.png")
|
||||
|
||||
func _texture_uses_path(texture: Texture2D, expected_path: String) -> bool:
|
||||
if texture == null:
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user