-
Notifications
You must be signed in to change notification settings - Fork 669
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
Build Preprocessing Hooks #5471
Comments
I'd suggest writing a script that does your preprocessing, and then calls the CLI ( https://www.renpy.org/doc/html/cli.html ) to do the build. |
I probably will end up doing that, though I still think my initial suggestion of having a way people can hook into the build process and alter things would be beneficial, since then the community could make some "plug and play" scripts that can be implemented simply by dropping an rpy file in a folder somewhere. It's a super low priority thing, just thought it would be a nice thing to have. |
Check out https://github.com/kobaltcore/renkit, it adds support for this, among other things. |
I've modified my own launcher to do this for me, but I think it's useful enough that others might want it.
It would be really nice to have some way to pass functions to a the renpy builder that would allow us to modify / do preprocessing on files, etc.
For example the way I'm using it is that I've added some code to the
archiver.Archive
classadd
method, which runs all png files through pngquant (png compressor/optimizer), before adding them to the archive. This lets me produce a game with compressed images, while still letting me keep the uncompressed files pre-build.Granted, this does cause the build to take 4 times as long because each file needs to be compressed, but it's still useful.
I currently just use this for processing files before adding to the game or archive, but I can see some other possible use cases as well.
Maybe something like:
build.preprocess("game/**.png",processPng)
The text was updated successfully, but these errors were encountered: