Now HSeparators can also be added to the property inspector.

This commit is contained in:
Relintai 2021-12-27 22:25:37 +01:00
parent cae4735ae2
commit ef03b30dfe
3 changed files with 12 additions and 0 deletions

View File

@ -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()

View File

@ -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")

View File

@ -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")