It is currently August 9th, 2020, 8:42 am

ActionTimer multiple Meters

Get help with installing and using Rainmeter.
haexi
Posts: 3
Joined: May 11th, 2017, 11:30 pm

ActionTimer multiple Meters

Post by haexi »

Hi everyone,

I just started to get really into rainmeter again. Today I worked on a dock, now I'm stuck at animations. I want the icons to pop up immediately but slide down with a short delay. How do I get this down, without a Measure=Plugin for every single Meter? I am sure that there is an easier solution and that you will find it right away.

Thanks in advance
haexi

Code: Select all

[Rainmeter]
DynamicWindowSize=1
Update=15000

[Variables]
Icons=9
IconWidth=45
IconGap=10
Margins=5
Width=(#Icons#*(#IconWidth#+#IconGap#))
Height=(#IconWidth#+2*#Margins#)
YUp=#Margins#-5

----------------------------------------------------------------------------------

[Sliders]
Measure=Plugin
Plugin=ActionTimer
ActionList1=SlideUp
SlideUp=[!SetOption Icon2 Y (#YUp#)][!UpdateMeter "Icon2"][!Redraw]
ActionList2=SlideUp | Wait 400 | SlideDown
SlideDown=[!SetOption Icon2 Y (#Margins#)][!UpdateMeter "Icon2"][!Redraw]
DynamicVariables=1

----------------------------------------------------------------------------------

[Icon]
W=#IconWidth#
H=#IconWidth#
X=#Margins#
Y=#Margins#

[Icons]
W=#IconWidth#
H=#IconWidth#
X=(#IconGap#+#IconWidth#)r
Y=#Margins#

----------------------------------------------------------------------------------

[Icon1]
Meter=Image
ImageName=#@#Icons\computer.ico
LeftMouseUpAction=["#@#Shortcuts\computer"]
MeterStyle=Icon
AntiAlias=1
MouseOverAction=[!CommandMeasure Sliders1 "Execute 1"]
MouseLeaveAction=[!CommandMeasure Sliders1 "Stop 1"][!CommandMeasure Sliders1 "Execute 2"]

[Sliders1]
Measure=Plugin
Plugin=ActionTimer
ActionList1=SlideUp
SlideUp=[!SetOption Icon1 Y (#YUp#)][!UpdateMeter "Icon1"][!Redraw]
ActionList2=SlideUp | Wait 200 | SlideDown
SlideDown=[!SetOption Icon1 Y (#Margins#)][!UpdateMeter "Icon1"][!Redraw]
DynamicVariables=1

[Icon2]
Meter=Image
ImageName=#@#Icons\chrome.ico
LeftMouseUpAction=["#@#Shortcuts\chrome"]
MeterStyle=Icons
AntiAlias=1
MouseOverAction=[!CommandMeasure Sliders2 "Execute 1"]
MouseLeaveAction=[!CommandMeasure Sliders2 "Stop 1"][!CommandMeasure Sliders2 "Execute 2"]

[Sliders2]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=SlideUp
SlideUp=[!SetOption Icon2 Y (#YUp#)][!UpdateMeter "Icon2"][!Redraw]
ActionList2=SlideUp | Wait 200 | SlideDown
SlideDown=[!SetOption Icon2 Y (#Margins#)][!UpdateMeter "Icon2"][!Redraw]
DynamicVariables=1
User avatar
jsmorley
Developer
Posts: 21225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ActionTimer multiple Meters

Post by jsmorley »

I am of the opinion that the only good reliable way to get this to work is to have a different "slider" ActionTimer plugin measure for each icon. While you can try to play a shell-game with setting a variable:

Code: Select all

[Slider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=SlideUp
SlideUp=[!SetOption #CurrentIcon# Y (#YUp#)][!UpdateMeter "#CurrentIcon#"][!Redraw]
ActionList2=Wait 200 | SlideDown
SlideDown=[!SetOption #CurrentIcon# Y (#Margins#)][!UpdateMeter "#CurrentIcon#"][!Redraw]
DynamicVariables=1

[Icon1]
Meter=Image
ImageName=#@#Icons\computer.ico
LeftMouseUpAction=["#@#Shortcuts\computer"]
MeterStyle=Icon
AntiAlias=1
MouseOverAction=[!SetVariable CurrentIcon "Icon1"][!UpdateMeasure Slider][!CommandMeasure Slider "Execute 1"]
MouseLeaveAction=[!SetVariable CurrentIcon "Icon1"][!UpdateMeasure Slider][!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Execute 2"]

[Icon2]
Meter=Image
ImageName=#@#Icons\chrome.ico
LeftMouseUpAction=["#@#Shortcuts\chrome"]
MeterStyle=Icons
AntiAlias=1
MouseOverAction=[!SetVariable CurrentIcon "Icon2"][!UpdateMeasure Slider][!CommandMeasure Slider "Execute 1"]
MouseLeaveAction=[!SetVariable CurrentIcon "Icon2"][!UpdateMeasure Slider][!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Execute 2"]
You are going to find it very difficult indeed to get this to work right. If you move your mouse quickly over the two icons, you are going to have conflicting mouse actions that are going to get things confused.

There may be a way to make this reliable that I am not seeing right off, but my recommendation after putzing with it for few minutes is to have separate measures for each icon meter.
haexi
Posts: 3
Joined: May 11th, 2017, 11:30 pm

Re: ActionTimer multiple Meters

Post by haexi »

Thank you for the quick reply! Yeah that was the only concern I had. If you use only one ActionTimer there will be variable conflicts...

Another question occurred to me, what would be the easiest way to make the downward movement smoother? Ideally it would go up directly and descend in multiple steps. I thought about some kind of for-loop but could not get it implemented... Do you have any ideas?

Thanks a bunch!
User avatar
jsmorley
Developer
Posts: 21225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ActionTimer multiple Meters

Post by jsmorley »

That what the ActionTimer plugin is best at...

If you download this .rmskin

https://docs.rainmeter.net/manual-beta/examples/ExamplesActionTimer.rmskin

And load the SlideToolBar.ini skin in it, there is an example that isn't far from what you are doing. Here is the code from it:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
UnCropH=0
SlideH=0
IconY=48
DownPause=1000
W=5
U=[!UpdateMeasureGroup Sliders][!UpdateMeterGroup Sliders][!Redraw]

[MeterSkinBack]
Meter=Image
W=116
H=50
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureSliders "Stop 2"][!CommandMeasure MeasureSliders "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureSliders "Stop 1"][!CommandMeasure MeasureSliders "Execute 2"]

[MeasureSliders]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat SlideUp,#W#,20
SlideUp=[!SetVariable IconY "(Clamp(#IconY#-3,0,48))"][!SetVariable SlideH "(Clamp(#SlideH#+3,0,50))"][!SetVariable UnCropH "(Clamp(#UnCropH#+3,0,48))"]#U#
ActionList2=Wait 200|Repeat SlideDown,#W#,20
SlideDown=[!SetVariable IconY "(Clamp(#IconY#+3,0,48))"][!SetVariable SlideH "(Clamp(#SlideH#-3,0,50))"][!SetVariable UnCropH "(Clamp(#UnCropH#-3,0,48))"]#U#
DynamicVariables=1
UpdateDivider=-1
IgnoreWarnings=1

[MeterSlideBack]
Meter=Image
Group=Sliders
W=116
H=#SlideH#
Y=#IconY#
SolidColor=15,55,79,255
DynamicVariables=1

[MeterBottomBar]
Meter=Image
W=116
H=2
Y=50
SolidColor=155,171,249,255

[MeterIcon1]
Meter=Image
Group=Sliders
X=5
Y=#IconY#
ImageName=#@#Images\DriveC.png
ImageTint=200,200,200,255
ImageCrop=0,0,48,#UnCropH#,1
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# ImageTint ""]#U#
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageTint "200,200,200,255"]#U#
LeftMouseUpAction=["C:"]

[MeterIcon2]
Meter=Image
Group=Sliders
X=10R
Y=#IconY#
ImageName=#@#Images\ControlPanel.png
ImageTint=200,200,200,255
ImageCrop=0,0,48,#UnCropH#,1
DynamicVariables=1
MouseOverAction=[!SetOption #CURRENTSECTION# ImageTint ""]#U#
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageTint "200,200,200,255"]#U#
LeftMouseUpAction=["Control"]
GIF.gif
You do not have the required permissions to view the files attached to this post.
haexi
Posts: 3
Joined: May 11th, 2017, 11:30 pm

Re: ActionTimer multiple Meters

Post by haexi »

Thanks a lot! I will give it a try.