Compact prebattle armory rows
This commit is contained in:
@@ -191,8 +191,14 @@ func _check_unequip_ui_entries(failures: Array[String]) -> void:
|
||||
|
||||
scene.armory_unit_id = "cao_cao"
|
||||
scene._rebuild_armory_menu()
|
||||
if not _container_has_button_text(scene.armory_list, "병장 해제:"):
|
||||
failures.append("pre-battle Armory should include an Unequip Weapon button")
|
||||
if not _container_has_button_text(scene.armory_list, "해제"):
|
||||
failures.append("pre-battle Armory should expose a compact unequip button")
|
||||
if _container_has_button_text(scene.armory_list, "병장 해제:"):
|
||||
failures.append("pre-battle Armory should move long unequip wording into tooltips")
|
||||
if not _container_has_tooltip_text(scene.armory_list, "병장 해제:"):
|
||||
failures.append("pre-battle Armory tooltip should preserve full unequip detail")
|
||||
if not _container_has_texture(scene.armory_list):
|
||||
failures.append("pre-battle Armory should show item or officer artwork")
|
||||
|
||||
scene.free()
|
||||
|
||||
@@ -201,6 +207,26 @@ func _container_has_button_text(container: Node, fragment: String) -> bool:
|
||||
for child in container.get_children():
|
||||
if child is Button and str(child.text).contains(fragment):
|
||||
return true
|
||||
if _container_has_button_text(child, fragment):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _container_has_tooltip_text(container: Node, fragment: String) -> bool:
|
||||
if container is Control and str((container as Control).tooltip_text).contains(fragment):
|
||||
return true
|
||||
for child in container.get_children():
|
||||
if _container_has_tooltip_text(child, fragment):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _container_has_texture(container: Node) -> bool:
|
||||
if container is TextureRect and (container as TextureRect).texture != null:
|
||||
return true
|
||||
for child in container.get_children():
|
||||
if _container_has_texture(child):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user