-
Notifications
You must be signed in to change notification settings - Fork 154
Use standard data directories #1913
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
base: master
Are you sure you want to change the base?
Conversation
Instead of just using them, it should instead transfer them over to the new directory, so that we can remove them in the next release |
Reasonable. I'll do that tomorrow. |
Do you have any official source that states that it should be in %appdata% on windows? From what I've seen there are at least 4 different conventions on windows, so I took the one that seemed most reasonable. |
Also that's a lot of lines compared to before. |
All apps store data somewhere in
So from my understanding, Roaming is the important data you want to have synced between devices, which game saves imo are. Though there's also an option of %localappdata%. I'm working on cleaning up that code a bit. But I'll still be longer than the original because of backwards compatibility checks. Without them, it's only ~19 additional lines. |
I believe it refers not to the location itself, but to some function on Windows that synced the folder. It links to a page that says
I might be a dummy and the second link might be referring to a completely different Roaming and is not related to the folders at all. But I'm open to changing it to |
Honestly none of the links are very convincing. |
I couldn't find any documentation for them. I remember seeing a stack overflow answer that explained them, but I won't be able to find it. I can only say that pretty much all apps and games store their data on either Roaming, Local or LocalLow, I honestly don't have a preference for any of them, as long as it's not directly in %USERPROFILE% or Documents. |
Should I also add MacOS storage locations? It has its own standard, if the game is going to be ported to MacOS, it would be nice to comply with them. Respective docs: https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html |
how about u just put a Saves folder in the root directory of the game instead :mood: |
That makes updating the game difficult for the player. And it also makes it harder to share settings and worlds between different versions (which is really useful in development). |
The implementation of «move» part is not ideal, but since it's temporary and a one-time operation, it shouldn't matter
Changes:
Tested in Wine and on Arch Linux. When the moving of old data is no longer needed, |
Closes #1909
Use the following directories for data storage:
%APPDATA%/Cubyz
on Windows (~/AppData/Roaming/Cubyz
)$XDG_DATA_HOME/Cubyz
on Linux (~/.local/share/cubyz
)~/Library/Application Support/Cubyz
on MacOSIf old directories are found (
~/Saved Games/Cubyz
or~/.cubyz
) - move them to the new location.On Linux it also does some additional checks for XDG_DATA_HOME, because it might or might not exist, usual Linux things.
Tested this on Arch Linux and Wine.