FunkPanion/scripts/config/config_events.gd

27 lines
633 B
GDScript

extends Button
signal change_config(config:Dictionary)
var config_events = preload("res://scenes/config_events.tscn")
@onready var root = get_tree().root
@onready var form = $"../.."
func _pressed() -> void:
var preset_window = Popup.new()
var cfev = config_events.instantiate()
preset_window.add_child(cfev)
root.add_child(preset_window)
preset_window.popup_centered_ratio()
var close = func():
preset_window.hide()
root.remove_child(preset_window)
preset_window.queue_free()
cfev.queue_free()
cfev.close.connect(close)
cfev.change_config.connect(func(config):
close.call()
change_config.emit(config)
)