toggle native dialog with embed subwindows option

This commit is contained in:
Lera Elvoé 2023-12-15 02:45:16 +03:00
parent 6bc9ad625d
commit 9699381f5c
No known key found for this signature in database
2 changed files with 6 additions and 3 deletions

View file

@ -73,12 +73,14 @@ func _ready() -> void:
tab_container.add_button_pressed.connect(add_empty_deck) tab_container.add_button_pressed.connect(add_empty_deck)
RendererPersistence.init_namespace(PERSISTENCE_NAMESPACE) 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( debug_popup_menu.set_item_checked(
DebugMenuId.EMBED_SUBWINDOWS, 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( recent_files = RendererPersistence.get_or_create(
PERSISTENCE_NAMESPACE, "config", PERSISTENCE_NAMESPACE, "config",
@ -318,6 +320,7 @@ func _on_debug_id_pressed(id: int) -> void:
debug_popup_menu.set_item_checked(id, !c) debug_popup_menu.set_item_checked(id, !c)
get_tree().get_root().gui_embed_subwindows = !c get_tree().get_root().gui_embed_subwindows = !c
RendererPersistence.set_value(PERSISTENCE_NAMESPACE, "config", "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: func _on_debug_decks_viewer_item_pressed(deck_id: String, instance_id: String) -> void:

View file

@ -160,7 +160,7 @@ layout_mode = 2
size = Vector2i(776, 447) size = Vector2i(776, 447)
mode_overrides_title = false mode_overrides_title = false
access = 2 access = 2
filters = PackedStringArray("*.deck ;StreamGraph Decks") filters = PackedStringArray("*.deck;StreamGraph Decks")
use_native_dialog = true use_native_dialog = true
[node name="Connections" type="Node" parent="."] [node name="Connections" type="Node" parent="."]