From b4772546b3228e8acc0a4f54388879aeea79b52d Mon Sep 17 00:00:00 2001 From: kayomn Date: Sat, 21 Jan 2023 15:03:12 +0000 Subject: [PATCH] Add editor warnings to ButtonSelection --- user_interface/button_selection.gd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/user_interface/button_selection.gd b/user_interface/button_selection.gd index d94a691..0d9e0f8 100644 --- a/user_interface/button_selection.gd +++ b/user_interface/button_selection.gd @@ -16,7 +16,14 @@ var item_count: int: return _button_group.get_buttons().size() func _get_configuration_warnings() -> PackedStringArray: - return PackedStringArray() + var warnings := PackedStringArray() + + 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()])) + + return warnings ## ## Adds a new item with no text and only [code]icon[/code] as the icon to the selection.