-
Notifications
You must be signed in to change notification settings - Fork 759
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
Check for diablo.ini in PWD, if found use that and save files into ./ for portable mode. #1736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally against this idea. It all sounds like a big hack to me. IMHO, we are already doing the correct thing to do and shouldn't make any changes to it.
We already check for the mpqs in multiple places. Why can’t we do that for the ini and saves so that it can be setup to run out of a single contained folder without having to use to shortcuts or scripts. |
I knew looking for multiple files in multiple folder would be a slippery slope :D The reason not to do things like that is that it's actually caused an issue with how the game loads assets directly from disk (as opposed to an MPQ). It makes things more complicated and complicated things have bugs. So that has to be weighted with the benefit to the user. But quite a lot of Windows users are surprised when they dump a new exe in their existing diablo folder and it doesn't load files from the same location, so there are some reasonable benefits to attempting to figure out the users intent. |
d988747
to
16ee90f
Compare
Great work @Trihedraf! I've been saying this should have been a thing for a long time now. It's especially useful as now you can have DevilutionX on a flash drive and play it at school or another persons computer where you may not have access/permission to get into the hidden user directory. |
You could already do that just with a shortcut instead of an ini, this just makes it detect if it's in an original installation with write access. |
More streamlined and easier now though ;) |
It's as you say @AJenbo, it's quite annoying to have those files in different places. This makes it much easier to run have multiple versions of the exe in the same folder. |
0efc993
to
4cf7964
Compare
Nice, this is now clean enough that it's not an issue to include, compared to the benifit. |
@AJenbo is there something that we are waiting for on this one? |
Not much, I just need time to test it :) There has been a lot to see to as of late, so haven't had as much time to review and merge PRs as I would have liked, but will probably get to this one this week. |
@AJenbo Done |
2f34e74
to
1989f43
Compare
9e006df
to
0b4d01f
Compare
How about checking $PWD\SAVE\diablo.ini first and then checking $PWD\diablo.ini next? I disliked multiple save files scattered in game directory itself as original Diablo did. Please use separate subdirectory of $PWD for diablo.ini and save files and keep the game install directory clean and tidy. I suggest to check |
I originally had it put all the saves in a ./save folder, but @AJenbo said to take it out. |
Hopefully this won't cause to many issues for players that extracted DevilutionX to there original diablo folder but have there save games in the current pref path. |
prefPath = FromSDL(SDL_GetPrefPath("diasurgical", "devilution")); | ||
if (FileExistsAndIsWriteable("diablo.ini")) { | ||
prefPath = "./"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this doesn't work on GCC 5.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sent PR to fix #1984
No description provided.