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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session saving #78

Merged
merged 1 commit into from
Oct 27, 2021
Merged

Session saving #78

merged 1 commit into from
Oct 27, 2021

Conversation

Yagich
Copy link
Contributor

@Yagich Yagich commented Oct 24, 2021

closes #67
Hey! A while ago I made the above issue. I just got some free time and figured I'd get it done.
There is a quirk that I'm not sure is worth handling, so I didn't - when the session file gets created for the first time, and you close Lorien without any changes to the default project, it will save the session as "" in the file. This doesn't affect anything, and everything opens just fine, but I thought I'd mention in. Otherwise I think it's ready for review!

And once again, thanks for making Lorien! I'm using it almost daily now. 馃槃

@mbrlabs
Copy link
Owner

mbrlabs commented Oct 25, 2021

Thanks! I hope i have time this evening to check it out ;)

@mbrlabs
Copy link
Owner

mbrlabs commented Oct 27, 2021

Looking good. We should probably encapsulate this functionality in a SessionManager singleton similar to the ProjectManager. It's probably also a good idea to add a project setting to disable session loading/saving. But this can be done later. Merging this for now.

Thanks!

@mbrlabs mbrlabs merged commit a15a06e into mbrlabs:main Oct 27, 2021
@mbrlabs
Copy link
Owner

mbrlabs commented Oct 27, 2021

Now that i think about it...it's probably better not to have a SessionManager but rather add this functionality to the ProjectManager

@Yagich
Copy link
Contributor Author

Yagich commented Oct 27, 2021

Now that i think about it...it's probably better not to have a SessionManager but rather add this functionality to the ProjectManager

I did think about doing that in the first place, but the reason I did it the way I did is because I've only ever seen Main.gd actually handle opening a project (_on_open_project() function). If I understand the way it works now correctly, would moving the functionality over to ProjectManager not require some back-and-forth between it and Main?

@mbrlabs
Copy link
Owner

mbrlabs commented Oct 27, 2021

Yeah, some things need to stay in Main, but things like saving and loading sessions (array of previoulsy opened files) can go into the project manager. It's cleaner when Main.gd doesn't have to manage the session file on disk directly. In Main.gd you then just call these functions from the ProjectManager

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.

Remember last session/canvas
2 participants