It would be convenient for level designers to be able to define a "palette" for a level, either via default.avarascript or creating variables with <set /> tags in ALF files, and referencing those variables in fill, frame, and *.c attributes. We handle other string variables in the text, designer, and information attributes using a $ symbol, so something similar could be done here.
<set someVar="rgb(255, 0, 0)" /> <Wall fill="$someVar" />
For text, designer, and information, the expression must have $ as the first character. What would be a nice enhancement for colors specifically is also allowing variables in any parameter's position, like so:
<set someVar="280" /> <Wall fill="hsl($someVar, 100%, 85%)" />
Perhaps this could be handled via simple string replacement in our ParseColor function, but having the logic in LevelLoader.cpp is probably more appropriate.
It would be convenient for level designers to be able to define a "palette" for a level, either via
default.avarascriptor creating variables with<set />tags in ALF files, and referencing those variables infill,frame, and*.cattributes. We handle other string variables in thetext,designer, andinformationattributes using a$symbol, so something similar could be done here.<set someVar="rgb(255, 0, 0)" /> <Wall fill="$someVar" />For
text,designer, andinformation, the expression must have$as the first character. What would be a nice enhancement for colors specifically is also allowing variables in any parameter's position, like so:<set someVar="280" /> <Wall fill="hsl($someVar, 100%, 85%)" />Perhaps this could be handled via simple string replacement in our
ParseColorfunction, but having the logic inLevelLoader.cppis probably more appropriate.