LeftMouseDownAction swaps variables normally. (Works)
Both actions do the same thing. They swap PositionA and PositionB variables. When the variables are swapped normally, (#PositionA# with #PositionB#) everything works normally. When the variables are swapped nested ([#Position[#SlotName1]] with [#Position[#SlotName2]]) it doesn't work. The first variable swaps fine, but since the second variable refers to the first variable, and since nested variables adjust dynamically for each bang, RightMouseDownAction causes both numbers to match rather than swap.
So regularly, A=B and B=A (A-B)
But nested, we get A=B and B=B (B-B)
How do you swap nested variables?
Code: Select all
[Rainmeter]
MiddleMouseUpAction=[!Refresh]
[Variables]
SlotName1=A
SlotName2=B
PositionA=1
PositionB=2
[Meter]
Meter=String
StringAlign=CenterCenter
SolidColor=255,55,55
FontSize=25
Text=#PositionA# - #PositionB#
X=100
Y=100
W=200
H=200
RightMouseUpAction=[!SetVariable PositionA [#Position[#SlotName2]]][!SetVariable PositionB [#Position[#SlotName1]]][!Update]
LeftMouseUpAction=[!SetVariable PositionA #PositionB#][!SetVariable PositionB #PositionA#][!Update]
DynamicVariables=1