Improve readable text backings

This commit is contained in:
2026-06-20 17:16:43 +09:00
parent cce0207ce7
commit 81672d5a27
3 changed files with 90 additions and 14 deletions

View File

@@ -3692,6 +3692,7 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
_check_top_hud_chip(failures, scene, "TopStatusChip", scene.status_label, "군령")
_check_top_hud_chip(failures, scene, "TopObjectiveChip", scene.objective_label, "승리:")
_check_top_hud_chip(failures, scene, "TopCampaignChip", scene.campaign_status_label, "군자금")
_check_panel_uses_flat_readable_backing(failures, _find_descendant_by_name(scene.ui_root_control, "TopHudBar") as PanelContainer, "top HUD compact text backing")
var mission_text := scene._format_mission_panel_text()
for expected in ["승리:", "패배:", "진행:", "주의:"]:
if not mission_text.contains(expected):
@@ -3741,6 +3742,10 @@ func _check_ancient_ui_theme(failures: Array[String]) -> void:
_check_panel_style_frame(failures, scene.cell_info_panel, "HUD terrain info panel", Color(0.42, 0.35, 0.24, 0.98), 2)
_check_panel_style_fill(failures, scene.forecast_panel, "HUD forecast info panel", Color(0.060, 0.056, 0.048, 0.982))
_check_panel_style_frame(failures, scene.forecast_panel, "HUD forecast info panel", Color(0.42, 0.35, 0.24, 0.98), 2)
_check_panel_uses_flat_readable_backing(failures, scene.title_load_panel, "title load readable panel")
_check_panel_uses_flat_readable_backing(failures, scene.title_settings_panel, "title settings readable panel")
_check_panel_uses_flat_readable_backing(failures, _find_descendant_by_name(scene.ui_root_control, "SettingsPanel") as PanelContainer, "battle settings readable panel")
_check_rich_text_readability(failures, scene.log_box, "battle log text")
if scene.cell_info_icon == null:
failures.append("HUD terrain info panel should expose an icon chip")
if scene.forecast_icon == null:
@@ -4331,6 +4336,47 @@ func _check_panel_uses_flat_text_surface(failures: Array[String], panel: PanelCo
failures.append("%s should reserve breathing room around readable text" % label)
func _check_panel_uses_flat_readable_backing(failures: Array[String], panel: PanelContainer, label: String) -> void:
if panel == null:
failures.append("%s missing" % label)
return
var stylebox := panel.get_theme_stylebox("panel")
if not (stylebox is StyleBoxFlat):
failures.append("%s should use a flat readable backing behind Korean text" % label)
return
if bool(panel.get_meta("generated_panel_texture", false)):
failures.append("%s should not mark a busy generated texture behind text" % label)
var style := stylebox as StyleBoxFlat
if style.bg_color.a < 0.98:
failures.append("%s should keep an opaque backing: %s" % [label, str(style.bg_color)])
if style.bg_color.get_luminance() > 0.18 and style.bg_color.a < 0.995:
failures.append("%s bright text backing should be almost opaque: %s" % [label, str(style.bg_color)])
if style.content_margin_left < 6 or style.content_margin_top < 6:
failures.append("%s should keep at least compact text padding" % label)
func _check_rich_text_readability(failures: Array[String], label: RichTextLabel, context: String) -> void:
if label == null:
failures.append("%s missing" % context)
return
var stylebox := label.get_theme_stylebox("normal")
if not (stylebox is StyleBoxFlat):
failures.append("%s should use a flat text log backing" % context)
else:
var style := stylebox as StyleBoxFlat
if style.bg_color.a < 0.98:
failures.append("%s backing should be opaque enough: %s" % [context, str(style.bg_color)])
var text_color := label.get_theme_color("default_color")
if text_color.a < 0.95 or text_color.get_luminance() < 0.70:
failures.append("%s should use bright readable default text: %s" % [context, str(text_color)])
if label.get_theme_font_size("normal_font_size") < 13:
failures.append("%s should keep readable Korean log size: %d" % [context, label.get_theme_font_size("normal_font_size")])
if label.get_theme_constant("outline_size") < 2:
failures.append("%s should keep an outline for text over dark UI" % context)
if label.get_theme_font("normal_font") == null:
failures.append("%s should use the project serif font" % context)
func _check_panel_uses_generated_ornament_texture(failures: Array[String], panel: PanelContainer, label: String) -> void:
if panel == null:
failures.append("%s missing" % label)
@@ -4676,8 +4722,9 @@ func _check_hud_command_grid_layout(failures: Array[String]) -> void:
failures.append("unit command hint should show command title: %s" % ("" if scene.command_hint_title_label == null else scene.command_hint_title_label.text))
if scene.command_hint_detail_label == null or not scene.command_hint_detail_label.text.contains("부대 미지정"):
failures.append("disabled unit command hint should show the blocked reason: %s" % ("" if scene.command_hint_detail_label == null else scene.command_hint_detail_label.text))
if scene.command_hint_icon == null or scene.command_hint_icon.texture == null:
failures.append("unit command hint should show generated command icon artwork")
if scene.command_hint_icon == null or scene.command_hint_icon.texture == null:
failures.append("unit command hint should show generated command icon artwork")
_check_panel_uses_flat_readable_backing(failures, scene.command_hint_panel, "unit command hint readable panel")
scene._on_command_hint_button_mouse_exited()
if scene.command_hint_panel != null and scene.command_hint_panel.visible:
failures.append("unit command hint panel should hide when leaving the icon")
@@ -4714,6 +4761,7 @@ func _check_hud_command_grid_layout(failures: Array[String]) -> void:
failures.append("top command hint should keep command detail: %s" % ("" if scene.command_hint_detail_label == null else scene.command_hint_detail_label.text))
if scene.command_hint_icon == null or scene.command_hint_icon.texture == null or str(scene.end_turn_button.get_meta("command_icon", "")) != "end_turn":
failures.append("top command hint should use generated top command icon artwork")
_check_panel_uses_flat_readable_backing(failures, scene.command_hint_panel, "top command hint readable panel")
scene.free()
@@ -4743,8 +4791,8 @@ func _check_battle_unit_list_panel(failures: Array[String]) -> void:
if scene.battle_unit_list_panel == null or not scene.battle_unit_list_panel.visible:
failures.append("battle unit list panel should open from the top toolbar")
else:
_check_panel_style_fill(failures, scene.battle_unit_list_panel, "battle unit list panel", Color(0.045, 0.048, 0.044, 0.93))
_check_panel_uses_generated_texture(failures, scene.battle_unit_list_panel, "battle unit list generated frame")
_check_panel_style_fill(failures, scene.battle_unit_list_panel, "battle unit list panel", Color(0.045, 0.048, 0.044, 0.988))
_check_panel_uses_flat_readable_backing(failures, scene.battle_unit_list_panel, "battle unit list readable panel")
var header_icon := _find_descendant_by_name(scene.battle_unit_list_panel, "BattleUnitListHeaderIcon")
if header_icon == null or not header_icon is TextureRect or (header_icon as TextureRect).texture == null:
failures.append("battle unit list header should carry generated unit-list icon artwork")