2016-02-22, 16:59
(2016-02-22, 16:08)marcelveldt Wrote: Use the existing "skinsettings" approach to also set constants ?
And whatever is selected will be written to the includes file ?
In a way, yes.
Let's say :
Main include :
PHP Code:
<includes>
<include file="script-skin_helper_service-Constants.xml" />
</includes>
script-skin_helper_service-Constants.xml (written by skinner to define names and first start values)
PHP Code:
<includes>
<constant name="HOM.View1.B1CoordX">0</constant>
<constant name="HOM.View1.B1CoordY">0</constant>
<constant name="HOM.View1.B1SizeX">636</constant>
<constant name="HOM.View1.B1SizeY">356</constant>
...
</includes>
Script call :
Set for user keyboard entry (optional range if value < 0 set 0 ; > 1080, set 1080)
PHP Code:
<onclick>RunScript(script.skin.helper.service,action=setconstant,constant=HOM.View1.B1CoordX,value=prompt,range=0|1080,header=$LOCALIZE[31235])</onclick>
Set by code (optional frozen value 642, silent mode)
PHP Code:
<onclick>RunScript(script.skin.helper.service,action=setconstant,constant=HOM.View1.B1CoordX,value=642)</onclick>
Then overrides the corresponding constant value for the matching name.
A sliderex would also be awesome, but icing on the cake
One great thing with skinsettings is the file is stored in extras folder, I really enjoy having those scripted ones out of the main skin folder but AFAIK, it's not possible to include a file from outside this main. Also, would be interresting having more than one script-skin_helper_service-Constants.xml file (to separate settings sets) but seems hard to implement even by numbering the files.
It's a quick though but what do you think ?