It is currently April 25th, 2024, 3:36 am

Imported measure is not working in the main skin.ini file

Get help with creating, editing & fixing problems with skins
User avatar
Innocent_Zero
Posts: 9
Joined: May 4th, 2022, 10:08 am

Imported measure is not working in the main skin.ini file

Post by Innocent_Zero »

I created a skin that had imported Vars.inc and Measures.inc
Vars.inc:

Code: Select all

[Variables]
Width=(#WORKAREAWIDTH#/5)
color1=255,255,0,255
color2=0,255,0,255
color3=255,0,0,255
color4=255,150,0,255
color5=255,0,255,255
color6=255,255,255,255
color7=255,100,100,255
color8=0,0,255,255
color0=0,255,255,255

[StyleText]
FontFace=Segoe UI
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
FontWeight=400
Clipstring=2
ClipstringW=#Width#
Measures.inc

Code: Select all

[MeasureHeaderCount]
Measure=Calc
Formula=MeasureHeaders+1

[MeasureColor]
Measure=Calc
Formula=65

[MeasureHighlightColor]
Measure=String
String=255,255,0,255

[MeasureColorSwitcher]
Measure=Calc
Formula=(MeasureColor+1)%9
IfEqualValue=1
IfEqualAction=!WriteKeyValue MeasureHighlightColor String #color1# 
IfEqualValue2=2
IfEqualAction2=!WriteKeyValue MeasureHighlightColor String #color2#
IfEqualValue3=3
IfEqualAction3=!WriteKeyValue MeasureHighlightColor String #color3#
IfEqualValue4=4
IfEqualAction4=!WriteKeyValue MeasureHighlightColor String #color4#
IfEqualValue5=5
IfEqualAction5=!WriteKeyValue MeasureHighlightColor String #color5#
IfEqualValue6=6
IfEqualAction6=!WriteKeyValue MeasureHighlightColor String #color6#
IfEqualValue7=7
IfEqualAction7=!WriteKeyValue MeasureHighlightColor String #color7#
IfEqualValue8=8
IfEqualAction8=!WriteKeyValue MeasureHighlightColor String #color8#
IfEqualValue9=0
IfEqualAction9=!WriteKeyValue MeasureHighlightColor String #color0#
Main skin.ini

Code: Select all

[Rainmeter]
Author=u/Innocent_Zero
Update=-1
AccurateText=1
DynamicWindowSize=1
Group=Notes
ContextTitle=Add Group
ContextAction=[!WriteKeyValue Header[MeasureHeaderCount] Meter Image][!WriteKeyValue Header[MeasureHeaderCount] X 0r][!WriteKeyValue Header[MeasureHeaderCount] Y 5R][!WriteKeyValue Header[MeasureHeaderCount] SolidColor #color1#][!WriteKeyValue Header[MeasureHeaderCount] W #Width#][!WriteKeyValue Header[MeasureHeaderCount] H 10][!WriteKeyValue Meter[MeasureHeaderCount] Meter String][!WriteKeyValue Meter[MeasureHeaderCount] MeterStyle StyleText][!WriteKeyValue Meter[MeasureHeaderCount] X 0r][!WriteKeyValue Meter[MeasureHeaderCount] Y 0R][!WriteKeyValue Meter[MeasureHeaderCount] Text "Fillthis"][!WriteKeyValue MeasureHeaders Formula ([MeasureHeaders]+1)][!Update][!Redraw][!Delay 16][!Refresh]

[Variables]
@include=#@#Vars.inc

[MeasureHeaders]
Measure=Calc
Formula=2

@include2=#@#Measures.inc

[StartMenuBGSolid]
Meter=Shape
Shape=Rectangle 0,0,#Width#,#WORKAREAHEIGHT# | FillColor 0,0,0,255 |

[Header1]
Meter=Image
X=0
Y=5
SolidColor=255,255,0,255
W=#Width#
H=10

[Meter1]
Meter=String
MeterStyle=StyleText
X=0r
Y=0R
Text=filler

[Header2]
Meter=Image
X=0r
Y=5R
SolidColor=255,255,0,255
W=#Width#
H=10
LeftMouseUpAction=[!WriteKeyValue Header2 SolidColor [MeasureHighlightColor]][!WriteKeyValue MeasureColor Formula ([MeasureColor]+1) "#@#Measures.inc"][!UpdateMeasure * "#@#Measures.inc"][!Refresh]

[Meter2]
Meter=String
MeterStyle=StyleText
X=0r
Y=0R
Text=filler
When I click on Header 2 it is supposed to switch through the 9 colours mentioned in vars.inc. However it changes to yellow (the colour currently mentioned in the [MeasureHighlightColor] section; and then stagnates. I checked the other two measures by displaying their values and they work fine but this one doesn't. How do I fix this?

Edit: I checked the log file; but I don't think it is right since the other two measures are updating perfectly.

Code: Select all

ERRO (15:57:23.419) Pic Loader\Notes\Note1.ini: !UpdateMeasure: Skin "C:\Users\Innocent_Zero\Documents\Rainmeter\Skins\Pic Loader\@Resources\Measures.inc" not found
NOTE (15:57:23.445) Pic Loader\Notes\Note1.ini: Refreshing skin
N0Syst3m15s@fe. Quite unfortunately, not even this one.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Imported measure is not working in the main skin.ini file

Post by eclectic-tech »

In '#@#Measures.inc' you use multiple IfEqual test, but you can only have one of these in a single measure.
You should use IfCondition test instead.

I have not tried your complete code, but this change should be made to #@#Measures.inc

Code: Select all

[MeasureHeaderCount]
Measure=Calc
Formula=MeasureHeaders+1

[MeasureColor]
Measure=Calc
Formula=65

[MeasureHighlightColor]
Measure=String
String=255,255,0,255

[MeasureColorSwitcher]
Measure=Calc
Formula=(MeasureColor+1)%9
IfCondition=(#CurrentSection#=1)
IfTrueAction=!WriteKeyValue MeasureHighlightColor String #color1# 
IfCondition2=(#CurrentSection#=2)
IfTrueAction2=!WriteKeyValue MeasureHighlightColor String #color2#
IfCondition3=(#CurrentSection#=3)
IfTrueAction3=!WriteKeyValue MeasureHighlightColor String #color3#
IfCondition4=(#CurrentSection#=4)
IfTrueAction4=!WriteKeyValue MeasureHighlightColor String #color4#
IfCondition5=(#CurrentSection#=5)
IfTrueAction5=!WriteKeyValue MeasureHighlightColor String #color5#
IfCondition6=(#CurrentSection#=6)
IfTrueAction6=!WriteKeyValue MeasureHighlightColor String #color6#
IfCondition7=(#CurrentSection#=7)
IfTrueAction7=!WriteKeyValue MeasureHighlightColor String #color7#
IfCondition8=(#CurrentSection#=8)
IfTrueAction8=!WriteKeyValue MeasureHighlightColor String #color8#
IfCondition9=(#CurrentSection#=0)
IfTrueAction9=!WriteKeyValue MeasureHighlightColor String #color0#
User avatar
Innocent_Zero
Posts: 9
Joined: May 4th, 2022, 10:08 am

Re: Imported measure is not working in the main skin.ini file

Post by Innocent_Zero »

Thanks eclectic-tech . It works perfectly now. This is basically a minimalist note taking skin I was making. Now the next challenge is UserInput. I'll soon post it. It's going to be my first ever skin I'm posting ANYWHERE!
N0Syst3m15s@fe. Quite unfortunately, not even this one.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Imported measure is not working in the main skin.ini file

Post by eclectic-tech »

Innocent_Zero wrote: May 8th, 2022, 11:30 am Thanks eclectic-tech . It works perfectly now. This is basically a minimalist note taking skin I was making. Now the next challenge is UserInput. I'll soon post it. It's going to be my first ever skin I'm posting ANYWHERE!
Good to hear!

I'll bet it won't be the last skin you create! ;-)

Look forward to seeing what you created :great: