Add generated icons to title menu buttons
This commit is contained in:
@@ -123,16 +123,22 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
|
||||
failures.append("briefing should stay hidden behind the title screen")
|
||||
if scene.title_start_button == null or scene.title_start_button.text != "처음부터 시작":
|
||||
failures.append("title screen should expose Start from Beginning")
|
||||
else:
|
||||
_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 Game Load")
|
||||
elif not scene.title_load_button.disabled:
|
||||
failures.append("Game Load should be disabled when no save exists")
|
||||
else:
|
||||
_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")
|
||||
elif scene.title_load_panel.visible:
|
||||
failures.append("load-slot selection panel should stay hidden until Game Load is pressed")
|
||||
if scene.title_settings_button == null or scene.title_settings_button.text != "환경 설정":
|
||||
failures.append("title screen should expose Settings")
|
||||
else:
|
||||
_check_title_menu_button_art(failures, scene.title_settings_button, "settings", "title settings")
|
||||
|
||||
scene._on_title_settings_pressed()
|
||||
if scene.title_settings_panel == null or not scene.title_settings_panel.visible:
|
||||
@@ -169,6 +175,8 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
|
||||
persisted_scene.free()
|
||||
if scene.title_audio_reset_button == null or scene.title_audio_reset_button.text != "소리 켜기":
|
||||
failures.append("title settings should expose a one-click audio recovery button")
|
||||
else:
|
||||
_check_title_menu_button_art(failures, scene.title_audio_reset_button, "status", "title audio reset")
|
||||
scene._on_title_audio_reset_pressed()
|
||||
if not scene.title_bgm_enabled or not scene.title_sfx_enabled:
|
||||
failures.append("title audio recovery should re-enable BGM and SFX")
|
||||
@@ -284,10 +292,14 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
|
||||
failures.append("load-slot selection should enable the automatic campaign save")
|
||||
elif not scene.title_load_auto_button.text.contains("자동 기록"):
|
||||
failures.append("automatic load slot should be labeled in Korean")
|
||||
else:
|
||||
_check_title_menu_button_art(failures, scene.title_load_auto_button, "campaign", "title automatic load slot")
|
||||
if scene.title_load_manual_button == null or scene.title_load_manual_button.disabled:
|
||||
failures.append("load-slot selection should enable the manual checkpoint save")
|
||||
elif not scene.title_load_manual_button.text.contains("수동 봉인"):
|
||||
failures.append("manual load slot should be labeled in Korean")
|
||||
else:
|
||||
_check_title_menu_button_art(failures, scene.title_load_manual_button, "save", "title manual load slot")
|
||||
scene._show_title_menu()
|
||||
if scene.title_load_panel != null and scene.title_load_panel.visible:
|
||||
failures.append("showing the title menu again should reset the load-slot panel")
|
||||
@@ -342,6 +354,31 @@ func _check_title_menu_start_load_and_settings(failures: Array[String]) -> void:
|
||||
scene.free()
|
||||
|
||||
|
||||
func _check_title_menu_button_art(failures: Array[String], button: Button, expected_icon: String, context: String) -> void:
|
||||
if button == null:
|
||||
failures.append("%s button missing" % context)
|
||||
return
|
||||
if not bool(button.get_meta("title_menu_button", false)):
|
||||
failures.append("%s should be configured as a generated title menu button" % context)
|
||||
if str(button.get_meta("command_icon", "")) != expected_icon:
|
||||
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()])
|
||||
var stylebox := button.get_theme_stylebox("normal")
|
||||
if not (stylebox is StyleBoxTexture):
|
||||
failures.append("%s should use a generated button texture surface" % context)
|
||||
return
|
||||
var style := stylebox as StyleBoxTexture
|
||||
if style.texture == null:
|
||||
failures.append("%s generated button surface is missing its texture" % context)
|
||||
elif style.texture.get_width() < 512 or style.texture.get_height() < 192:
|
||||
failures.append("%s generated button texture should keep high-resolution source pixels: %dx%d" % [context, style.texture.get_width(), style.texture.get_height()])
|
||||
if str(button.tooltip_text).strip_edges().is_empty():
|
||||
failures.append("%s should describe its command through a tooltip" % context)
|
||||
|
||||
|
||||
func _backup_user_file(path: String) -> Dictionary:
|
||||
if not FileAccess.file_exists(path):
|
||||
return {"exists": false, "text": ""}
|
||||
|
||||
Reference in New Issue
Block a user