Reword editor warning for ItemSelection

This commit is contained in:
kayomn 2023-01-21 15:05:37 +00:00
parent b4772546b3
commit 5d02cd16c7
1 changed files with 8 additions and 4 deletions

View File

@ -17,11 +17,15 @@ var item_count: int:
func _get_configuration_warnings() -> PackedStringArray:
var warnings := PackedStringArray()
var children := get_children()
for child in get_children():
warnings.append(
"ItemSelection can only have children of type Button, but {0} is of type {1}".format(
[child.name, child.get_class()]))
if not(children.is_empty()):
var self_class_name := get_class()
for child in get_children():
warnings.append(
"{0} can only have Button children, but {1} is of type {2}".format(
[self_class_name, child.name, child.get_class()]))
return warnings