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

Timeline Saving Fixes (Again) #1255

Merged
merged 5 commits into from
Oct 21, 2022

Conversation

ii4y-studios
Copy link
Collaborator

Timelines started blanking out again, so this is to fix that issue. Also found a few other issues with saving as well, as well as loading, so I'll get them fixed in here.

It appears that part of the problem, and the solution in this initial commit, might actually be a Godot bug with the Enum's not acting properly. I'll have to play with it more to try and figure that out. So that fix might be temporary.

@ii4y-studios
Copy link
Collaborator Author

ii4y-studios commented Oct 20, 2022

ok, looks like there's not a Godot bug.

actual timeline blanking was accidentally caused by #1247 with the line added to TimelineResourceSaver.gd. does need to be caught like that for the reason given in that PR, but just opening a file in FileAccess.WRITE will automatically erase everything in the file when its run. so I'll have to do a few more changes to prevent that from happening in a different way, so it also doesn't leave empty files around when making new timelines if not saving them

@ii4y-studios
Copy link
Collaborator Author

Ok, so the reason the #1247 added the line was so new files could be saved on timeline creation, because it skips creating them when starting it because timeline save is called when starting a new timeline too (for some reason idk Godot resources thing). And it was doing that because there was an if statement to make sure the file existed before saving to it.

But that's pretty much left over from an earlier fix for the issue of timeline being erased. With all the other checks in place, there's no reason it should get that far and not want to save to a file, so there's no reason to check if it already exists anymore. So I've redone it to remove that if statement. Instead it adds one final check before opening the file, so if for some reason the actual string itself that's being built with the text timeline, thats supposed to be written to the file, is completely empty, it won't open the file and clear its contents.

Gonna check the other file writing routines to make sure they're all safe too then the PR will be ready

@ii4y-studios ii4y-studios marked this pull request as ready for review October 21, 2022 02:59
@coppolaemilio coppolaemilio merged commit 9c6ecbc into dialogic-godot:main Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants