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

savefiles directory not created on program start #5921

Open
mwerle opened this issue Sep 27, 2024 · 3 comments
Open

savefiles directory not created on program start #5921

mwerle opened this issue Sep 27, 2024 · 3 comments

Comments

@mwerle
Copy link
Contributor

mwerle commented Sep 27, 2024

Follow-up issue to #5917 to track an improvement to the fix. The current implementation delays creating the "savefiles" directory until a game is being saved.

Details in the #5919 PR discussion thread, the TL;DR is below:


After the fix, there is still a popup "user://savefiles is not a directory" when attempting to load a game if the "savefiles" directory has not yet been created.

Fix by creating the "savefiles" directory on program startup in Pi::App::OnStartup() or as a task inside StartupScreen:Start() in "Pi.cpp".

@mwerle
Copy link
Contributor Author

mwerle commented Oct 3, 2024

@Web-eWorks

Current Pi.cpp contains some savefiles stuff underneath a big banner-comment :

/*
===============================================================================
	MISCELLANEOUS GARBAGE THAT OUGHT NOT TO BE IN THIS CLASS
===============================================================================
*/

Is this an indication that, ideally, these things should be refactored into a separate place, in which case, this bug appears to be the right time to do this in.

FWIW, most/all of the other directories are created in Application.cpp:Application::Startup().

@Web-eWorks
Copy link
Member

Correct! There are a few things in there that need a much deeper level of refactoring (for example, Pi::FindModel needs to be replaced with a model lookup procedure that uses actual paths rather than depending on the filename of every model in the entire game being globally unique...) but Pi::GetSaveDir() should ideally be elided or moved.

That header is there to denote existing things that need to be improved in one way or another but I don't have any clear idea on what specifically should be done with them - or enough availability to address them at this stage.

@mwerle
Copy link
Contributor Author

mwerle commented Oct 3, 2024

Ok, it's just that you recommended to fix this bug by adding the functionality here, but doing so will add to the tech debt.

I'll have a think about how to rework this. I'd also like to eventually have the savegame system support directories and/or versions for each save.

Thanks for the info.

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

No branches or pull requests

2 participants