28 lines
729 B
GDScript3
28 lines
729 B
GDScript3
|
extends VBoxContainer
|
||
|
class_name OverrideEditorSettingsMenu
|
||
|
|
||
|
const ITEM_SCENE := preload("res://UI/Components/OverrideEditorSettingsMenu/OverrideEditorSettingsMenuItem.tscn")
|
||
|
|
||
|
@onready var override_item_container: VBoxContainer = %OverrideItemContainer
|
||
|
@onready var new_override_button: Button = %NewOverrideButton
|
||
|
|
||
|
|
||
|
func _ready() -> void:
|
||
|
new_override_button.pressed.connect(
|
||
|
add_item.bind(ITEM_SCENE.instantiate())
|
||
|
)
|
||
|
|
||
|
|
||
|
func add_item(item: OverrideEditorSettingsMenuItem) -> void:
|
||
|
override_item_container.add_child(item)
|
||
|
|
||
|
|
||
|
func get_overrides() -> Dictionary:
|
||
|
var res := {}
|
||
|
|
||
|
for item in override_item_container.get_children():
|
||
|
item = item as OverrideEditorSettingsMenuItem
|
||
|
res.merge(item.get_property())
|
||
|
|
||
|
return res
|