Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 789

Lua Scripting • Lua for conditional operators with strings as result.

$
0
0
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])

Captura de pantalla 2024-10-18 185722.png

This happens with any of the conditional functions.
Yeah this is something I've been experiencing for the past year. It seems for certain inline Lua replacements (Fill Color style and Container option) the Lua doesn't get parsed at all on initial skin load. This doesn't actually affect the final render as it subsequently parses but does lead to the error message you saw (and for the container it complaining about invalid container).

Another workaround is placing the Fill styling in the Shape option last and exclusively as a conditional that itself prefixes a pipe character to the replacement string. In your example skin you're already placing it last but instead of using Extend Fill you can place the inline Lua replacement conditional directly in the Shape.

Eg: instead of your current Shape code of:

Code:

Shape=Ellipse 0.0,0.0,[[#CurrentSection]:W] | Extend Stroke | Extend StrokeColor | Extend Fill...Fill=[&C:con(([#ButtonState]=0),'Fill Color [#ButtonDisabledColor]','Fill Color [#ButtonEnabledColor]')]
You can do the following instead as an alternative workaround for this issue (notice no pipe is used after `StrokeColor`, instead it's added via the replacement string):

Code:

Shape=Ellipse 0.0,0.0,[[#CurrentSection]:W] | Extend Stroke | Extend StrokeColor [&C:con(([#ButtonState]=0),'| Fill Color [#ButtonDisabledColor]','| Fill Color [#ButtonEnabledColor]')]

Statistics: Posted by Crest — Today, 2:24 am — Replies 10 — Views 475



Viewing all articles
Browse latest Browse all 789

Trending Articles