Enable QHD-friendly UI texture mipmaps

This commit is contained in:
2026-06-20 14:29:50 +09:00
parent 7f95f47d86
commit 9a482a1908
57 changed files with 93 additions and 56 deletions

View File

@@ -94,6 +94,7 @@ func _init() -> void:
_check_generated_toolbar_icons(failures)
_check_generated_panel_textures(failures)
_check_generated_button_textures(failures)
_check_qhd_ui_import_settings(failures)
_check_generated_tile_marker_textures(failures)
_check_generated_class_icon_textures(failures)
_check_generated_map_badge_textures(failures)
@@ -3000,6 +3001,42 @@ func _check_generated_button_textures(failures: Array[String]) -> void:
_check_icon_button_texture_path(failures, "res://art/ui/buttons/button_icon_%s.png" % button_key, "icon button texture %s" % button_key)
func _check_qhd_ui_import_settings(failures: Array[String]) -> void:
var import_paths := _collect_png_import_files("res://art/ui")
if import_paths.size() < 50:
failures.append("UI import check should cover the generated interface atlas, got %d files" % import_paths.size())
for import_path in import_paths:
var text := FileAccess.get_file_as_string(import_path)
if text.is_empty():
failures.append("UI import metadata should be readable: %s" % import_path)
continue
if not text.contains("mipmaps/generate=true"):
failures.append("QHD UI texture should generate mipmaps to avoid jagged fullscreen scaling: %s" % import_path)
if not text.contains("process/fix_alpha_border=true"):
failures.append("UI texture import should keep alpha border fix for clean transparent edges: %s" % import_path)
func _collect_png_import_files(root_path: String) -> Array[String]:
var result: Array[String] = []
var dir := DirAccess.open(root_path)
if dir == null:
return result
dir.list_dir_begin()
var file_name := dir.get_next()
while not file_name.is_empty():
if file_name.begins_with("."):
file_name = dir.get_next()
continue
var full_path := "%s/%s" % [root_path, file_name]
if dir.current_is_dir():
result.append_array(_collect_png_import_files(full_path))
elif file_name.ends_with(".png.import"):
result.append(full_path)
file_name = dir.get_next()
dir.list_dir_end()
return result
func _check_generated_tile_marker_textures(failures: Array[String]) -> void:
var marker_keys := ["move", "attack", "select", "target", "objective", "recover"]
for marker_key in marker_keys: