fix(ui): sharpen round-button icons
Import icon SVGs at 120px intrinsic size, expand them in round buttons with content margins preserving the original visual size, and assert icon resolution in QA.
This commit is contained in:
1 parent
3587c7bd64
commit
7abd1226cb
17 files changed
+73
-31
No files matched your search
@@ -43,11 +43,47 @@ func _run() -> void:
|
||||
_test_daily(save)
|
||||
_test_frames(save)
|
||||
_test_game_data(save)
|
||||
_test_icons()
|
||||
|
||||
_reset_to_clean(save)
|
||||
_finish()
|
||||
|
||||
|
||||
func _test_icons() -> void:
|
||||
_note("5. icon assets")
|
||||
# Load at runtime so UI.gd does not compile before the autoload exists.
|
||||
var ui_script = load("res://scripts/UI.gd")
|
||||
_check(ui_script != null, "UI script missing")
|
||||
if ui_script == null:
|
||||
return
|
||||
|
||||
var dir := DirAccess.open("res://assets/icons")
|
||||
_check(dir != null, "icons directory missing")
|
||||
if dir == null:
|
||||
return
|
||||
|
||||
var count := 0
|
||||
for file in dir.get_files():
|
||||
if not file.ends_with(".svg"):
|
||||
continue
|
||||
count += 1
|
||||
var texture = load("res://assets/icons/" + file)
|
||||
_check(texture != null, "icon failed to load: %s" % file)
|
||||
if texture != null:
|
||||
var size: Vector2 = texture.get_size()
|
||||
_check(size.x >= 96 and size.y >= 96, "icon too small: %s (%dx%d)" % [file, size.x, size.y])
|
||||
_check(count >= 10, "expected the full icon set")
|
||||
|
||||
var button = ui_script.round_button("res://assets/icons/arrow-left.svg", 44)
|
||||
_check(button.expand_icon, "round buttons should expand high-res icons")
|
||||
var style := button.get_theme_stylebox("normal") as StyleBoxFlat
|
||||
_check(style != null and style.content_margin_left >= 8, "round buttons should use margins to keep icon size")
|
||||
var small_icon = ui_script.icon("res://assets/icons/settings.svg", 18)
|
||||
_check(small_icon.texture.get_size().x >= 96, "UI.icon should use high-res textures")
|
||||
button.free()
|
||||
small_icon.free()
|
||||
|
||||
|
||||
func _finish() -> void:
|
||||
if failures == 0:
|
||||
print("QA CORE: PASS")
|
||||
|
||||
Reference in new issue
Block a user