It is currently April 23rd, 2024, 6:14 pm

Is there something such as #CURRENTSECTION#+1?

Get help with creating, editing & fixing problems with skins
Medallyon
Posts: 26
Joined: July 9th, 2013, 10:06 pm

Is there something such as #CURRENTSECTION#+1?

Post by Medallyon »

Heya

I was wondering if I could shorten my referencing in my skin by applying #CURRENSECTION#. At the moment I have 90 Meters that have to be referenced one by one, which each look like this:

Code: Select all

[1]
Meter=Image
MeterStyle=1Style
LeftMouseDownAction=[!SetOption i1 GreyScale 1][!UpdateMeter i1][!Redraw]
LeftMouseUpAction=[!SetOption i1 GreyScale 0][!UpdateMeter i1][!Redraw]["#GameLocation1#"]
MouseOverAction=[!SetOption i1 ImageTint 255,255,255,200][!UpdateMeter i1][!Redraw]
MouseLeaveAction=[!SetOption i1 ImageTint 255,255,255,255][!UpdateMeter i1][!Redraw]
RightMouseUpAction=[!ToggleConfig "WP7\PanelEdits\Games" "GameEdit1.ini"]
ToolTipTitle=#Game1#
ToolTipText=#GameToolTip1#

[i1]
Group=Image
Meter=Image
ImageName="#GameIcon1#"
X=r
Y=r
W=35
H=35
This works just as intended, but it's just way too much work to apply to 90 Meters.
I was wondering if I could, instead of this:

Code: Select all

[1]
LeftMouseDownAction=[!SetOption i1 GreyScale 1][!UpdateMeter i1][!Redraw]
LeftMouseUpAction=[!SetOption i1 GreyScale 0][!UpdateMeter i1][!Redraw]["#GameLocation1#"]
just do something like this to make my life easier:

Code: Select all

[1]
LeftMouseDownAction=[!SetOption i+#CURRENTSECTION# GreyScale 1][!UpdateMeter i+#CURRENTSECTION#][!Redraw]
LeftMouseUpAction=[!SetOption i+#CURRENTSECTION# GreyScale 0][!UpdateMeter i+#CURRENTSECTION#][!Redraw]["#GameLocation1#"]
or

Code: Select all

[1]
LeftMouseDownAction=[!SetOption #CURRENTSECTION#+1 GreyScale 1][!UpdateMeter #CURRENTSECTION#+1][!Redraw]
LeftMouseUpAction=[!SetOption #CURRENTSECTION#+1 GreyScale 0][!UpdateMeter #CURRENTSECTION#+1][!Redraw]["#GameLocation1#"]
Thanks in Advance,
Medallyon
Last edited by Medallyon on December 25th, 2014, 9:52 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16163
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there something such as #CURRENTSECTION#+1?

Post by balala »

Yes, you could, it's true that not exactly as you wrote your code. Try this:

Code: Select all

[1]
LeftMouseDownAction=[!SetOption i#CURRENTSECTION# GreyScale 1][!UpdateMeter i#CURRENTSECTION#][!Redraw]
LeftMouseUpAction=[!SetOption i#CURRENTSECTION# GreyScale 0][!UpdateMeter i#CURRENTSECTION#][!Redraw]["#GameLocation1#"]
See that instead of i+#CURRENTSECTION# its used the i#CURRENTSECTION# expresion, that for someone who knows a bit of any programming language is something very strange. It was for me too a few years ago. But this is how it works in Rainmeter.
However, I'm not very sure it would help, because you still have to create those 90 meters. Maybe that this way is simpler to copy and paste them?
Medallyon
Posts: 26
Joined: July 9th, 2013, 10:06 pm

Re: Is there something such as #CURRENTSECTION#+1?

Post by Medallyon »

Yes!!
Thank you so much!

I know I still have to create them, but certain parts are simply really easy to copy & paste now, and not having to replace each and every single i1, i2, i3 up to i90 is making me happy.

Thanks,
Medallyon