Fix title menu button fit

This commit is contained in:
2026-06-20 11:17:19 +09:00
parent 0062bb719c
commit c1e4c69eff
2 changed files with 50 additions and 6 deletions

View File

@@ -76,6 +76,11 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
failures.append("title screen should use a dedicated cinematic background, not the first battle map backdrop")
if scene.title_portrait_texture_rect == null or scene.title_portrait_texture_rect.texture == null:
failures.append("title screen should show Cao Cao portrait art")
var portrait_shadow := scene.title_screen_root.find_child("TitlePortraitLacquerField", true, false) as ColorRect if scene.title_screen_root != null else null
if portrait_shadow == null:
failures.append("title screen should keep a subtle portrait grounding field")
elif portrait_shadow.color.a > 0.18:
failures.append("title portrait grounding field should not read as a black rectangle: %.2f alpha" % portrait_shadow.color.a)
if scene.title_panel == null or scene.title_panel.position.x > 100.0:
failures.append("title menu panel should sit on the left side of the cinematic title screen")
elif scene.title_portrait_texture_rect != null and scene.title_panel.position.x + scene.title_panel.size.x >= scene.title_portrait_texture_rect.position.x:
@@ -112,6 +117,7 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
failures.append("title start command should be visible on first screen")
if scene.title_start_button.custom_minimum_size.y < 54.0:
failures.append("title start command should be tall enough to read clearly")
_check_title_command_fit(failures, scene.title_start_button, "title start")
_check_title_menu_button_art(failures, scene.title_start_button, "new", "title start")
if scene.title_load_button == null or scene.title_load_button.text != "로드하기":
failures.append("title screen should expose `로드하기`")
@@ -122,6 +128,7 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
failures.append("title load command should be visible on first screen")
if scene.title_load_button.custom_minimum_size.y < 54.0:
failures.append("title load command should be tall enough to read clearly")
_check_title_command_fit(failures, scene.title_load_button, "title load")
_check_title_menu_button_art(failures, scene.title_load_button, "load", "title load")
if scene.title_load_panel == null:
failures.append("title screen should create a load-slot selection panel")
@@ -134,6 +141,7 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
failures.append("title settings command should be visible on first screen")
if scene.title_settings_button.custom_minimum_size.y < 54.0:
failures.append("title settings command should be tall enough to read clearly")
_check_title_command_fit(failures, scene.title_settings_button, "title settings")
_check_title_menu_button_art(failures, scene.title_settings_button, "settings", "title settings")
if scene.title_settings_back_button != null and scene.title_settings_back_button.visible:
failures.append("title settings back command should stay hidden until settings are open")
@@ -379,8 +387,8 @@ func _check_title_menu_button_art(failures: Array[String], button: Button, expec
failures.append("%s should keep command icon metadata `%s`, got `%s`" % [context, expected_icon, str(button.get_meta("command_icon", ""))])
if button.icon == null:
failures.append("%s should expose generated icon art" % context)
elif button.icon.get_width() < 128 or button.icon.get_height() < 128:
failures.append("%s should use high-resolution generated icon art, got %dx%d" % [context, button.icon.get_width(), button.icon.get_height()])
elif button.icon.get_width() > BattleSceneScript.TITLE_MENU_ICON_MAX_WIDTH or button.icon.get_height() > BattleSceneScript.TITLE_MENU_ICON_MAX_WIDTH:
failures.append("%s icon should render at title-menu size, got %dx%d" % [context, button.icon.get_width(), button.icon.get_height()])
var stylebox := button.get_theme_stylebox("normal")
if not (stylebox is StyleBoxTexture):
failures.append("%s should use a generated button texture surface" % context)
@@ -394,6 +402,21 @@ func _check_title_menu_button_art(failures: Array[String], button: Button, expec
failures.append("%s should describe its command through a tooltip" % context)
func _check_title_command_fit(failures: Array[String], button: Button, context: String) -> void:
if button == null:
return
if button.expand_icon:
failures.append("%s icon should not expand into an oversized title command" % context)
var icon_limit := button.get_theme_constant("icon_max_width")
if icon_limit <= 0 or icon_limit > BattleSceneScript.TITLE_MENU_ICON_MAX_WIDTH:
failures.append("%s icon should be capped at title-menu size, got %d" % [context, icon_limit])
var combined := button.get_combined_minimum_size()
if combined.y > 76.0:
failures.append("%s combined height should fit inside the title menu, got %.1f" % [context, combined.y])
if combined.x > 420.0:
failures.append("%s combined width should fit inside the title menu, got %.1f" % [context, combined.x])
func _check_bgm_stream_quality(failures: Array[String], stream: AudioStream, label: String, minimum_length: float) -> void:
if stream == null:
failures.append("%s BGM stream should load before playback" % label)