It is currently April 28th, 2024, 5:02 pm

Show Multiple Skins on Mouse Hover

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16184
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Show Multiple Skins on Mouse Hover

Post by balala »

balala wrote:Now about the delay: definitely not impossible, but neither simple isn't. You need some additional measure, to handle when and which skin will be loaded. I'm working on it, will come back soon with a not too simple solution.
Ok, the delay question: the following code will handle the delay. I wrote this code, based on my previous description, so the file structure used in this code, follows the mentioned description, using the presented file structure.
So, if you have that file structure:

Code: Select all

Simply\Adventures\Apps\DoctorWho1\DoctorWho1.ini
Simply\Adventures\Apps\DoctorWho2\DoctorWho2.ini
Simply\Adventures\Apps\DoctorWho3\DoctorWho3.ini
Simply\Adventures\Apps\DoctorWho4\DoctorWho4.ini
Simply\Adventures\Apps\NoMansSky\NoMansSky.ini
Simply\Adventures\Apps\Undertale\Undertale.ini
Simply\Adventures\Apps\DoctorWho5\DoctorWho5.ini
Simply\Adventures\Apps\Unravel\Unravel.ini
you can try the following code:

Code: Select all

[Rainmeter]
Uptime=-1

[Variables]
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeasure "MeasureLoadUnload"][!UpdateMeter "MeterVariables"][!Redraw]
Num=0
Start=0
De=""

[MeasureStart]
Measure=Calc
Formula=#Start#
IfCondition=(MeasureStart=0)
IfTrueAction=[!CommandMeasure MeasureSlide "Stop 1"][!CommandMeasure MeasureSlide "Execute 2"]
IfFalseAction=[!CommandMeasure MeasureSlide "Stop 2"][!CommandMeasure MeasureSlide "Execute 1"]
DynamicVariables=1

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat Up,1000,9
Up=[!SetVariable Num "(Clamp((#Num#+1),0,9))"]#U#
ActionList2=Repeat Down,1000,9
Down=[!SetVariable Num "(Clamp((#Num#-1),0,9))"]#U#
DynamicVariables=1

[MeasureLoadUnload]
Measure=Calc
Formula=#Num#
IfCondition=(MeasureLoadUnload=1)
IfTrueAction=[!ActivateConfig "Simply\Adventures\DoctorWho1" "DoctorWho1.ini"]
IfCondition2=(MeasureLoadUnload=2)
IfTrueAction2=[!#De#ActivateConfig "Simply\Adventures\DoctorWho2" "DoctorWho2.ini"]
IfCondition3=(MeasureLoadUnload=3)
IfTrueAction3=[!#De#ActivateConfig "Simply\Adventures\DoctorWho3" "DoctorWho3.ini"]
IfCondition4=(MeasureLoadUnload=4)
IfTrueAction4=[!#De#ActivateConfig "Simply\Adventures\DoctorWho4" "DoctorWho4.ini"]
IfCondition5=(MeasureLoadUnload=5)
IfTrueAction5=[!#De#ActivateConfig "Simply\Adventures\NoMansSky" "NoMansSky.ini"]
IfCondition6=(MeasureLoadUnload=6)
IfTrueAction6=[!#De#ActivateConfig "Simply\Adventures\Undertale" "Undertale.ini"]
IfCondition7=(MeasureLoadUnload=7)
IfTrueAction7=[!#De#ActivateConfig "Simply\Adventures\DoctorWho5" "DoctorWho5.ini"]
IfCondition8=(MeasureLoadUnload=8)
IfTrueAction8=[!#De#ActivateConfig "Simply\Adventures\Unravel" "Unravel.ini"]
DynamicVariables=1

[MeterVariables]
Meter=STRING
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Num: #Num##CRLF#Start: #Start#
DynamicVariables=1
MouseOverAction=[!SetVariable Start "1"][!SetVariable De ""][!UpdateMeasure "MeasureLoadUnload"][!UpdateMeasure "MeasureStart"][!UpdateMeter "MeterVariables"][!Redraw]
MouseLeaveAction=[!SetVariable Start "0"][!SetVariable De "De"][!UpdateMeasure "MeasureLoadUnload"][!UpdateMeasure "MeasureStart"][!UpdateMeter "MeterVariables"][!Redraw]
About this code, note the followings:
  • The Update of this code is set to -1. This means that the skin isn't never updated, except the first moment, when you load (or refresh) the skin. Depending on what else your skin uses, this probably won't be a good Update value for your needs, but the skin will work the same well, even if you use the default Update=1000, or finally any other Update value.
  • The code has one single meter, named [MeterVariables]. This meter will detect the mouse hovering. You probably will need to move the MouseOverAction and MouseLeaveAction options to the appropriate meter. That's not a problem, you can move it anywhere.
  • The 1000 values used in the ActionList1 and ActionList2 options of the [MeasureSlide] measure, control the delay. It is expressed into milliseconds, 1000 means a delay of 1 second.
The code uses a few variables:
  • U is needed by the ActionTimer plugin measure, which loads / unloads the appropriate skins.
  • Num is a variable number, which increases when the mouse is over the meter and decreases when it's leaved (this is set by the [MeasureSlide] measure). Any newly set value of the variable will load (if it increases), respectively will unload (if the Num decreases) one skin.
  • Start controls the action: normally its value is 0, but when you're hovering the mouse over the meter, Start become 1 and when you're leaving the meter, it become again 0. According to its value, the [MeasureStart] measure sets the appropriate execution action of the [MeasureSlide] measure, increasing or decreasing the value of the Num variable.
  • Finally the De variable is most strange variable: when the Num is increasing (so when Start is equal with 1), De is set to the empty string, while when Num is decresing, De is set to De. This variable modifies the bangs used into the IfTrueAction options of the [MeasureLoadUnload] measure and I used this trick to avoid the error messages in the log. Without it, on each new value of the Num variable I should have to activate one skin and deactivate the next one, but this next skin wouldn't be active yet (the deactivation of this skin would have importance when the value of the Num variable decreases), giving an error message. This way I avoided those error messages.
Now Steamfox, please check out this code and let me know if you could make it to properly work. If you'll need I'll give further assistance, if you'll post the entire code you have so far.