From 9699381f5c923f002a29ed149003bd7d47337ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Fri, 15 Dec 2023 02:45:16 +0300 Subject: [PATCH] toggle native dialog with embed subwindows option --- graph_node_renderer/deck_holder_renderer.gd | 7 +++++-- graph_node_renderer/deck_holder_renderer.tscn | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/graph_node_renderer/deck_holder_renderer.gd b/graph_node_renderer/deck_holder_renderer.gd index 3dc9f1e..742bef4 100644 --- a/graph_node_renderer/deck_holder_renderer.gd +++ b/graph_node_renderer/deck_holder_renderer.gd @@ -73,12 +73,14 @@ func _ready() -> void: tab_container.add_button_pressed.connect(add_empty_deck) RendererPersistence.init_namespace(PERSISTENCE_NAMESPACE) + var embed_subwindows: bool = RendererPersistence.get_or_create(PERSISTENCE_NAMESPACE, "config", "embed_subwindows", true) debug_popup_menu.set_item_checked( DebugMenuId.EMBED_SUBWINDOWS, - RendererPersistence.get_or_create(PERSISTENCE_NAMESPACE, "config", "embed_subwindows", true) + embed_subwindows ) - get_tree().get_root().gui_embed_subwindows = RendererPersistence.get_value(PERSISTENCE_NAMESPACE, "config", "embed_subwindows") + get_tree().get_root().gui_embed_subwindows = embed_subwindows + file_dialog.use_native_dialog = !embed_subwindows recent_files = RendererPersistence.get_or_create( PERSISTENCE_NAMESPACE, "config", @@ -318,6 +320,7 @@ func _on_debug_id_pressed(id: int) -> void: debug_popup_menu.set_item_checked(id, !c) get_tree().get_root().gui_embed_subwindows = !c RendererPersistence.set_value(PERSISTENCE_NAMESPACE, "config", "embed_subwindows", !c) + file_dialog.use_native_dialog = c func _on_debug_decks_viewer_item_pressed(deck_id: String, instance_id: String) -> void: diff --git a/graph_node_renderer/deck_holder_renderer.tscn b/graph_node_renderer/deck_holder_renderer.tscn index 743a163..dd7757d 100644 --- a/graph_node_renderer/deck_holder_renderer.tscn +++ b/graph_node_renderer/deck_holder_renderer.tscn @@ -160,7 +160,7 @@ layout_mode = 2 size = Vector2i(776, 447) mode_overrides_title = false access = 2 -filters = PackedStringArray("*.deck ;StreamGraph Decks") +filters = PackedStringArray("*.deck;StreamGraph Decks") use_native_dialog = true [node name="Connections" type="Node" parent="."]