Page 1 of 1

Conditional Compilation

Posted: 28 Jun 2010 18:24
by kalyx
Implement a simple "conditional compilation" system for the skins that is configurable by the user from a config file. Say there is a skin called ASkin.vlt. It would have a config file called ASkin.cfg whose structure would be a list of parameter assignments, like this:

Code: Select all

volume = false sliders = false font = xyz
In the vlt file, there would be a section near the top like this:

Code: Select all

<Config> <Param id="font" default="default" description="Font"/> <Param id="volume" default="true" description="If true, show volume control, else don't"/> <Param id="sliders" default="true" description="If true, show sliders, else show buttons for volume/> </Config>
Then, later in the vlt file:

Code: Select all

<If param="font" value="default"> <Font id="default" .../> </If> <If param="font" value="xyz"> <Font id="xyz" .../> </If> <If param="volume" value="true"> <If param="sliders" value="true"> <Slider .../> </If> <If param="sliders" value="false"> <Button id="volumeUp" .../> <Button id="volumeDown" .../> </If> </If>