It is currently April 18th, 2024, 4:49 pm

Dynamic meter/measure names?

Get help with creating, editing & fixing problems with skins
edweerdt
Posts: 2
Joined: February 19th, 2019, 9:45 am

Dynamic meter/measure names?

Post by edweerdt »

For a webservice version skin I have set up a BaseStyle.inc and per used environment an .ini file which I include in the main.ini. Everything works fine but I would like it a bit more flexible. Now all the names of the meters and measures are in each .ini. So I have a ST1.ini where everything is named [MeasureST1], [MeterVersionST1] and so on. Adding a new environment means replacing everthing ST1 with e.g. ST2. Is it somehow possible to use a variable for meter/measure names? So I just change the variable env=ST1 to ST2.

I have tried [Measure#env#] but this doesn't work.
I've tried MeasureName=Measure#env#.

What is the best way to make this a bit more dynamic? How to make everything unique?
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Dynamic meter/measure names?

Post by balala »

edweerdt wrote: February 19th, 2019, 10:46 am For a webservice version skin I have set up a BaseStyle.inc and per used environment an .ini file which I include in the main.ini. Everything works fine but I would like it a bit more flexible. Now all the names of the meters and measures are in each .ini. So I have a ST1.ini where everything is named [MeasureST1], [MeterVersionST1] and so on. Adding a new environment means replacing everthing ST1 with e.g. ST2. Is it somehow possible to use a variable for meter/measure names? So I just change the variable env=ST1 to ST2.

I have tried [Measure#env#] but this doesn't work.
I've tried MeasureName=Measure#env#.

What is the best way to make this a bit more dynamic? How to make everything unique?
Both are working, for example into a meter of one skin. And you even can set dynamically the env variable.
For example:

Code: Select all

[Variables]
env=1

[MeasureST0]
Measure=Calc
Formula=10

[MeasureST1]
Measure=Calc
Formula=23

[Meter]
Meter=STRING
MeasureName=MeasureST#env#
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1 / [MeasureST#env#]
DynamicVariables=1
LeftMouseUpAction=[!SetVariable env "(1-#env#)"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
But when you're writing the measures and meters of your skin, you have to write them as they are. You can't use variables in the names. For example you can't have such a measure:

Code: Select all

[MeasureST#env#]
Measure=Calc
Formula=#env#
DynamicVariables=1
then somehow dynamically set the env variable, to have more similar measures. This isn't possible. You have to explicitly write each measure, one by one.
edweerdt
Posts: 2
Joined: February 19th, 2019, 9:45 am

Re: Dynamic meter/measure names?

Post by edweerdt »

My search ends with your answer. Thank you for your time and reply.
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Dynamic meter/measure names?

Post by balala »