What I'm trying to do is implement a sort of rudimentary conditional compilation system. (With the least amount of effort, cough, cough) I've had requests for a compressed images version of my VN which is fine, but I don't want to have to maintain multiple parallel versions of the source. So I thought, that's simple enough: I'll just implement a flag that determines which image files are defined at runtime. And, of course, add logic to add the appropriate files to archives at build time.
Code: Select all
define COMP_IMAGES = True
. . .
if COMP_IMAGES:
image test = "test.jpg"
else:
image test = "test.webp"
Okay, I think, must be loading order issues and COMP_IMAGES isn't being defined early enough. So, in a separate file, I slap an init python statement before the COMP_IMAGES definition, choosing an insanely low number in order to guarantee it's loaded first:
Code: Select all
init -10000 python:
COMP_IMAGES = True
Code: Select all
$ print(COMP_IMAGES)
if COMP_IMAGES:
image test = "test.jpg"
else:
image test = "test.webp"
I get that init python and init offset force sections of code to run in a particular order, but when, and in what relation to the gui starting up? Seems like it should be real simple, but it's not turning out that way. Am I just overthinking this?