It is currently March 28th, 2024, 8:47 pm

Does it possible to make @IncludeMeters work with #CURRENTFILE#

Get help with creating, editing & fixing problems with skins
User avatar
manhti14
Posts: 4
Joined: May 6th, 2019, 9:12 am

Does it possible to make @IncludeMeters work with #CURRENTFILE#

Post by manhti14 »

I have a skin like this, and i want to load 10~20 skin at the same time.
Sometimes it needs to change Meter setting, but if i change setting of meter by meter it'll be pain in the a..
I have use @IncludeMeters but it wont work with #CURRENTFILE# Image wont show, left click wont do any thing

Code: Select all

[Variables]
;Content
TextC=F
TextCT=
TextCB=
;show/hide
Shapehide=0
TextChide=0
TextCTBhide=0
IMGhide=1
;other
ShapeColor=158,158,158,200
TextColor=255,255,244
TextFont=UVN Thang Gieng
;test style: normal, Italic
TextStyle=Italic  
TextS=1
FontW=550
ShapeD=20
ShapeS=1.5
LMUA=["#@#\Links\Daiwa#CURRENTFILE#.lnk"]
ImgName=#@#\Images\Daiwa\#CURRENTFILE#.png
=========
ShapeD2=(#ShapeD#*1.732)
ShapeS2=(#ShapeS#*0.95)
ShapeColor2=255,255,255,0
StrokeColor=66,241,244,255
StrokeW=(#ShapeD#*0.15)
IMGW=(#ShapeD2#*1.3*#ShapeS#)
TextSize=(#TextS#*#ShapeD#*#ShapeS#)
XX=(#ShapeD#*#ShapeS#*2)
YY=(#ShapeD#*#ShapeS#*2)

[MeterShape1]
Meter=Shape
X=(#XX#-(#ShapeD2#*#ShapeS#/2))
Y=(#YY#-#ShapeD#*#ShapeS#)
Shape=Path MyPath| Extend MySharedModifiers| StrokeWidth 0
MyPath=(#ShapeD2#*#ShapeS#/2),0 | LineTo (#ShapeD2#*#ShapeS#),(#ShapeD#*#ShapeS#/2) | LineTo (#ShapeD2#*#ShapeS#),(#ShapeD#*#ShapeS#*1.5) | LineTo (#ShapeD2#*#ShapeS#/2),(#ShapeD#*#ShapeS#*2)| LineTo 0,(#ShapeD#*#ShapeS#*1.5)| LineTo 0,(#ShapeD#*#ShapeS#*0.5)
	| ClosePath 1
MySharedModifiers=Fill Color #ShapeColor# 
MouseOverAction=[!SetOption MeterShape0 HIDDEN "0"][!UpdateMeter MeterShape0][!Redraw]
MouseLeaveAction=[!SetOption MeterShape0 HIDDEN "1"][!UpdateMeter MeterShape0][!Redraw]
LeftMouseUpAction=#LMUA#
Hidden=#Shapehide#

[MeasureCond]
Measure=Calc
Formula=(#IMGhide#*1)
IfCondition=MeasureCond=0
IfTrueAction=[!SetOption Image Container "MeterShape1"]
IfFalseAction=[!SetOption Image Container "1"]

[Image]
Meter=Image
X =(-#IMGW#/2+#ShapeD2#*#ShapeS#/2)
Y =(-#IMGW#/2+#ShapeD#*#ShapeS#)
W = #IMGW#
ImageAlpha=255
ImageName=#ImgName#
Hidden=#IMGhide#
Container=1

[MeterShape0]
Meter=Shape
X=(#XX#-(#ShapeD2#/2))
Y=(#YY#-#ShapeD#/2)
Shape=Rectangle 0,0,#ShapeD2#,#ShapeD#| Extend MySharedModifiers
Shape2=Rectangle 0,0,#ShapeD2#,#ShapeD#| Extend MySharedModifiers| Rotate 60
Shape3=Rectangle 0,0,#ShapeD2#,#ShapeD#| Extend MySharedModifiers| Rotate 120
MySharedModifiers=Fill Color #ShapeColor2# | StrokeWidth #StrokeW# | Stroke Color #StrokeColor#
Shape4=Combine Shape | Union Shape2| Union Shape3| Scale #ShapeS2#,#ShapeS2#
Hidden=1

[Text Center]
Meter=String
X=(#XX#)
Y=#YY#
Text=#TextC#
FontFace=#TextFont#
FontColor=#textcolor#
FontSize=#TextSize#
FontWeight=#FontW#
StringStyle=#TextStyle#
StringAlign=CenterCenter
AntiAlias=1
Hidden=#TextChide#

[Text Top]
Meter=String
X=(#XX#-#TextSize#/10)
Y=(#YY#+#TextSize#/3)
Text=#TextCT#
FontFace=#TextFont#
FontColor=#textcolor#
FontSize=#TextSize#
FontWeight=#FontW#
StringStyle=#TextStyle#
StringAlign=CenterBottom
AntiAlias=1
Hidden=#TextCTBhide#

[Text Bottom]
Meter=String
X=(#XX#-#TextSize#/20)
Y=(#YY#)
Text=#TextCB#
FontFace=#TextFont#
FontColor=#textcolor#
FontSize=#TextSize#
FontWeight=#FontW#
StringStyle=#TextStyle#
StringAlign=CenterTop
AntiAlias=1
Hidden=#TextCTBhide#
Does it possible to make a skin just have Variables and the Meter will be load from another file.
Ex: Skin file have Variables like this, and all the Meter will be load from @Resources\Template.ini
Skin file:

Code: Select all

[Variables]
;Content
TextC=F
TextCT=
TextCB=
;show/hide
Shapehide=0
TextChide=0
TextCTBhide=0
IMGhide=1
;other
ShapeColor=158,158,158,200
TextColor=255,255,244
TextFont=UVN Thang Gieng
;test style: normal, Italic
TextStyle=Italic  
TextS=1
FontW=550
ShapeD=20
ShapeS=1.5
LMUA=["#@#\Links\Daiwa#CURRENTFILE#.lnk"]
ImgName=#@#\Images\Daiwa\#CURRENTFILE#.png
=========
ShapeD2=(#ShapeD#*1.732)
ShapeS2=(#ShapeS#*0.95)
ShapeColor2=255,255,255,0
StrokeColor=66,241,244,255
StrokeW=(#ShapeD#*0.15)
IMGW=(#ShapeD2#*1.3*#ShapeS#)
TextSize=(#TextS#*#ShapeD#*#ShapeS#)
XX=(#ShapeD#*#ShapeS#*2)
YY=(#ShapeD#*#ShapeS#*2)

;;;Meter load from @Resources\Template.ini ;;;;;
Template.ini file will have Meter settings.

Code: Select all

[MeterShape1]
Meter=Shape
X=(#XX#-(#ShapeD2#*#ShapeS#/2))
Y=(#YY#-#ShapeD#*#ShapeS#)
Shape=Path MyPath| Extend MySharedModifiers| StrokeWidth 0
MyPath=(#ShapeD2#*#ShapeS#/2),0 | LineTo (#ShapeD2#*#ShapeS#),(#ShapeD#*#ShapeS#/2) | LineTo (#ShapeD2#*#ShapeS#),(#ShapeD#*#ShapeS#*1.5) | LineTo (#ShapeD2#*#ShapeS#/2),(#ShapeD#*#ShapeS#*2)| LineTo 0,(#ShapeD#*#ShapeS#*1.5)| LineTo 0,(#ShapeD#*#ShapeS#*0.5)
	| ClosePath 1
MySharedModifiers=Fill Color #ShapeColor# 
MouseOverAction=[!SetOption MeterShape0 HIDDEN "0"][!UpdateMeter MeterShape0][!Redraw]
MouseLeaveAction=[!SetOption MeterShape0 HIDDEN "1"][!UpdateMeter MeterShape0][!Redraw]
LeftMouseUpAction=#LMUA#
Hidden=#Shapehide#

[MeasureCond]
Measure=Calc
Formula=(#IMGhide#*1)
IfCondition=MeasureCond=0
IfTrueAction=[!SetOption Image Container "MeterShape1"]
IfFalseAction=[!SetOption Image Container "1"]

[Image]
Meter=Image
X =(-#IMGW#/2+#ShapeD2#*#ShapeS#/2)
Y =(-#IMGW#/2+#ShapeD#*#ShapeS#)
W = #IMGW#
ImageAlpha=255
ImageName=#ImgName#
Hidden=#IMGhide#
Container=1

[MeterShape0]
Meter=Shape
X=(#XX#-(#ShapeD2#/2))
Y=(#YY#-#ShapeD#/2)
Shape=Rectangle 0,0,#ShapeD2#,#ShapeD#| Extend MySharedModifiers
Shape2=Rectangle 0,0,#ShapeD2#,#ShapeD#| Extend MySharedModifiers| Rotate 60
Shape3=Rectangle 0,0,#ShapeD2#,#ShapeD#| Extend MySharedModifiers| Rotate 120
MySharedModifiers=Fill Color #ShapeColor2# | StrokeWidth #StrokeW# | Stroke Color #StrokeColor#
Shape4=Combine Shape | Union Shape2| Union Shape3| Scale #ShapeS2#,#ShapeS2#
Hidden=1

[Text Center]
Meter=String
X=(#XX#)
Y=#YY#
Text=#TextC#
FontFace=#TextFont#
FontColor=#textcolor#
FontSize=#TextSize#
FontWeight=#FontW#
StringStyle=#TextStyle#
StringAlign=CenterCenter
AntiAlias=1
Hidden=#TextChide#

[Text Top]
Meter=String
X=(#XX#-#TextSize#/10)
Y=(#YY#+#TextSize#/3)
Text=#TextCT#
FontFace=#TextFont#
FontColor=#textcolor#
FontSize=#TextSize#
FontWeight=#FontW#
StringStyle=#TextStyle#
StringAlign=CenterBottom
AntiAlias=1
Hidden=#TextCTBhide#

[Text Bottom]
Meter=String
X=(#XX#-#TextSize#/20)
Y=(#YY#)
Text=#TextCB#
FontFace=#TextFont#
FontColor=#textcolor#
FontSize=#TextSize#
FontWeight=#FontW#
StringStyle=#TextStyle#
StringAlign=CenterTop
AntiAlias=1
Hidden=#TextCTBhide#
Last edited by eclectic-tech on May 13th, 2019, 4:05 am, edited 1 time in total.
Reason: Please use code tags. It is the </> symbol.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Does it possible to make @IncludeMeters work with #CURRENTFILE#

Post by balala »

manhti14 wrote: May 13th, 2019, 3:13 am Does it possible to make a skin just have Variables and the Meter will be load from another file.
Not sure I completely understood your desire, but at least if I'm not wrong, you want to store the meters into another file than the skins .ini file and load them from that file. Is this correct?
If it is, yeah, this can be done, you just have to include the file which contains the meters, into the skin. Add a following kind of option, exactly where you do want to place the meters: @IncludeMeters=#@#Template.ini.
For example, below I've copied your last code and have added the @IncludeMeters option to its end:

Code: Select all

[Variables]
;Content
TextC=F
TextCT=
TextCB=
;show/hide
Shapehide=0
TextChide=0
TextCTBhide=0
IMGhide=1
;other
ShapeColor=158,158,158,200
TextColor=255,255,244
TextFont=UVN Thang Gieng
;test style: normal, Italic
TextStyle=Italic  
TextS=1
FontW=550
ShapeD=20
ShapeS=1.5
LMUA=["#@#\Links\Daiwa#CURRENTFILE#.lnk"]
ImgName=#@#\Images\Daiwa\#CURRENTFILE#.png
=========
ShapeD2=(#ShapeD#*1.732)
ShapeS2=(#ShapeS#*0.95)
ShapeColor2=255,255,255,0
StrokeColor=66,241,244,255
StrokeW=(#ShapeD#*0.15)
IMGW=(#ShapeD2#*1.3*#ShapeS#)
TextSize=(#TextS#*#ShapeD#*#ShapeS#)
XX=(#ShapeD#*#ShapeS#*2)
YY=(#ShapeD#*#ShapeS#*2)

;;;Meter load from @Resources\Template.ini ;;;;;

@IncludeMeters=#@#Template.ini
Just two additions:
  • Usually it's amuch better idea to save the included files as .inc, not as .ini. That's why I'd save the Template.ini as Template.inc and would use that one, replacing the @IncludeMeters=#@#Template.ini option with @IncludeMeters=#@#Template.inc.
  • Although not completely forbidden, nor a good idea is to use spaces into the names of different section, whatever those sections are. For example in your first code I'd replace the [Text Center], [Text Top] and so on names with [TextCenter], [TextTop]... This will avoid a lot of headaches in the future...
User avatar
manhti14
Posts: 4
Joined: May 6th, 2019, 9:12 am

Re: Does it possible to make @IncludeMeters work with #CURRENTFILE#

Post by manhti14 »

Thanks for your help.
Another thing came up in my mind.
Does it possible to include meter from other file to meter, then arrange that by X and Y.
That's be easier to arrange multi skin.

Example:

Code: Select all

[Meter1]
X=10
Y=10
@IncludeMeters=#@#Meter1.ini

[Meter2]
X=10
Y=20
@IncludeMeters=#@#Meter2.ini
Meter1 and Meter2 will be a skin like below, just a Hexagon with diffirent option.

Code: Select all

[Variables]
;;some Variables

;;;Meter load from @Resources\Template.ini ;;;;;
@IncludeMeters=#@#Template.ini
Sorry for my bad english.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Does it possible to make @IncludeMeters work with #CURRENTFILE#

Post by balala »

manhti14 wrote: May 15th, 2019, 9:33 am Thanks for your help.
Did it help?
manhti14 wrote: May 15th, 2019, 9:33 am Another thing came up in my mind.
Does it possible to include meter from other file to meter, then arrange that by X and Y.
That's be easier to arrange multi skin.

Example:

Code: Select all

[Meter1]
X=10
Y=10
@IncludeMeters=#@#Meter1.ini

[Meter2]
X=10
Y=20
@IncludeMeters=#@#Meter2.ini
Meter1 and Meter2 will be a skin like below, just a Hexagon with diffirent option.

Code: Select all

[Variables]
;;some Variables

;;;Meter load from @Resources\Template.ini ;;;;;
@IncludeMeters=#@#Template.ini
Sorry for my bad english.
Not sure I can follow.
Both Meter1.ini and Meter2.ini has the same code, including Template.ini?
Additionally note that if you're including a .ini (or a .inc) file, you can't include just some meters / measures of it, the whole code is included. If you want to include just some meters, you have to split the file, saving the meters which you want to include into one file and the others into another. Then you can include just the file containing the appropriate meters.
However as I said, I'm not sure this is what you need. Some details would be needed.