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)
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: