AzeTheGreat wrote:I'll take a look at the ActionTimer plugin, it sounds promising.
The ActionTimer plugin can be extremely useful in such cases. Eg instead of a such low Update value of your last code (25), which always is an undesirable value, you even can modify this to -1 (
Update=-1).
Update=-1 means that the skin automatically is never updated, to update it you have to use an !Update bang, or have to update the measures / meters one by one (or by group).
Now in this case, the skin as you had it, won't work, because if it's never updated, even if you're hovering the mouse over it, the image won't be shown.
But, you can add the following measure:
Code: Select all
[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,10,25
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+10,0,255))"]#U#
ActionList2=Repeat FadeOut,10,25
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-10,0,255))"]#U#
DynamicVariables=1
This measure will update the value of the Alpha variable on each 10 milliseconds (the first number in the ActionList1 and ActionList2 options), 25 times (the second number). On each such update, the ActionList1 option will add 10 to the actual value of the variable, while ActionList2 will extract 10. The first one will be used when you're hovering the mouse over the appropriate meter, the second one, when you're leaving the meter (image).
Now you have to initialize the Alpha variable. Add to the [Variables] section the following variables (we also will need the U variable, add it now):
Code: Select all
[Variables]
LEAVE THE OTHER VARIABLES UNTOUCHED
Alpha=0
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "meterIcon"][!Redraw]
You don't need any more the [FadeControl] measure, you can completely remove it.
Replace the MouseOverAction and MouseLeaveAction options of the [meterButton] meter as it follows:
Code: Select all
[meterButton]
Meter=Image
...
MouseOverAction=[!CommandMeasure MeasureSlide "Stop 2"][!CommandMeasure MeasureSlide "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureSlide "Stop 1"][!CommandMeasure MeasureSlide "Execute 2"]
These options mean that when you're hovering the mouse over the [meterButton] meter, the ActionList1 option of the [MeasureSlide] measure will start to execute and ActionList2 will be blocked, when you're leaving the meter, exactly vice-versa will happen.
You have to do just one single thing: replace the ImageAlpha option of the [meterIcon] meter with the following one:
ImageAlpha=#Alpha#.
That's it. Now even if you have the Update value set to -1, or to the default 1000, the fade effect still will work, without having to use a too small Update value. And that's a very good step, the low update values should be avoided as much as it is possible.
AzeTheGreat wrote:Edit: Does MouseOverAction continually activate as long as the mouse is over, or only once when it's moved over? I'm struggling to figure out how I could optimize this without losing functionality...
As every other in the ini files approach, only once. To activate it again, something have to change. Eg you have to leave first the meter, then hover the mouse again over it.