From 99b786e5a5641575146cafaaa467889131aa191d Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 9 Mar 2022 18:31:54 +0100 Subject: [PATCH] add_slot in ResourcePropertyList.gd will now return the expected index. --- game/addons/world_generator/ui/ResourcePropertyList.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/game/addons/world_generator/ui/ResourcePropertyList.gd b/game/addons/world_generator/ui/ResourcePropertyList.gd index c25c79ae..8d77e3c2 100644 --- a/game/addons/world_generator/ui/ResourcePropertyList.gd +++ b/game/addons/world_generator/ui/ResourcePropertyList.gd @@ -310,16 +310,18 @@ func add_slot(getter : String, setter : String, control : Control) -> int: var content_node = $MainContainer/Content content_node.add_child(control) - var slot_idx : int = content_node.get_child_count() - 1 + var child_idx : int = content_node.get_child_count() - 1 var arr : Array = Array() - arr.append(slot_idx) + arr.append(child_idx) arr.append(getter) arr.append(setter) arr.append(control) properties.append(arr) + + var slot_idx : int = properties.size() - 1 return slot_idx