diff --git a/src/Autoload/Global.gd b/src/Autoload/Global.gd index 41c43c39a..e5e34940e 100644 --- a/src/Autoload/Global.gd +++ b/src/Autoload/Global.gd @@ -840,7 +840,9 @@ func _renderer_changed(value: int) -> void: ## Use this to prepare Pixelorama before opening a dialog. -func dialog_open(open: bool) -> void: +func dialog_open(open: bool, is_file_dialog := false) -> void: + if is_file_dialog and use_native_file_dialogs: + return var dim_color := Color.WHITE if open: if dim_on_popup: diff --git a/src/Main.gd b/src/Main.gd index a7520e5e8..b83cfb1e8 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -284,7 +284,7 @@ func _on_OpenSprite_files_selected(paths: PackedStringArray) -> void: func show_save_dialog(project := Global.current_project) -> void: - Global.dialog_open(true) + Global.dialog_open(true, true) if OS.get_name() == "Web": var save_filename := save_sprite_html5.get_node("%FileNameLineEdit") save_sprite_html5.popup_centered() diff --git a/src/Tools/3DTools/3DShapeEdit.gd b/src/Tools/3DTools/3DShapeEdit.gd index 92adf7ab4..a45678aa6 100644 --- a/src/Tools/3DTools/3DShapeEdit.gd +++ b/src/Tools/3DTools/3DShapeEdit.gd @@ -241,7 +241,7 @@ func _cel_switched() -> void: func _new_object_popup_id_pressed(id: int) -> void: if id == Cel3DObject.Type.IMPORTED: load_model_dialog.popup_centered() - Global.dialog_open(true) + Global.dialog_open(true, true) else: _add_object(id) @@ -488,4 +488,4 @@ func _on_LoadModelDialog_files_selected(paths: PackedStringArray) -> void: func _on_load_model_dialog_visibility_changed() -> void: - Global.dialog_open(false) + Global.dialog_open(false, true) diff --git a/src/UI/TopMenuContainer/TopMenuContainer.gd b/src/UI/TopMenuContainer/TopMenuContainer.gd index 35cb217fd..7fceb2f03 100644 --- a/src/UI/TopMenuContainer/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer/TopMenuContainer.gd @@ -376,13 +376,14 @@ func _handle_metadata(id: int, popup_menu: PopupMenu) -> void: func _popup_dialog(dialog: Window, dialog_size := Vector2i.ZERO) -> void: dialog.popup_centered(dialog_size) - Global.dialog_open(true) + var is_file_dialog := dialog is FileDialog + Global.dialog_open(true, is_file_dialog) func file_menu_id_pressed(id: int) -> void: match id: Global.FileMenu.NEW: - _on_new_project_file_menu_option_pressed() + _popup_dialog(new_image_dialog) Global.FileMenu.OPEN: _open_project_file() Global.FileMenu.OPEN_LAST_PROJECT: @@ -401,11 +402,6 @@ func file_menu_id_pressed(id: int) -> void: _handle_metadata(id, file_menu) -func _on_new_project_file_menu_option_pressed() -> void: - new_image_dialog.popup_centered() - Global.dialog_open(true) - - func _open_project_file() -> void: if OS.get_name() == "Web": Html5FileExchange.load_image()