From ef03b30dfe4589b338f1b115fc99a4e7da21992a Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 27 Dec 2021 22:25:37 +0100 Subject: [PATCH] Now HSeparators can also be added to the property inspector. --- game/addons/world_generator/ui/ResourcePropertyList.gd | 10 ++++++++++ game/world_generator/continents/test_continent.gd | 1 + game/world_generator/subzones/spawner.gd | 1 + 3 files changed, 12 insertions(+) diff --git a/game/addons/world_generator/ui/ResourcePropertyList.gd b/game/addons/world_generator/ui/ResourcePropertyList.gd index 6daa2dd2..8fb81b28 100644 --- a/game/addons/world_generator/ui/ResourcePropertyList.gd +++ b/game/addons/world_generator/ui/ResourcePropertyList.gd @@ -6,6 +6,16 @@ var EditorResourceWidget : PackedScene = preload("res://addons/world_generator/w var _edited_resource : WorldGenBaseResource = null var properties : Array = Array() +func add_h_separator() -> int: + var hsep : HSeparator = HSeparator.new() + + var content_node = $MainContainer/Content + + content_node.add_child(hsep) + var slot_idx : int = content_node.get_child_count() - 1 + + return slot_idx + func add_slot_color(getter : String, setter : String) -> int: var cp : ColorPickerButton = ColorPickerButton.new() diff --git a/game/world_generator/continents/test_continent.gd b/game/world_generator/continents/test_continent.gd index d3dbc82d..8003727f 100644 --- a/game/world_generator/continents/test_continent.gd +++ b/game/world_generator/continents/test_continent.gd @@ -173,6 +173,7 @@ func spawn_dungeon(chunk: TerraChunk, dungeon_seed : int, spawn_mobs : bool) -> func setup_property_inspector(inspector) -> void: .setup_property_inspector(inspector) + inspector.add_h_separator() inspector.add_slot_resource("get_dungeon_teleporter", "set_dungeon_teleporter", "Dungeon Teleporter", "PackedScene") inspector.add_slot_resource("get_prop_tree", "set_prop_tree", "Prop Tree", "PropData") inspector.add_slot_resource("get_prop_tree2", "set_prop_tree2", "Prop Tree2", "PropData") diff --git a/game/world_generator/subzones/spawner.gd b/game/world_generator/subzones/spawner.gd index 6912bb63..161dac45 100644 --- a/game/world_generator/subzones/spawner.gd +++ b/game/world_generator/subzones/spawner.gd @@ -62,5 +62,6 @@ func get_editor_additional_text() -> String: func setup_property_inspector(inspector) -> void: .setup_property_inspector(inspector) + inspector.add_h_separator() inspector.add_slot_resource("get_trainer", "set_trainer", "Trainer", "EntityData") inspector.add_slot_resource("get_vendor", "set_vendor", "Vendor", "EntityData")