Use generated gold reward chip
This commit is contained in:
@@ -60,6 +60,11 @@ func _init() -> void:
|
||||
_check_contains(failures, "reward strip Cao Ren tooltip", reward_tooltips, "합류: 조인")
|
||||
_check_contains(failures, "reward strip archer class tooltip", reward_tooltips, "병과: 궁병")
|
||||
_check_contains(failures, "reward strip infantry class tooltip", reward_tooltips, "병과: 보병")
|
||||
var gold_chip := _find_named_node(scene.result_reward_strip, "ResultRewardGoldChip")
|
||||
if gold_chip == null:
|
||||
failures.append("reward icon strip should show gold as a generated image chip")
|
||||
elif not _has_named_texture_rect(gold_chip, "ResultRewardGoldIcon"):
|
||||
failures.append("gold reward chip should use the generated gold badge art")
|
||||
if _count_named_nodes(scene.result_reward_strip, "ResultRewardClassBadge") < 2:
|
||||
failures.append("joined officer reward chips should show compact class crests")
|
||||
if not _has_texture_rect(scene.result_reward_strip):
|
||||
@@ -168,6 +173,25 @@ func _has_texture_rect(root: Node) -> bool:
|
||||
return false
|
||||
|
||||
|
||||
func _has_named_texture_rect(root: Node, node_name: String) -> bool:
|
||||
if root.name == node_name and root is TextureRect and (root as TextureRect).texture != null:
|
||||
return true
|
||||
for child in root.get_children():
|
||||
if _has_named_texture_rect(child, node_name):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _find_named_node(root: Node, node_name: String) -> Node:
|
||||
if root.name == node_name:
|
||||
return root
|
||||
for child in root.get_children():
|
||||
var found := _find_named_node(child, node_name)
|
||||
if found != null:
|
||||
return found
|
||||
return null
|
||||
|
||||
|
||||
func _count_named_nodes(root: Node, node_name: String) -> int:
|
||||
var count := 1 if root.name == node_name else 0
|
||||
for child in root.get_children():
|
||||
|
||||
Reference in New Issue
Block a user