It is currently March 28th, 2024, 4:00 pm

IfMatch problem

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

IfMatch problem

Post by Codger »

So close to completing a skin with no help from anyone but on the last feature I hit a snag and I've stared at it for far too long and tried every possible variation.

What is wrong with this measure?

Code: Select all

[SetAMPMColor]
Measure=Time
Format=%p
IfMatch=AM
IfMatchAction=[!SetVariable CircleColor "#CircleColorAM#"]
IfMatch2=PM
IfMatch2Action=[!SetVariable CircleColor "#CircleColorPM#"]
IfMatchMode=1
DynamicVariables=1
UpdateDivider=-1
On the initial run through it should change the color but CircleColor does not change.

Full code is here.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
Bevel=2
;--- Mouse Functions
MiddleMouseDownAction=!DeactivateConfig
LeftMouseUpAction=[!EnableMeasure "HideFor10"][!UpdateMeasure "HideFor10"][!Hide][!EnableMeasure "HideFor10"]
RightMouseUpAction=[!SkinCustomMenu]
MouseScrollDownAction=[!SetVariable Scale [ScaleDown:]][!UpdateMeasureGroup ScaleGroup][!UpdateMeasureGroup HourGroup][!UpdateMeter BigCircle][!UpdateMeter HourCircle][!UpdateMeasureGroup MinuteGroup][!UpdateMeter MinuteCircle]
MouseScrollUpAction=[!SetVariable Scale [ScaleUp:]][!UpdateMeasureGroup ScaleGroup][!UpdateMeasureGroup HourGroup][!UpdateMeter BigCircle][!UpdateMeter HourCircle][!UpdateMeasureGroup MinuteGroup][!UpdateMeter MinuteCircle]
;--- Context Menu
ContextTitle=Hide for 10 seconds
ContextAction=[!EnableMeasure "HideFor10"][!UpdateMeasure "HideFor10"][!Hide][!EnableMeasure "HideFor10"]
ContextTitle2=Refresh
ContextAction2=[!Refresh "#CURRENTCONFIG#"]
ContextTitle3=Save Size
ContextAction3=[!WriteKeyValue Variables Scale #Scale#]
ContextTitle4="-----"
ContextTitle5=Settings
ContextAction5=[!TrayMenu]
ContextTitle6=Manage
ContextAction6=[!Manage Skins #CURRENTCONFIG# #CURRENTFILE#]
ContextTitle7=View Variables
ContextAction7=[!About Skins #CURRENTCONFIG# #CURRENTFILE#]
ContextTitle8=Edit Skin
ContextAction8=["#CURRENTPATH##CURRENTFILE#"]
ContextTitle9=Unload Skin
ContextAction9=[!DeactivateConfig "#CURRENTCONFIG#" #CURRENTFILE#]

[Metadata]
Name=Hideaway Blob Clock
Author=Codger
Config=
Instructions=Use Custom Contect Menu for options.|Scroll to change Size.|Left Click to hife for 10 seconds to get underneath it easily.
Version=0.0.1
License=License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]
;-- Dynamic
Scale=30
CircleColor=255,100,0

;-- Static 
CircleColorAM=255,255,80
CircleColorPM=185,185,185
MinuteColor=255,0,0
HourColor=0,0,0
StrokeColor=255,200,0
MainOpacency=235
HandsOpacency=255
StrokeOpacency=88

;;===Formulas
[ScaleDown]
Measure=Calc
Formula=(Clamp(#Scale#-1,10,60))
DynamicVariables=1

[ScaleUp]
Measure=Calc
Formula=(Clamp(#Scale#+1,10,60))
DynamicVariables=1

;=== Shut Clock off for 10 seconds
;    so you can click something behind it
[HideFor10]
Measure=Calc
OnUpdateAction=[!Show][!DisableMeasure "HideFor10"]
UpdateDivider=10
Disabled=1

;--- Time
[MeasureHour]
Measure=Time
Format=%#I

[MeasureMinute]
Measure=Time
Format=%M
OnChangeAction=[!UpdateMeasureGroup MinuteGroup][!UpdateMeter MinuteCircle][!UpdateMeasureGroup HourGroup][!UpdateMeter HourCircle]

[MeasureAMPM]
Measure=Time
Format=%p
OnChangeAction=[!UpdateMeasure SetAMPMColor]

[SetAMPMColor]
Measure=Time
Format=%p
IfMatch=AM
IfMatchAction=[!SetVariable CircleColor "#CircleColorAM#"]
IfMatch2=PM
IfMatch2Action=[!SetVariable CircleColor "#CircleColorPM#"]
IfMatchMode=1
DynamicVariables=1
UpdateDivider=-1

;=== Positioning Formulas
[BigCenter]
Measure=Calc
Group=ScaleGroup
Formula=(#Scale#+(#Scale#/4))
DynamicVariables=1
UpdateDivider=-1

[MinuteToDegree]
Measure=Calc
Group=MinuteGroup
Formula=[MeasureMinute:] * 6
DynamicVariables=1
UpdateDivider=-1

[MinuteCenterX]
Measure=Calc
Group=ScaleGroup | MinuteGroup
Formula=([BigCenter:] + (#Scale#) * Sin([MinuteToDegree] * PI / 180))
DynamicVariables=1
UpdateDivider=-1

[MinuteCenterY]
Measure=Calc
Group=ScaleGroup | MinuteGroup
Formula=([BigCenter:] - (#Scale#) * Cos([MinuteToDegree] * PI / 180))
DynamicVariables=1
UpdateDivider=-1

[HourToDegree]
Measure=Calc
Group=HourGroup
Formula=(([MeasureHour:] * 30) + ([MeasureMinute:]/2))
DynamicVariables=1
UpdateDivider=-1

[HourCenterX]
Measure=Calc
Group=ScaleGroup | HourGroup
Formula=([BigCenter:] + (#Scale#/2) * Sin([HourToDegree] * PI / 180))
DynamicVariables=1
UpdateDivider=-1

[HourCenterY]
Measure=Calc
Group=ScaleGroup | HourGroup
Formula=([BigCenter:] - (#Scale#/2) * Cos([HourToDegree] * PI / 180))
DynamicVariables=1
UpdateDivider=-1

;=== Circles
[MinuteCircle]
Meter=Shape
Shape=Ellipse [MinuteCenterX],[MinuteCenterY],(#Scale#/4) | Fill Color #MinuteColor#,#HandsOpacency# | StrokeWidth 2 | Stroke Color #StrokeColor#,#StrokeOpacency#
DynamicVariables=1
UpdateDivider=-1

[BigCircle]
Meter=Shape
Shape=Ellipse [BigCenter:],[BigCenter:],#Scale# | Fill Color #CircleColor#,#MainOpacency# | StrokeWidth 2 | Stroke Color #StrokeColor#,#StrokeOpacency#
DynamicVariables=1
UpdateDivider=-1

[HourCircle]
Meter=Shape
Shape=Ellipse [HourCenterX:],[HourCenterY:],(#Scale#/2) | Fill Color #HourColor#,#HandsOpacency# | StrokeWidth 2 | Stroke Color #StrokeColor#,#StrokeOpacency#
DynamicVariables=1
UpdateDivider=-1
Thanks
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IfMatch problem

Post by jsmorley »

Codger wrote:So close to completing a skin with no help from anyone but on the last feature I hit a snag and I've stared at it for far too long and tried every possible variation.

What is wrong with this measure?

Code: Select all

[SetAMPMColor]
Measure=Time
Format=%p
IfMatch=AM
IfMatchAction=[!SetVariable CircleColor "#CircleColorAM#"]
IfMatch2=PM
IfMatch2Action=[!SetVariable CircleColor "#CircleColorPM#"]
IfMatchMode=1
DynamicVariables=1
UpdateDivider=-1
It's not IfMatch2Action, it's IfMatchAction2

https://docs.rainmeter.net/manual-beta/measures/general-options/ifmatchactions/
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: IfMatch problem

Post by Codger »

:jawdrop I knew it would be something blatant. Must have stared at those lines a hundred times. Thanks. Works now.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: IfMatch problem

Post by mak_kawa »

Hi Codger

And probably, you missed updating [BigCircle] meter.

Code: Select all

[SetAMPMColor]
Measure=String
String=[MeasureAMPM]
IfMatch=AM
IfMatchAction=[!SetVariable CircleColor "#CircleColorAM#"][!UpdateMeter BigCircle]
IfMatch2=PM
IfMatchAction2=[!SetVariable CircleColor "#CircleColorPM#"][!UpdateMeter BigCircle]
IfMatchMode=1
DynamicVariables=1
UpdateDivider=-1
Edit: Sorry Codger, This is my misunderstanding.
Last edited by mak_kawa on September 19th, 2017, 11:18 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IfMatch problem

Post by jsmorley »

Codger wrote::jawdrop I knew it would be something blatant. Must have stared at those lines a hundred times. Thanks. Works now.
It always take 101 times for me... ;-)
User avatar
Codger
Posts: 97
Joined: May 29th, 2017, 3:16 pm

Re: IfMatch problem

Post by Codger »

I was thinking the Measure above it would handle that. But I can see that would make the timing dicey and that your way is better.

Thanks again.
Post Reply