So I've created this little testing skin:
The idea is a little radio button that enables and disables by clicking it. The conditional function is used on certain options, clicking the button will set a ButtonState variable from 0 to 1 and the button will enable, when it enables the button changes color and the text changes from disabled to enabled as well as its colors. This is pretty nice because it saves from having a measure and multiple set option bangs.
The only problem I've noticed so far is on the Shape's Fill option. On first load and on refresh, it will log Invalid shape modifier: 0 (ConditionalExample\Example.ini - [Button])
Any idea to solve this would be appreciated.
This happens with any of the conditional functions. While the example is using the first conditional function, the script.lua file contains all three functions for testing. Just remember each of them requires a somewhat different syntax on the condition.
One solution I've found is creating a new variable and use the escaped function on that variable. That way the Fill option on the shape can stay as
Fill=Fill Color [#ButtonColor] and the ButtonColor Variable as: ButtonColor=[&*C:con(([#*ButtonState*]=0),'[#*ButtonDisabledColor*]','[#*ButtonEnabledColor*]')*]
Like this:
And no error will be logged.
Here's a second example skin using the functions only on variables:
Any other idea to fix the first problem is still welcome though.
The idea is a little radio button that enables and disables by clicking it. The conditional function is used on certain options, clicking the button will set a ButtonState variable from 0 to 1 and the button will enable, when it enables the button changes color and the text changes from disabled to enabled as well as its colors. This is pretty nice because it saves from having a measure and multiple set option bangs.
The only problem I've noticed so far is on the Shape's Fill option. On first load and on refresh, it will log Invalid shape modifier: 0 (ConditionalExample\Example.ini - [Button])
Any idea to solve this would be appreciated.
This happens with any of the conditional functions. While the example is using the first conditional function, the script.lua file contains all three functions for testing. Just remember each of them requires a somewhat different syntax on the condition.
One solution I've found is creating a new variable and use the escaped function on that variable. That way the Fill option on the shape can stay as
Fill=Fill Color [#ButtonColor] and the ButtonColor Variable as: ButtonColor=[&*C:con(([#*ButtonState*]=0),'[#*ButtonDisabledColor*]','[#*ButtonEnabledColor*]')*]
Like this:
Code:
[Variables]...ButtonColor=[&*C:con(([#*ButtonState*]=0),'[#*ButtonDisabledColor*]','[#*ButtonEnabledColor*]')*]...[Button]......Fill=Fill Color [#ButtonColor]...
Here's a second example skin using the functions only on variables:
Any other idea to fix the first problem is still welcome though.
Statistics: Posted by RicardoTM — Yesterday, 11:58 pm