It is currently July 10th, 2020, 1:13 pm

!ToggleMeterGroup

Help with creating, editing & fixing problems with skins
User avatar
zivallh
Posts: 5
Joined: October 16th, 2019, 2:26 pm

!ToggleMeterGroup

Post by zivallh »

Is it Possible to Make, !ToggleMeterGroup Fade in/Out? :)

Code: Select all

[MeterTemperature]
MeasureName=Temperature
Meter=String
X=0
Y=0
FontFace=#Font#
FontColor=#FontColor#
FontSize=40
Antialias=1
DynamicVariables=1
Text=%1°
LeftMouseUpAction=[!ToggleMeterGroup "Conditions"]

[MeterConditions]
MeasureName=CurrentConditions
Meter=String
X=0
Y=50
FontFace=#Font#
FontColor=#FontColor#
FontSize=18
Antialias=1
Hidden=0
Group=Conditions
Last edited by balala on June 30th, 2020, 1:36 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting code snippets. It's the </> button.
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ToggleMeterGroup

Post by balala »

zivallh wrote:
June 30th, 2020, 10:17 am
Is it Possible to Make, !ToggleMeterGroup Fade in/Out? :)
If you want to use a fade effect for the !ToggleMeter(Group) bang, no, simply it's not possible. Only the !Toggle(Group) bang has a !ToggleFade(Group) variation, which I suppose is similar to what you want. But this bang toggles the skins, not some meters.
To toggle some meters with fade effect you have to use an ActionTimer plugin measure, which is a little bit more complicated, but definitely not impossible. Interested on how to do this?
User avatar
zivallh
Posts: 5
Joined: October 16th, 2019, 2:26 pm

Re: !ToggleMeterGroup

Post by zivallh »

Thanks for your reply!

Yes interested for sure, but the thing is I have a skin I want to show a meter group when I toggle to show fade, I don't know about your method could you write it for me may it work
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ToggleMeterGroup

Post by balala »

zivallh wrote:
June 30th, 2020, 3:55 pm
Thanks for your reply!

Yes interested for sure, but the thing is I have a skin I want to show a meter group when I toggle to show fade, I don't know about your method could you write it for me may it work
Ok, here is a simple workaround. If you can't get it to work, please post the whole code you have so far, to can check it.
So, first add two variables to the [Variables] section, beside the existing ones:

Code: Select all

[Variables]
...
Alpha=0
Toggle=0
Secondly add the following two measures:

Code: Select all

[MeasureToggle]
Measure=Calc
Formula=#Toggle#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasurePushDays" "Execute 1"][!CommandMeasure "MeasurePushDays" "Stop 2"]
IfFalseAction=[!CommandMeasure "MeasurePushDays" "Stop 1"][!CommandMeasure "MeasurePushDays" "Execute 2"]
DynamicVariables=1

[MeasurePushDays]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!Redraw]
ActionList2=Repeat FadeOut,20,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!Redraw]
DynamicVariables=1
And finally modify the existing meters, as it follows:

Code: Select all

[MeterTemperature]
MeasureName=Temperature
Meter=String
X=0
Y=0
FontFace=#Font#
FontColor=#FontColor#
FontSize=40
Antialias=1
DynamicVariables=1
Text=%1°
LeftMouseUpAction=[!SetVariable Toggle "(1-#Toggle#)"][!UpdateMeasure "MeasureToggle"]
DynamicVariables=1
;[!ToggleMeterGroup "Conditions"]

[MeterConditions]
MeasureName=CurrentConditions
Meter=String
X=0
Y=50
FontFace=#Font#
FontColor=#FontColor#,#Alpha#
FontSize=18
Antialias=1
Hidden=0
Group=Conditions
DynamicVariables=1
Note that this will work ONLY if the existing FontColor variable (which I don't know) doesn't have a transparency set. So, if the FontColor variable consist of three values (RGB), it's gonna work, but if it consist of four values (RGBA), the code won't work. If this is the case, remove the fourth element of this variable (for instance if your variable is FontColor=255,255,255, it is ok, but if it's FontColor=255,255,255,255, remove the last term, replacing it with FontColor=255,255,255).
Hope this modifications are working. Please let me know if they aren't and in this case post the code you have so far.
User avatar
zivallh
Posts: 5
Joined: October 16th, 2019, 2:26 pm

Re: !ToggleMeterGroup

Post by zivallh »

Doesn't work it's not opening or closing

Code: Select all

[Rainmeter]
Update=30
BackgroundMode=2
SolidColor=0,0,0,1
AccurateText=1
DynamicWindowSize=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

;RightMouseUpAction=[!SkinCustomMenu]
ContextTitle=Location: [@LocationName]
ContextAction=["https://weather.com/weather/today"]
ContextTitle2=Time: [@CurrentObservationTime] [@LocationTimezoneAbbreviation]
ContextAction2=[]
ContextTitle3=----
ContextAction3=[]
ContextTitle4=Edit Weather Variables
ContextAction4=["#@#WeatherComJSONVariables.inc"]
ContextTitle5=Open Weather Codes
ContextAction5=["https://weather.codes/"]
ContextTitle6=----
ContextAction6=[]
ContextTitle7=Fahrenheit
ContextAction7=[!WritekeyValue Variables Language en-US][!Refresh]
ContextTitle8=Celsius
ContextAction8=[!WritekeyValue Variables Language en-CA][!Refresh]
ContextTitle9=----
ContextAction9=[]
ContextTitle10=Change Color
ContextAction10=["#@#Addons\RainRGB4.exe" "VarName=FontColor" "FileName=#@#Variables.inc"]

[Variables]
@Include1=#@#WeatherComJSONVariables.inc
@Include2=#@#WeatherComJSONMeasures.inc
@Include3=#@#Variables.inc

Language=en-CA
Scale=1
ScrollMouseIncrement=0.05

StringAlign=left
StringStyle=Normal
StringCase=None
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontSize=(9*#Scale#)
FontFace=Comfortaa
Font=Gilroy ExtraBold
FontColor=255,255,255
Alpha=0
Toggle=0

;[MeasureFade]=================================

[MeasureToggle]
Measure=Calc
Formula=#Toggle#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasurePushDays" "Execute 1"][!CommandMeasure "MeasurePushDays" "Stop 2"]
IfFalseAction=[!CommandMeasure "MeasurePushDays" "Stop 1"][!CommandMeasure "MeasurePushDays" "Execute 2"]
DynamicVariables=1

[MeasurePushDays]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!Redraw]
ActionList2=Repeat FadeOut,20,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!Redraw]
DynamicVariables=1

;[DISPLAY CURRENT]=================================

[IconNumberCalc]
Measure=Calc
Formula=Counter % 89

[Meter@CurrentIcon]
Meter=Image
ImageName=#@#Images\Sergey\[@CurrentIcon]\[IconNumberCalc].png
X=(0*#Scale#)
Y=(7*#Scale#)
W=(70*#Scale#)
ImageTint=#FontColor#
;ImageAlpha=150
DynamicVariables=1

[MeterTemperature]
MeasureName=@CurrentTemperature
;MeasureName2=@UnitsTemperature
Meter=String
X=(80*#Scale#)
Y=(10*#Scale#)
FontFace=#Font#
FontSize=(40*#Scale#)
FontColor=#FontColor#
StringStyle=Normal
StringAlign=Left
StringEffect=Shadow
FontEffectColor=0,0,0,50
Antialias=1
Text=%1°
LeftMouseUpAction=[!SetVariable Toggle "(1-#Toggle#)"][!UpdateMeasure "MeasureToggle"]
;LeftMouseUpAction=[!ToggleMeterGroup "Conditions"][PLAY #@#Sounds\Hardware Remove.wav]
DynamicVariables=1

[MeterConditions]
MeasureName=@CurrentConditions
Meter=String
X=(170*#Scale#)
Y=(7*#Scale#)r
FontFace=#Font#
FontColor=#FontColor#
FontSize=(18*#Scale#)
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringCase=#StringCase#
StringEffect=Shadow
FontEffectColor=0,0,0,50
Antialias=1
Hidden=0
Group=Conditions
DynamicVariables=1
Last edited by eclectic-tech on July 1st, 2020, 9:44 pm, edited 1 time in total.
Reason: Please use code tags. It is the </> symbol.
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ToggleMeterGroup

Post by balala »

zivallh wrote:
July 1st, 2020, 7:25 pm
Doesn't work it's not opening or closing
It does. But the problem of your code is that you forgot to add the #Alpha# parameter to the FontColor option of the [MeterConditions] meter. Add it: FontColor=#FontColor#,#Alpha#
User avatar
zivallh
Posts: 5
Joined: October 16th, 2019, 2:26 pm

Re: !ToggleMeterGroup

Post by zivallh »

You're genius thank you so much!

If I have another Meter to fade is it possible to do it?

Code: Select all

[MeasureToggle]
Measure=Calc
Formula=#Toggle#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasurePushDays" "Execute 1"][!CommandMeasure "MeasurePushDays" "Stop 2"]
IfFalseAction=[!CommandMeasure "MeasurePushDays" "Stop 1"][!CommandMeasure "MeasurePushDays" "Execute 2"]
DynamicVariables=1

[MeasurePushDays]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,#Speed#,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!UpdateMeterGroup "MoreConditions"][!Redraw]
ActionList2=Repeat FadeOut,#Speed#,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!UpdateMeterGroup "MoreConditions"][!Redraw]
DynamicVariables=1

[MeterTemperature]
MeasureName=@CurrentTemperature
;MeasureName2=@UnitsTemperature
Meter=String
X=(80*#Scale#)
Y=(10*#Scale#)
FontFace=#Font#
FontSize=(40*#Scale#)
FontColor=#FontColor#
StringStyle=Normal
StringAlign=Left
StringEffect=Shadow
FontEffectColor=0,0,0,50
Antialias=1
Text=%1°
LeftMouseUpAction=[!SetVariable Toggle "(1-#Toggle#)"][!UpdateMeasure "MeasureToggle"]
;LeftMouseUpAction=[!ToggleMeterGroup "Conditions"][PLAY #@#Sounds\Hardware Remove.wav]
DynamicVariables=1

[MeterConditions]
MeasureName=@CurrentConditions
Meter=String
X=(170*#Scale#)
Y=(7*#Scale#)r
FontFace=#Font#
FontColor=#FontColor#,#Alpha#
FontSize=(18*#Scale#)
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringCase=#StringCase#
StringEffect=Shadow
FontEffectColor=0,0,0,50
Antialias=1
Hidden=0
Group=Conditions
DynamicVariables=1
LeftMouseUpAction=[!ToggleMeterGroup "MoreConditions"][PLAY #@#Sounds\Hardware Remove.wav][!Redraw]

[MeterStyle]
X=(170*#Scale#)
Y=(20*#Scale#)r
FontColor=#FontColor#,#Alpha#
FontSize=#FontSize#
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringCase=#StringCase#
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontFace=#FontFace#
Antialias=1
Hidden=1
Group=MoreConditions
DynamicVariables=1

Last edited by eclectic-tech on July 1st, 2020, 9:54 pm, edited 1 time in total.
Reason: Please use code tags. It is the </> symbol.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4040
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: !ToggleMeterGroup

Post by eclectic-tech »

zivallh wrote:
July 1st, 2020, 9:52 pm
You're genius thank you so much!

If I have another Meter to fade is it possible to do it?
To control a second meter is possible; add the #alpha# to the fontcolor of the meter. It will fade/show the same as the first meter.

If you want to control the second meter separately, you would need to create a new variable, let's call it 'Alpha2', and add 2 new ActionList to the Action Timer measure to control that variable the same way you control 'Alpha', and add a bang to call those actions lists..

You could also create a meter style for each alpha variable, and use those styles to control multiple meters.

Code: Select all

[Variables]
Alpha=255
Alpha2=255
Toggle=0
Toggle2=0

[MeasurePushDays]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
DynamicVariables=1

ActionList1=Repeat FadeIn,#Speed#,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!Redraw]

ActionList2=Repeat FadeOut,#Speed#,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Conditions"][!Redraw]

ActionList3=Repeat FadeIn2,#Speed#,20
FadeIn2=[!SetVariable Alpha2 "(Clamp((#Alpha2#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "MoreConditions"][!Redraw]

ActionList4=Repeat FadeOut2,#Speed#,20
FadeOut2=[!SetVariable Alpha2 "(Clamp((#Alpha2#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "MoreConditions"][!Redraw]

; Create styles for each "alpha"
[MeterStyle1]
X=(170*#Scale#)
Y=(20*#Scale#)r
FontColor=#FontColor#,#Alpha#
FontSize=#FontSize#
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringCase=#StringCase#
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontFace=#FontFace#
Antialias=1
Hidden=1
Group=Conditions
DynamicVariables=1

[MeterStyle2]
X=(170*#Scale#)
Y=(20*#Scale#)r
FontColor=#FontColor#,#Alpha2#
FontSize=#FontSize#
StringAlign=#StringAlign#
StringStyle=#StringStyle#
StringCase=#StringCase#
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontFace=#FontFace#
Antialias=1
Hidden=1
Group=MoreConditions
DynamicVariables=1

...
User avatar
zivallh
Posts: 5
Joined: October 16th, 2019, 2:26 pm

Re: !ToggleMeterGroup

Post by zivallh »

Sorry, but I didn't get you :???:

Simply I want, for example, Text1 to fade Text2 and Text2 fade Text3
* Text3 is already hidden

Code: Select all

[Rainmeter]
Update=30
BackgroundMode=2
SolidColor=0,0,0,1
AccurateText=1
DynamicWindowSize=1

[Variables]
	
Alpha=255
Toggle=0

Alpha2=255
Toggle2=0

Speed=5

[MeasureToggle]
Measure=Calc
Formula=#Toggle#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureText" "Execute 1"][!CommandMeasure "MeasureText" "Stop 2"]
IfFalseAction=[!CommandMeasure "MeasureText" "Stop 1"][!CommandMeasure "MeasureText" "Execute 2"]
DynamicVariables=1

[MeasureText]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,#Speed#,20
FadeIn=[!SetVariable Alpha "(Clamp((#Alpha#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text2"][!Redraw]
ActionList2=Repeat FadeOut,#Speed#,20
FadeOut=[!SetVariable Alpha "(Clamp((#Alpha#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text2"][!Redraw]
DynamicVariables=1

[MeasureToggle2]
Measure=Calc
Formula=#Toggle2#
IfCondition=(#CURRENTSECTION#=0)
IfTrueAction=[!CommandMeasure "MeasureText2" "Execute 1"][!CommandMeasure "MeasureText2" "Stop 2"]
IfFalseAction=[!CommandMeasure "MeasureText2" "Stop 1"][!CommandMeasure "MeasureText2" "Execute 2"]
DynamicVariables=1

[MeasureText2]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,#Speed#,20
FadeIn=[!SetVariable Alpha2 "(Clamp((#Alpha2#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text3"][!Redraw]
ActionList2=Repeat FadeOut,#Speed#,20
FadeOut=[!SetVariable Alpha2 "(Clamp((#Alph2a#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text3"][!Redraw]
DynamicVariables=1

[MeterStyleText]
Meter=string
Text=Text 1
X=0
Y=0
FontColor=255,255,255
FontSize=20
FontFace=Segoe UI
Antialias=1
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Toggle "(1-#Toggle#)"][!UpdateMeasure "MeasureToggle"]

[MeterStyleText2]
Meter=string
Text=Text 2
X=0
Y=30
FontColor=255,255,255,#Alpha#
FontSize=20
FontFace=Segoe UI
Antialias=1
Group=Text2
Hidden=0
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Toggle2 "(1-#Toggle2#)"][!UpdateMeasure "MeasureToggle2"]

[MeterStyleText3]
Meter=string
Text=Text 3
X=0
Y=60
FontColor=255,255,255,#Alpha2#
FontSize=20
FontFace=Segoe UI
Antialias=1
Group=Text3
Hidden=1
DynamicVariables=1
Last edited by eclectic-tech on July 2nd, 2020, 5:16 pm, edited 1 time in total.
Reason: Please use code tags. It is the </> symbol. Please!
User avatar
balala
Rainmeter Sage
Posts: 10998
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !ToggleMeterGroup

Post by balala »

zivallh wrote:
July 2nd, 2020, 7:43 am
Simply I want, for example, Text1 to fade Text2 and Text2 fade Text3
* Text3 is already hidden
First, note that there is a typo in your code: the #Alpha2# variable is written as #Alph2a# into the first !SetVariable bang of the FadeOut option of the [MeasureText2] measure (FadeOut=[!SetVariable Alpha2 "(Clamp((#Alph2a#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text3"][!Redraw]).
And there is one more problem: if the [MeterStyleText3] meter is hidden at the beginning, doesn't matter too much how do you set the Alpha2 variable, the meter remains hidden and you don't see it even if you set its transparency to 255. So, you have to show that meter. For instance add a [!ShowMeter "MeterStyleText3"] bang to the FadeOut option of the [MeasureText2] measure.
With all this, the [MeasureText2] measure looks like this:

Code: Select all

[MeasureText2]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,#Speed#,20
FadeIn=[!SetVariable Alpha2 "(Clamp((#Alpha2#+13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text3"][!Redraw]
ActionList2=Repeat FadeOut,#Speed#,20
FadeOut=[!ShowMeter "MeterStyleText3"][!SetVariable Alpha2 "(Clamp((#Alpha2#-13),0,255))"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeterGroup "Text3"][!Redraw]
DynamicVariables=1
Does it work?