fix: keep character and journal headings visible

This commit is contained in:
goose
2026-10-09 15:57:58 -04:00
parent bbf89a9f36
commit f9ef3d72aa
2 changed files with 24 additions and 4 deletions
+9 -3
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=25 format=3]
[gd_scene load_steps=26 format=3]
[ext_resource type="Script" path="res://scripts/game/game.gd" id="1_game"]
[ext_resource type="Script" path="res://scripts/presentation/map_renderer.gd" id="2_map"]
@@ -72,6 +72,8 @@ corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
[sub_resource type="StyleBoxEmpty" id="StyleBox_legacy_transparent"]
[sub_resource type="StyleBoxFlat" id="StyleBox_prompt_panel"]
bg_color = Color(0.10, 0.075, 0.042, 0.98)
border_width_left = 2
@@ -359,7 +361,7 @@ theme_override_styles/panel = SubResource("StyleBox_section")
[node name="CharacterSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.9, 0.7, 1)
theme_override_colors/font_color = Color(0.96, 0.84, 0.48, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 3
@@ -419,7 +421,7 @@ theme_override_styles/panel = SubResource("StyleBox_section")
[node name="JournalSectionTitle" type="Label" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
theme_override_colors/font_color = Color(0.96, 0.9, 0.7, 1)
theme_override_colors/font_color = Color(0.96, 0.84, 0.48, 1)
theme_override_colors/font_outline_color = Color(0.06, 0.035, 0.015, 1)
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.85)
theme_override_constants/outline_size = 3
@@ -450,10 +452,14 @@ theme_override_styles/panel = SubResource("StyleBox_hud_panel")
[node name="StatsPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
show_behind_parent = true
theme_override_styles/panel = SubResource("StyleBox_legacy_transparent")
[node name="LogPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 0
mouse_filter = 2
show_behind_parent = true
theme_override_styles/panel = SubResource("StyleBox_legacy_transparent")
[node name="PromptPanel" type="PanelContainer" parent="HUD/ResponsiveLayout"]
layout_mode = 0
+15 -1
View File
@@ -81,6 +81,8 @@ func test_hud_preserves_legacy_responsive_panel_paths() -> void:
return
assert_true(stats_panel.get_global_rect().encloses(player_health.get_global_rect()))
assert_true(log_panel.get_global_rect().encloses(event_log.get_global_rect()))
_assert_legacy_panel_is_transparent_and_behind(stats_panel)
_assert_legacy_panel_is_transparent_and_behind(log_panel)
assert_true(prompt_panel.get_global_rect().encloses(prompt.get_global_rect()))
assert_true(help_panel.get_global_rect().encloses(help.get_global_rect()))
@@ -465,6 +467,13 @@ func test_named_left_and_right_rail_sections_are_visible_enclosed_and_non_overla
_assert_named_non_overlapping_sections(layout, "LeftRail", ["CharacterSection", "ObjectivesSection", "StatusSection"])
_assert_named_non_overlapping_sections(layout, "RightRail", ["JournalSection", "MapSection"])
func _assert_legacy_panel_is_transparent_and_behind(panel: PanelContainer) -> void:
assert_true(panel.has_theme_stylebox_override(&"panel"), "%s requires an explicit local panel style rather than an inherited theme style" % panel.name)
var style := panel.get_theme_stylebox(&"panel")
assert_not_null(style, "%s requires an explicit local transparent panel style" % panel.name)
assert_true(style is StyleBoxEmpty or (style is StyleBoxFlat and (style as StyleBoxFlat).bg_color.a == 0.0), "%s must not repaint over section headings" % panel.name)
assert_true(panel.show_behind_parent, "%s must draw behind its parent and section titles" % panel.name)
func _assert_named_non_overlapping_sections(layout: Control, rail_name: String, section_names: Array[String]) -> void:
var rail := layout.get_node_or_null(rail_name) as Control
assert_not_null(rail, "ResponsiveLayout requires %s" % rail_name)
@@ -822,7 +831,12 @@ func test_character_and_journal_titles_use_the_final_large_outlined_light_style(
continue
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)
var font_color := title.get_theme_color(&"font_color")
assert_gte(font_color.r, 0.95, "%s must use an explicit gold/yellow red channel" % title.name)
assert_gte(font_color.g, 0.70, "%s must use an explicit gold/yellow green channel" % title.name)
assert_lte(font_color.g, 0.90, "%s must use an explicit gold/yellow green channel" % title.name)
assert_lte(font_color.b, 0.55, "%s must use an explicit gold/yellow blue channel" % title.name)
assert_eq(font_color.a, 1.0, "%s must be fully opaque" % 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: