Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrected "Save Scene" and "Save All Scenes" function when dir renamed #52573

Merged
merged 1 commit into from
Sep 29, 2021

Conversation

e8newallm
Copy link
Contributor

@e8newallm e8newallm commented Sep 11, 2021

fix #52078

This problem seems to occur as the code checks whether the filename is defined but doesn't check if that filename/location actually exists. The problem can also be seen if you rename the directory outside of the editor for all scenes saved in that folder, regardless of if they have already been saved or not.

For "Save Scene", I added a DirAccess::exists check to see if the directory exists before attempting to save, and if it doesn't, prompting the user with an alert box. If the user clicks the ok on the alert, it triggers off a "Save Scene As" prompt.

image

For "Save All Scenes" this was not a viable solution to add, so I did the same DirAccess::exists check, and if any of the scenes failed it, prompted the user with a warning popup to say at least one scene was not able to be saved.

image

@Calinou Calinou added bug topic:editor cherrypick:3.3 cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Sep 11, 2021
@Calinou Calinou added this to the 4.0 milestone Sep 11, 2021
@fire
Copy link
Member

fire commented Sep 24, 2021

I have a complicated pr for moving directories to arbitrary locations that is distantly related to this pr. Not sure if you were interested in salvaging it.

fire#2

@e8newallm
Copy link
Contributor Author

I can take a look at it later today if you want.

@akien-mga akien-mga merged commit 4fc246e into godotengine:master Sep 29, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Sep 29, 2021
@e8newallm e8newallm deleted the Save_Scene-52078 branch November 2, 2021 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to save not-yet-saved scene after renaming folder
4 participants