It is currently May 2nd, 2024, 9:12 pm

[Suggestion] Adjust skin positions on work area change

Report bugs with the Rainmeter application and suggest features.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Suggestion] Adjust skin positions on work area change

Post by smurfier »

Code: Select all

[Variables]
WidthOnLastUpdate=#WORKAREAWIDTH#

[MeasureWorkAreaWidth]
Measure=CALC
DynamicVariables=1
Formula=(#WORKAREAWIDTH#<>#WidthOnLastUpdate#)
IfEqualValue=0
IfEqualAction=!SetVariable WidthOnLastUpdate #WORKAREAWIDTH#
IfAboveValue=0
IfAboveAction=!Execute [!Move (#WidthOnLastUpdate#-500) #CURRENTCONFIGY#][!SetVariable WidthOnLastUpdate #WORKAREAWIDTH#]
DynamicVariables=1
Gotta make sure that you're using DynamicVariables wherever you are using a variable that changes value. In this case WidthOnLastUpdate, CurrentConfigY, and probably WorkAreaWidth.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
User avatar
JamesAC
Developer
Posts: 318
Joined: July 14th, 2009, 5:57 pm

Re: [Suggestion] Adjust skin positions on work area change

Post by JamesAC »

The move command is not relative to the previous location. The skin is moved to the location set in the bang, so if the width is only 400, then it is trying to move the skin to an x-position of -100, which is off the left hand edge of your screen.
+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
Quis custodiet ipsos custodes?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Suggestion] Adjust skin positions on work area change

Post by smurfier »

Actually, I just remembered that when I last used the Move bang, I found that I could not use formulas within the bang itself.

Code: Select all

[Variables]
WidthOnLastUpdate=#WORKAREAWIDTH#

[WorkAreaMove]
Measure=Calc
Formula=#WidthOnLastUpdate#-500
DynamicVariables=1

[MeasureWorkAreaWidth]
Measure=CALC
DynamicVariables=1
Formula=(#WORKAREAWIDTH#<>#WidthOnLastUpdate#)
IfEqualValue=0
IfEqualAction=!SetVariable WidthOnLastUpdate #WORKAREAWIDTH#
IfAboveValue=0
IfAboveAction=!Execute [!Move [WorkAreaMove] #CURRENTCONFIGY#][!SetVariable WidthOnLastUpdate #WORKAREAWIDTH#]
DynamicVariables=1
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
dragonmage
Developer
Posts: 1270
Joined: April 3rd, 2009, 4:31 am
Location: NC, US

Re: [Suggestion] Adjust skin positions on work area change

Post by dragonmage »

Did you try

Formula=(#WidthOnLastUpdate#-500)
?

I make a habit of always using () even if I don't think they are required.
scavenger
Posts: 16
Joined: July 5th, 2011, 8:23 pm

Re: [Suggestion] Adjust skin positions on work area change

Post by scavenger »

Thx smurfier! Now it works. Is this a bug? Would be nice to be able to use some arithmetics in Bang-commands...
My config now looks like this:

Code: Select all

[Variables]
WidthOnLastUpdate=#WORKAREAWIDTH#
...

[WorkAreaMove]
Measure=Calc
Formula=#WORKAREAWIDTH#-400
DynamicVariables=1

[MeasureWorkAreaWidth]
Measure=CALC
DynamicVariables=1
Formula=(#WORKAREAWIDTH#<>#WidthOnLastUpdate#)
IfEqualValue=1
IfEqualAction=!Execute [!SetVariable WidthOnLastUpdate #WORKAREAWIDTH#][!Move [WorkAreaMove] #CURRENTCONFIGY#]
@dragonmage: no, you dont need parentheses there.
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: [Suggestion] Adjust skin positions on work area change

Post by smurfier »

You can indeed use formulas in most Bangs, the only one I can recall that does not allow them in the Move bang.
GitHub | DeviantArt | Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .