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

Add the ability to load tilesets from user_dir/gfx #35091

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

shacknetisp
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Add the ability to load tilesets from user_dir/gfx"

Purpose of change

Currently tilesets must be placed within the data directory to be found. This is inconvenient, such as in the case where the game is being compiled and run from a git repository clone. It would be easier to have another directory to load from that is independent from the source and data.

Describe the solution

This PR adds functionality to load tilesets from gfx/ in the user directory. It adds a new filename to refer to the user directory's gfx/ directory: user_gfx.

Describe alternatives you've considered

I am unaware of any alternative solution.

Testing

I loaded the game with tilesets in gfxdir and user_gfx and confirmed that they appeared in the options menu and could be switched between.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA SDL: Tiles / Sound Tiles visual interface and sounds. labels Oct 27, 2019
@esotericist esotericist self-assigned this Oct 28, 2019
@esotericist esotericist merged commit 85ea5e3 into CleverRaven:master Oct 28, 2019
@esotericist
Copy link
Contributor

Thanks for handling this. I've wanted it for a while, but it just never bubbled up to the top of my priority list.

@esotericist
Copy link
Contributor

esotericist commented Oct 28, 2019

@shacknetisp For a bonus follow-up, it might be worthwhile to see if you can track down why e.g. the sound folder gets automatically created, but the gfx folder does not. At least, it didn't get created in .cataclysm-dda/ for me on linux; it loaded from that folder just fine though.

Obviously that wasn't a blocker, but it'd be helpful for new users to not have to create it (if only to have less uncertainty).

@Night-Pryanik
Copy link
Contributor

How am to I use this? Where is this user_dir located? I'm on Windows 10.

@esotericist
Copy link
Contributor

How am to I use this? Where is this user_dir located? I'm on Windows 10.

Should be the same place save files go by default.

%LOCALAPPDATA%/cataclysm-dda/ I think?

@Night-Pryanik
Copy link
Contributor

Save games go to gamedir\save by default.

%LOCALAPPDATA%/cataclysm-dda/ = \Users\username\AppData\Local\ in my case and it isn't auto-created on first game start. And when I create this dir, and create a gfx dir inside it, and put a tileset in there, game doesn't recognize the tileset.

@esotericist
Copy link
Contributor

To be clear, by "default", I mean when the "use user folder" flag (however that's spelled, on phone atm) is specified at compile the, which last I checked is how our automated builds are made. If you're doing your own builds, you have to enable that at compile time

@Night-Pryanik
Copy link
Contributor

"User folder" isn't created on pre-compiled version either.

@AMurkin
Copy link
Contributor

AMurkin commented Oct 29, 2019

Only when built with USE_HOME_DIR=1.

@esotericist
Copy link
Contributor

Only when built with USE_HOME_DIR=1.

And the automated windows builds don't have this? I know the mac builds do, and thought the linux builds do as well.

If the precompiled windows builds lack that parameter, then no, this feature isn't going to do anything for most windows users. :(

@Night-Pryanik
Copy link
Contributor

That's a shame. I could really use this feature.

@esotericist
Copy link
Contributor

That's a shame. I could really use this feature.

If you compile it yourself (with USE_HOME_DIR=1), you can have that feature.

@Night-Pryanik
Copy link
Contributor

Night-Pryanik commented Oct 29, 2019

Can anyone help me on how to add compile parameters on MSVS 2017?

@Night-Pryanik
Copy link
Contributor

Ok, I managed to get it compiled.

@esotericist
Copy link
Contributor

So an update on this: apparently if you invoke the precompiled binary with
--userdir "" this is enough to get it to use the appdata tree (apparently passing "" causes it to fall back to the default home directory, which on windows is %LOCALAPPDATA%)

So it's not actually necessary to recompile for this functionality, you just need an additional parameter in your invocation of the game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Quality of Life QoL: degree to which players are comfortable, and able to enjoy CDDA SDL: Tiles / Sound Tiles visual interface and sounds.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants