miggor-StreamGraph/graph_node_renderer/settings_dialog.gd
Lera Elvoé a56280f00a add settings dialog (#144)
Reviewed-on: https://codeberg.org/StreamGraph/StreamGraph/pulls/144
Co-authored-by: Lera Elvoé <yagich@poto.cafe>
Co-committed-by: Lera Elvoé <yagich@poto.cafe>
2024-04-11 15:32:13 +00:00

25 lines
773 B
GDScript

# (c) 2023-present Eroax
# (c) 2023-present Yagich
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
extends AcceptDialog
class_name SettingsDialog
@onready var category_tree: Tree = %CategoryTree
@onready var category_content: Control = %CategoryContent
@onready var shortcuts_tree: Tree = %Shortcuts
func _ready() -> void:
var cr := category_tree.create_item()
for i in category_content.get_children():
var item := category_tree.create_item(cr)
item.set_text(0, i.name)
category_tree.item_selected.connect(
func():
var item := category_tree.get_selected()
for i: Control in category_content.get_children():
i.visible = i.get_index() == item.get_index()
)
category_tree.set_selected(cr.get_child(0), 0)