diff --git a/user_interface/button_selection.gd b/user_interface/button_selection.gd index 0d9e0f8..f79eb5c 100644 --- a/user_interface/button_selection.gd +++ b/user_interface/button_selection.gd @@ -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