fix: apply final dark fantasy HUD polish

This commit is contained in:
goose
2026-10-09 08:38:28 -04:00
parent 59d0b65eb6
commit f1b58935bf
10 changed files with 129 additions and 102 deletions
@@ -15,5 +15,5 @@ func test_current_game_event_and_hud_remain_available_with_attributes_domain_loa
var hud := game.get_node("HUD") as GameHud
assert_eq(state.enemies[&"goblin"].hit_points, 3)
assert_true(game.get_run_state().recent_events(2).any(func(event: GameEvent) -> bool: return event.kind == &"melee"))
assert_true(hud.player_health_label.text.contains("Player HP:"))
assert_true(hud.player_health_label.text.contains("PV du joueur :"))
assert_true(hud.event_log.get_parsed_text().contains("You strike the goblin"))
+3 -3
View File
@@ -14,7 +14,7 @@ func test_configured_input_event_uses_the_same_action_path_as_submit_test_action
var input_event := _key_event(KEY_DOWN)
game._unhandled_input(input_event)
assert_eq(state.player.cell, Vector2i(4, 8))
assert_string_contains(game.get_node("HUD/EventLog").get_parsed_text(), "You move to (4, 8).")
assert_string_contains(game.get_node("HUD/EventLog").get_parsed_text(), "Vous vous déplacez vers (4, 8).")
var submitted_game := GameScene.instantiate() as Game
add_child_autofree(submitted_game)
@@ -32,7 +32,7 @@ func test_real_game_scene_completes_adjacent_bump_combat_and_defeat_route() -> v
game._sync_enemy_views()
var hud := game.get_node("HUD") as GameHud
hud.refresh(state, [], game.get_run_state())
assert_eq(hud.combat_summary, "Target: Goblin HP: 6/6")
assert_eq(hud.combat_summary, "Gobelin — PV : 6/6")
var first_melee := game.submit_test_action(Vector2i.RIGHT)
assert_eq(first_melee[0].kind, &"melee")
@@ -45,7 +45,7 @@ func test_real_game_scene_completes_adjacent_bump_combat_and_defeat_route() -> v
assert_eq(lethal_melee[0].kind, &"melee")
assert_eq(lethal_melee[1].kind, &"enemy_defeated")
assert_false(state.enemies.has(&"goblin"))
assert_eq(hud.combat_summary, "No active target")
assert_eq(hud.combat_summary, "Aucune cible active")
func _key_event(keycode: Key) -> InputEventKey:
var event := InputEventKey.new()
+3 -3
View File
@@ -13,8 +13,8 @@ func test_real_input_event_records_one_action_turn_and_hud_renders_its_run_state
var run := game.get_run_state()
var events := run.recent_events(2)
var event_log := game.get_node("HUD/EventLog") as RichTextLabel
var expected_hud_text := ""
for event in events:
var expected_hud_text := "Vous vous déplacez vers (3, 7).\n"
for event in events.slice(1):
expected_hud_text += event.message + "\n"
# One input resolves movement plus an enemy response. They are one player action,
@@ -24,7 +24,7 @@ func test_real_input_event_records_one_action_turn_and_hud_renders_its_run_state
assert_eq(events.map(func(event: GameEvent) -> int: return event.turn), [1, 1])
assert_eq(run.current_turn, 1)
assert_eq(event_log.get_parsed_text(), expected_hud_text)
assert_string_contains(event_log.get_parsed_text(), events[0].message)
assert_string_contains(event_log.get_parsed_text(), "Vous vous déplacez vers (3, 7).")
assert_string_contains(event_log.get_parsed_text(), events[1].message)
func _key_event(keycode: Key) -> InputEventKey:
+6 -4
View File
@@ -107,10 +107,12 @@ func _assert_live_play_area_masks(layout: Control, artboard_rect: Rect2, play_re
continue
assert_eq(mask.get_global_rect(), expected_masks[mask_name], "%s must exactly cover its artboard band outside PlayAreaFrame" % mask_name)
assert_false(mask.get_global_rect().intersects(play_rect), "%s must leave the PlayAreaFrame interior visible" % mask_name)
var style := mask.get_theme_stylebox(&"panel") as StyleBoxFlat
assert_not_null(style, "%s requires an opaque panel style" % mask_name)
if style != null:
assert_eq(style.bg_color.a, 1.0, "%s must be fully opaque" % mask_name)
var style := mask.get_theme_stylebox(&"panel")
assert_true(style is StyleBoxTexture, "%s requires the textured dungeon background style" % mask_name)
if style is StyleBoxTexture:
var texture_style := style as StyleBoxTexture
assert_not_null(texture_style.texture, "%s requires a visible dungeon background texture" % mask_name)
assert_eq(texture_style.modulate_color.a, 1.0, "%s must remain fully opaque" % mask_name)
func _assert_legacy_panel_paths(layout: Control) -> void:
assert_not_null(layout.get_node_or_null("StatsPanel") as PanelContainer, "HUD must preserve ResponsiveLayout/StatsPanel")
+6 -4
View File
@@ -132,10 +132,12 @@ func test_play_area_has_four_opaque_masks_that_cover_only_the_artboard_outside_t
assert_true(mask.visible, "%s must be visible at %s" % [mask_name, viewport_size])
assert_eq(mask.get_global_rect(), expected_masks[mask_name], "%s must exactly cover its outside-PlayAreaFrame band at %s" % [mask_name, viewport_size])
assert_false(mask.get_global_rect().intersects(play_rect), "%s must not mask the PlayAreaFrame interior at %s" % [mask_name, viewport_size])
var style := mask.get_theme_stylebox(&"panel") as StyleBoxFlat
assert_not_null(style, "%s requires an explicit opaque panel style" % mask_name)
if style != null:
assert_eq(style.bg_color.a, 1.0, "%s must be fully opaque" % mask_name)
var style := mask.get_theme_stylebox(&"panel")
assert_true(style is StyleBoxTexture, "%s requires the textured dungeon background style" % mask_name)
if style is StyleBoxTexture:
var texture_style := style as StyleBoxTexture
assert_not_null(texture_style.texture, "%s requires a visible dungeon background texture" % mask_name)
assert_eq(texture_style.modulate_color.a, 1.0, "%s must remain fully opaque" % mask_name)
func test_camera_focal_center_aligns_with_the_unmasked_central_play_area() -> void:
var game := GameScene.instantiate() as Game
+6 -4
View File
@@ -17,9 +17,11 @@ func test_help_band_displays_the_exact_control_labels() -> void:
assert_not_null(help_label)
if help_label == null:
return
assert_string_contains(help_label.text, "Déplacer : ZQSD / Flèches")
assert_string_contains(help_label.text, "nord-est : pavé num. 9")
assert_string_contains(help_label.text, "Interagir : Espace ou E")
assert_string_contains(help_label.text, "Déplacer")
assert_string_contains(help_label.text, "Interagir")
assert_string_contains(help_label.text, "Inventaire")
assert_string_contains(help_label.text, "Sauvegarde")
assert_string_contains(help_label.text, "Aide")
func test_xp_bar_shows_progress_inside_the_current_level_and_refreshes_after_xp_gain() -> void:
var hud := game.get_node_or_null("HUD") as GameHud
@@ -772,7 +774,7 @@ func test_command_bar_keeps_all_three_zones_readable_at_reference_and_compact_si
var prompt_panel := layout.get_node_or_null("PromptPanel") as Control if layout != null else null
var help_panel := layout.get_node_or_null("HelpPanel") as Control if layout != null else null
var quick_hint := layout.get_node_or_null("QuickSlotHint") as Label if layout != null else null
var prompt := hud.get_node_or_null("ContextPromptLabel") as Label
var prompt := layout.get_node_or_null("PromptPanel/ActionHintLabel") as Label if layout != null else null
var help := hud.get_node_or_null("HelpLabel") as Label
assert_not_null(command_bar, "CommandBar is required at %s" % viewport_size)
assert_not_null(quick_slots)