Add visual crests to battle unit list
This commit is contained in:
@@ -3947,6 +3947,15 @@ func _find_descendant_by_name(root: Node, node_name: String) -> Node:
|
||||
return null
|
||||
|
||||
|
||||
func _count_descendants_by_name(root: Node, node_name: String) -> int:
|
||||
if root == null:
|
||||
return 0
|
||||
var count := 1 if str(root.name).begins_with(node_name) else 0
|
||||
for child in root.get_children():
|
||||
count += _count_descendants_by_name(child, node_name)
|
||||
return count
|
||||
|
||||
|
||||
func _is_descendant_of(node: Node, ancestor: Node) -> bool:
|
||||
var current := node
|
||||
while current != null:
|
||||
@@ -4171,6 +4180,12 @@ func _check_battle_unit_list_panel(failures: Array[String]) -> void:
|
||||
else:
|
||||
_check_panel_style_fill(failures, scene.battle_unit_list_panel, "battle unit list panel", Color(0.045, 0.048, 0.044, 0.93))
|
||||
_check_panel_uses_generated_texture(failures, scene.battle_unit_list_panel, "battle unit list generated frame")
|
||||
var header_icon := _find_descendant_by_name(scene.battle_unit_list_panel, "BattleUnitListHeaderIcon")
|
||||
if header_icon == null or not header_icon is TextureRect or (header_icon as TextureRect).texture == null:
|
||||
failures.append("battle unit list header should carry generated unit-list icon artwork")
|
||||
var header_seal := _find_descendant_by_name(scene.battle_unit_list_panel, "BattleUnitListHeaderSeal")
|
||||
if header_seal == null:
|
||||
failures.append("battle unit list header should use a compact Korean seal mark")
|
||||
if scene.battle_unit_list_title_label == null or not scene.battle_unit_list_title_label.text.contains("아군"):
|
||||
failures.append("battle unit list should open on the ally tab")
|
||||
if scene.battle_unit_list_rows == null or scene.battle_unit_list_rows.get_child_count() < 2:
|
||||
@@ -4189,6 +4204,10 @@ func _check_battle_unit_list_panel(failures: Array[String]) -> void:
|
||||
failures.append("ally battle unit list tooltips should retain selection detail: %s" % ally_tooltips)
|
||||
if not _has_descendant_texture(scene.battle_unit_list_rows):
|
||||
failures.append("ally battle unit list should show officer portrait artwork")
|
||||
if _find_descendant_by_name(scene.battle_unit_list_rows, "BattleUnitListClassIcon") == null:
|
||||
failures.append("ally battle unit list rows should overlay generated class crest artwork")
|
||||
if _count_descendants_by_name(scene.battle_unit_list_rows, "BattleUnitListBadgeIcon") < 4:
|
||||
failures.append("ally battle unit list compact badges should include icon artwork for class, HP, action, and zone")
|
||||
|
||||
scene._on_battle_unit_list_row_pressed("cao_cao")
|
||||
var selected: Dictionary = scene.state.get_selected_unit()
|
||||
@@ -4218,6 +4237,10 @@ func _check_battle_unit_list_panel(failures: Array[String]) -> void:
|
||||
failures.append("enemy battle unit list tooltips should retain enemy detail: %s" % enemy_tooltips)
|
||||
if not _has_descendant_texture(scene.battle_unit_list_rows):
|
||||
failures.append("enemy battle unit list should show unit sprite artwork")
|
||||
if _find_descendant_by_name(scene.battle_unit_list_rows, "BattleUnitListClassIcon") == null:
|
||||
failures.append("enemy battle unit list rows should overlay generated class crest artwork")
|
||||
if _count_descendants_by_name(scene.battle_unit_list_rows, "BattleUnitListBadgeIcon") < 4:
|
||||
failures.append("enemy battle unit list compact badges should include icon artwork for class, HP, action, and zone")
|
||||
scene._on_battle_unit_list_row_pressed("yellow_turban_1")
|
||||
selected = scene.state.get_selected_unit()
|
||||
if selected.is_empty() or str(selected.get("id", "")) != "cao_cao":
|
||||
|
||||
Reference in New Issue
Block a user