Page 3 of 6

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:12 pm
by Yincognito
Active Colors wrote: June 30th, 2021, 2:02 pmdeath.crafter,
Before this issue is fixed you can add one extra bang to MeterStyle and one extra "buffer" variable and have it working
Isn't that more or less the same as using the #CURRENTSECTION# literal or direct inline Lua syntax (without any buffer, custom variables, and such) though? :???:

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:20 pm
by Active Colors
Yincognito wrote: June 30th, 2021, 2:12 pm Isn't that more or less the same as using the #CURRENTSECTION# literal or direct inline Lua syntax (without any buffer, custom variables, and such) though? :???:
But then death.crafter could use direct Inline Lua from the beginning?
It is the same thing as Inline Lua in a bang but also it is the same thing as death.crafter wanted to have it in a variable.
(And this looks much tidy in my opinion :))

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:25 pm
by Yincognito
Active Colors wrote: June 30th, 2021, 2:20 pm Same thing as Inline Lua but without the Inline Lua in the bang sequence. This looks much tidy in my opinion :)
If you say so... character counting says otherwise. But anyway, it was just something I noticed, don't mind my view on it. :thumbup:
P.S. One other difference is that inline syntax always works, from what I could see.

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:32 pm
by death.crafter
Okay now the variable parsing thing is going out of hands:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
String=Meter5

Type=0

Text00=#*CURRENTSECTION*#
Text01=[#*CURRENTSECTION*]

Text10=#*String*#
Text11=[#*String*]

[MeterStyle]
Text=[#Text0[#Type]]
Y=5R
AntiAlias=1
FontSize=14
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!Log "[#Text0[#Type]]"]
RightMouseUpAction=[!SetVariable Type "(1 - #Type#)"][!Update][!Redraw]

[MeterStyle2]
Text=[#Text1[#Type]]
Y=5R
AntiAlias=1
FontSize=14
SolidColor=00ffff
DynamicVariables=1
LeftMouseUpAction=[!Log "[#Text1[#Type]]"]
RightMouseUpAction=[!SetVariable Type "(1 - #Type#)"][!Update][!Redraw]

[Meter1]
Meter=String
MeterStyle=MeterStyle
[Meter2]
Meter=String
MeterStyle=MeterStyle2
The normal variables are not even parsed. Right click to change between types.
Screenshot 2021-06-30 200849.png
Screenshot 2021-06-30 200830.png

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:36 pm
by death.crafter
Active Colors wrote: June 30th, 2021, 2:20 pm But then death.crafter could use direct Inline Lua from the beginning?
It is the same thing as Inline Lua in a bang but also it is the same thing as death.crafter wanted to have it in a variable.
(And this looks much tidy in my opinion :))
Yincognito wrote: June 30th, 2021, 2:12 pm Isn't that more or less the same as using the #CURRENTSECTION# literal or direct inline Lua syntax (without any buffer, custom variables, and such) though? :???:
Thank you both for putting in your time and patience.
ActiveColors's way would be useful if I have a number of meter styles where a user wants to use a long long inline lua line as a mouse action. If you have a few and a rather short inline then you can go for literal implementation of the inline in MeterStyle.

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:53 pm
by Active Colors
Yincognito wrote: June 30th, 2021, 2:25 pm If you say so... character counting says otherwise. But anyway, it was just something I noticed, don't mind my view on it. :thumbup:
I understand you. For me, if you have multiple direct inline lua it will quickly become hard to read lines. It is quite subjective. For me this takes more time to work with something like this:
2.PNG

You can further make my code from the previous message simpler:

Code: Select all

[Variables]
Buffer=Meter5
LMUA=([&Lua:Index('[#*Buffer*]')])
!Buffer=!SetVariable Buffer 

[StyleMeter]
LeftMouseUpAction=[#!Buffer# #CURRENTSECTION#][!Update][!SetVariable Example "#LMUA#"][!Log "Example: [#Example] | LMUA: #LMUA#"]

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 2:56 pm
by Yincognito
death.crafter wrote: June 30th, 2021, 2:32 pmOkay now the variable parsing thing is going out of hands...
It's the same issue as before: an escaped [#*CURRENTSECTION*] in a bang. Doesn't matter in how many nesting levels / variables you put it. It won't work.

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 3:00 pm
by Yincognito
Active Colors wrote: June 30th, 2021, 2:53 pmBut if you have multiple direct inline lua it will quickly become hard to read lines. It is quite subjective though. For me this takes more time to work with something like this [...]
You can further make my code from the previous message simpler [...]
You're right. By the way, I might just use a tweaked version of your buffer variable to make the "old" direct #CURRENTSECTIONINDEX# work. Still weighing in which approach is easier.

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 3:12 pm
by death.crafter
Yincognito wrote: June 30th, 2021, 2:56 pm It's the same issue as before: an escaped [#*CURRENTSECTION*] in a bang. Doesn't matter in how many nesting levels / variables you put it. It won't work.
You think so? I beg to differ.

While with

Code: Select all

[Variables]
Text=[#*CURRENTSECTION*]

[String]
Text=[#Text]
it displays String but with

Code: Select all

[Variables]
Text=#*CURRENTSECTION*#

[String]
Text=[#Text]
it displays #CURRENTSECTION#.

And it's not used in a bang.

Re: [BUG?] in Multiple usage of #CURRENTSECTION#

Posted: June 30th, 2021, 3:27 pm
by Active Colors
Yincognito wrote: June 30th, 2021, 2:25 pm P.S. One other difference is that inline syntax always works, from what I could see.
Ah yeah, fair enough, this is unbeatable :D

Off-topic:
Yincognito wrote: June 30th, 2021, 3:00 pm By the way, I might just use a tweaked version of your buffer variable to make the "old" direct #CURRENTSECTIONINDEX# work. Still weighing in which approach is easier.
First of all I am thinking to reduce it down to #INDEX# just like death.crafter has done to make it shorter and faster to read :D

The Buffer method is actually very similar to what I've done before with faking a bang https://forum.rainmeter.net/viewtopic.php?f=14&t=36895&start=30#p190370

I have been trying to weight which way to use as well. So far it is:

either Buffer method:

Code: Select all

[Variables]
Buffer=
INDEX=[&CSI:SectionIndex('[#*Buffer*]','last','(<x>)')]
!Buffer=!SetVariable Buffer

[Meter]
MouseOverAction=[#!Buffer# #CURRENTSECTION#][!Log #INDEX#]
or Split method:

Code: Select all

[Variables]
GET=[&CSI:SectionIndex('
INDEX=','last','(<x>)')]

[Meter]
MouseOverAction=[!Log "[#GET][#CURRENTSECTION][#INDEX]"]