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

Allow replacing all instances of a texture with one texture #3234

Merged
merged 1 commit into from
Dec 2, 2023

Conversation

LuminarLight
Copy link
Contributor

There are art groups that are present in multiple levels, and that means that also their textures are present in multiple levels. With texture replacement, currently we need to make replacements for all instances if we want it replaced everywhere, but this is not ideal, especially when you make changes to your replacement texture and now you have to put it in each folder again.

I added a way to replace all instances of a texture, by letting texture-replacer people put their replacements into an '_all' folder. I set up the logic in such a way that if you have a replacement for the texture in its corresponding folder, it will take priority over a replacement that you placed into the '_all' folder.

I personally found this very useful for replacing guard textures. The guards appear in a lot of levels. But ideally you want them to look the same everywhere. And that is why I looked into this and made a PR.

Oh and I changed what is printed in the 'Replacing ' part because it was printing the path to our replacement, which didn't look nicely when several textures got replaced by the same replacement from the '_all' folder. So now it will print the original texture's page and name, I think this information is more useful anyway.

@OpenGOALBot
Copy link
Collaborator

Can one of the admins verify this patch?

@Zedb0T
Copy link
Contributor

Zedb0T commented Nov 30, 2023

Is there anyway you can add a key into the config json for this. Unsure if people think its best to enable or disable this by default.

There are some packs that currently depend on this double swap mechanic to work, this seems like a nice feature but I dont see why we couldn't support both options

image
image
image

@LuminarLight
Copy link
Contributor Author

As I explained in my initial comment, if you put your replacements into the level-specific folder (like in the old system), it will take priority over any replacements that are in the '_all' folder. And every texture pack that was made before this change will still behave the same way. The only change is that now you can also put stuff into an '_all' folder if you want.

@Zedb0T
Copy link
Contributor

Zedb0T commented Nov 30, 2023

Ah yes, just got off work and forgot how to read, I even peaked the code changes and it didnt connect with me... I should take a nap

Copy link
Collaborator

@water111 water111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a good idea

@water111 water111 merged commit a3af379 into open-goal:master Dec 2, 2023
8 checks passed
@LuminarLight LuminarLight deleted the texreplac-multiinstance branch December 2, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants