Thinkr8 wrote: ↑December 26th, 2023, 9:24 pm
Yes, that is what I meant.
In this case you should have to use a positive value for the Update option. But if you don't want a continuous play, you have other choices as well. See below.
Thinkr8 wrote: ↑December 26th, 2023, 9:24 pm
The Images are named 00.png to 010.png, that's a total of 11 images.
You can replace the previously posted Substitute option by the following one:
Substitute="(.{1,2})":"0\1". But if there are only 11 images, the Formula option of the same [MeasureAnimation] measure should also be replaced by the following one:
Formula=( Counter % 11 ). The
Counter function is updated / increased by itself, no need to add 1.
So, just to be extremely precise, the whole [MeasureAnimation] measure should look this way:
Code: Select all
[MeasureAnimation]
Measure=Calc
Formula=( Counter % 11 )
RegExpSubstitute=1
Substitute="(.{1,2})":"0\1"
Thinkr8 wrote: ↑December 26th, 2023, 9:24 pm
Upon clicking the ani button I'd like for the ani button to play then stop playing at image 010.png, then activate the shields.ini, and then when I deactivate the shields.ini the ani button should play and go back to Image 00.png then stop playing until it is clicked again.
If your skin doesn't have other not posted parts, I probably would be tempted to use the
Update=-1 option in the [Rainmeter] section (as you did) and add an ActionTimer plugin measure. If want to try this out, do the followings:
- Add a (let's name it) Ord variable to the [Variables] section (just add this variable, don't remove the existing options):
Obviously the Ord name is arbitrary, you can use any other.
- Replace the [MeasureAnimation] measure by the following one:
Code: Select all
[MeasureAnimation]
Measure=Calc
Formula=#Ord#
RegExpSubstitute=1
Substitute="(.{1,2})":"0\1"
DynamicVariables=1
In fact the only reason why we have to use this measure is to can add the leading zero to the value of the variable. If in the name of those images you could remove the leading zeros, we could completely renounce to the above [MeasureAnimation] measure. Is this possible (I think it is, but am I right)?
- Add the following measure to your code:
Code: Select all
[MeasureOrd]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Up,20,10 | Wait 500 | ActivConf
Up=[!SetVariable Ord "(Clamp((#Ord#+1),0,10))"][!UpdateMeasure "MeasureOrd"][!UpdateMeasure "MeasureAnimation"][!UpdateMeter "AniImageButtons"][!Redraw]
ActivConf=[!ActivateConfig "USS ENTERPRISE NCC-1701-G\Pulp\Shields" "Shield.ini"]
ActionList2=Repeat Down,20,10 | Wait 500 | DeactivConfig
Down=[!SetVariable Ord "(Clamp((#Ord#-1),0,10))"][!UpdateMeasure "MeasureOrd"][!UpdateMeasure "MeasureAnimation"][!UpdateMeter "AniImageButtons"][!Redraw]
DeactivConfig=[!DeactivateConfig "USS ENTERPRISE NCC-1701-G\Pulp\Shields"]
DynamicVariables=1
See that I assumed the [AniImageButtons] is the meter which should show the animation (in the posted code this is the meter having the ImageName option related to the [MeasureAnimation] measure: ImagePath="#@#Images\Buttons\Shields\00[MeasureAnimation].png"), so this is the meter I updated into the Up and Down options. I also assumed the meter which you have / want to click to start the animation is [1], not "ani button", as you said in your last reply (this meter has a LeftMouseDownAction option).
- Replace the ImageName option of the [AniImageButtons] meter by this: ImagePath=#@#Images\Buttons\Shields\[MeasureAnimation].png. Note that I removed the 00 from the path. Also removed the not-needed quotes (less important).
- Finally replace the LeftMouseDownAction option of the [1] meter, by the following two options:
Code: Select all
[1]
...
LeftMouseUpAction=[!CommandMeasure "MeasureOrd" "Execute 1"][!CommandMeasure "MeasureOrd" "Stop 2"]
RightMouseUpAction=[!CommandMeasure "MeasureOrd" "Stop 1"][!CommandMeasure "MeasureOrd" "Execute 2"]
What is different than what you asked for: when you click the [1] meter, you get starting the animation. When it finishes increasing the variable, after half a second it activates the Shield.ini skin. You did ask to restart the animation to decrease the variable, when you deactivate the skin. Even if possible, this is a little bit more complicated, because we have to use a plugin to can know when you deactivated the config. So for now, when you right-click the [1] meter, the variable get starting decreasing, then when it reaches 0, after half a second the skin is deactivated. For first let's try it this way and let me know if you could get the skin working as expected. If you could, further improvements are definitely possible and we'll do them.
If you can't get this properly working, please repost the whole code of your skin.
Thinkr8 wrote: ↑December 26th, 2023, 9:24 pm
And I still fail to understand what the Value of the Update=? should be.
I've tried 5, 25, 50, 100, and 1000.
Update is the time amount between two consecutive updates of the skin. If it's negative, the skin is never updated excepting the very first moment when is activated. Details
here.