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

Help: Rainmeter Skins • Re: Conditioning in Rainmeter is ambiguous...

$
0
0
After four hours of struggling to implement my first(and only necessary) feature which involves some IF's - i have to admit that i failed.

Tell me please why my simple toggle do not working:

Code:

[Variables]KeyToFront = 0x83Zval = -2[Launcher2]Measure=PluginPlugin=HotKeyHotKey=#KeyToFront#DynamicVariables=1IfCondition=Zval = 2IfTrueAction=[!SetVariable Zval "-2"]IfFalseAction=[!SetVariable Zval "2"]KeyDownAction=[!ZPos #Zval#][!Redraw]
I mean it works sometimes if swap things around, but only for first keypress, and then it stays even if i refresh skin. This is all so confusing and unintuitive for newbies...
As mentioned by balala, your IfCondition continually change the variable from -2 to 2 in a continuous loop.

It appears you want to change the Z-position of the skin using the variable #ZVal#.

If that is correct, then I would suggest moving the IfCondition to a separate Calc measure that is not updated by the skin's update rate.
Set that measure to never update after loading by setting the UpdateDivider on that measure to UpdateDivider=-1.

This example will change the z-position of a 100x100 square meter each time the F12 key is pressed (I don't have a F20 key; 0x83).

Code:

[Variables]; F20 Key? I use F12 (0x7B)KeyToFront = 0x7BZval = -2[Launcher2]Measure=PluginPlugin=HotKeyHotKey=#KeyToFront#KeyDownAction=[!UpdateMeasure Status][Status]Measure=CalcFormula=#Zval#IfCondition=#Zval#=2IfTrueAction=[!SetVariable Zval "-2"][!ZPos "[#Zval]"][!Redraw]IfFalseAction=[!SetVariable Zval "2"][!ZPos "[#Zval]"][!Redraw]UpdateDivider=-1DynamicVariables=1[MeterImage]Meter=ImageImageName=X=0Y=0W=100H=100SolidColor=0,0,0,100
Because I want to use the newly set #ZVal# in the same string of bangs to redraw the skin, I have to use the nested version in the !ZPos bang; [!ZPos "[#ZVal]"].

Statistics: Posted by eclectic-tech — Yesterday, 9:20 pm



Viewing all articles
Browse latest Browse all 1563

Trending Articles