It is currently March 9th, 2021, 10:42 am

[Suggestion] Assigning a number to a meter

Report bugs with the Rainmeter application and suggest features.
User avatar
Cariboudjan
Posts: 131
Joined: May 12th, 2019, 8:55 am

[Suggestion] Assigning a number to a meter

Post by Cariboudjan »

I would love, love, love if authors could assign a number to a meter. I see a lot of skins using [1] [2] [3] as Section Names to facilitate this with #CURRENTSECTION#, but it would be easier and more versatile if the section name did not did need to be a number to accomplish this.

For example, instead of...

Code: Select all

[1]

[2]

[3]

[MeasureName1]

[MeasureName2]

[MeasureName3]
We could start seeing...

Code: Select all

[MeterName1]
AssignedValue=1

[MeterName2]
AssignedValue=2

[MeterName3]
AssignedValue=3


[MeasureName1]
AssignedValue=1

[MeasureName2]
AssignedValue=2

[MeasureName3]
AssignedValue=3
And then instead of using #CURRENTSECTION# to get the number, maybe a variable like #CURRENTVALUE# that would be equal to that section's "AssignedValue" instead of its section name...

If this were an option I could use styles to cut the work for some of my skins in half, and probably reduce the number of lines in some configs by upwards of 80% using styles and nested variables.
Screenshot 2021-02-08 235542.png
You do not have the required permissions to view the files attached to this post.
User avatar
Jeff
Posts: 190
Joined: September 3rd, 2018, 11:18 am

Re: [Suggestion] Assigning a number to a meter

Post by Jeff »

I feel like at the moment this problem could be solved with Lua, you just need a little bit of

Code: Select all

function PullOption(section, name, key)
	if section = 'Meter' then m = SKIN:GetMeter(name)
	elseif section = 'Measure' then m = SKIN:GetMeasure(name)
	else print("We're both stupid or you did something wrong")
	end
	return m:GetOption(key, '0')
end
and because Rainmeter STILL doesn't allow for user defined options, you can use Group instead, pull out the Inline Lua and [&Script:PullOption('Measure', 'TheStringMeasure', 'Group')] (you also have a good advantage with this cause you can use #CurrentSection#)