It is currently September 21st, 2021, 4:43 pm

Using Measure Bangs [solution found]

Help with creating, editing & fixing problems with skins
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Using Measure Bangs [solution found]

Post by CodeCode »

Hello, on this topic, there is a lot of documentation in the manual.
However, there is something I would like to implement, but I am not sure if it is possible or not. Is this form or similar possible to work, or not?

Code: Select all

[MeasureTri]
Measure=Calc
IfCondition=(aState = 0)
IfTrueAction=[!HideMeter "MeterText"][!Update]
IfCondition2=(aState = 1)
IfTrueAction2=[!ShowMeter "MeterText"][!Update]
IfConditionMode=1
Then this...?

Code: Select all

...
MouseOverAction=[!ToggleMeasure "MeasureTri"][!Update]
I m trying this to test a variable state of aState to show or hide a text meter, on mouseover or mouseleave.

I am thinking there are a few possibilities: !UpdateMeasure / !CommandMeasure / !ToggleMeasure.

But am I doing it wrong in every way possible, as in this concept is not possible? Or just wrong and such and such will do the job here?
Last edited by CodeCode on July 25th, 2021, 2:28 pm, edited 1 time in total.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

CodeCode wrote: July 25th, 2021, 11:52 am Hello, on this topic, there is a lot of documentation in the manual.
However, there is something I would like to implement, but I am not sure if it is possible or not. Is this form or similar possible to work, or not?

Code: Select all

[MeasureTri]
Measure=Calc
IfCondition=(aState = 0)
IfTrueAction=[!HideMeter "MeterText"][!Update]
IfCondition2=(aState = 1)
IfTrueAction2=[!ShowMeter "MeterText"][!Update]
IfConditionMode=1
Then this...?

Code: Select all

...
MouseOverAction=[!ToggleMeasure "MeasureTri"][!Update]
I m trying this to test a variable state of aState to show or hide a text meter, on mouseover or mouseleave.

I am thinking there are a few possibilities: !UpdateMeasure / !CommandMeasure / !ToggleMeasure.

But am I doing it wrong in every way possible, as in this concept is not possible? Or just wrong and such and such will do the job here?
I'm not sure I follow the logic. If you "hide" a meter on MouseOverAction, that has two consequences. First, it is now hidden, and will never respond to a MouseOverAction again while it is hidden. Second, if you try to remedy that by having a MouseLeaveAction that "unhides" it, that action will instantly be triggered when the meter is hidden, as hiding the meter means the mouse is no longer "on" it, and the MouseLeaveAction just fires.

I think you need a different logic to come at this.

You can use this to test all the undesirable behaviors:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!HideMeter "MeterText"][!UpdateMeter *][!Redraw]
IfCondition2=(#aState# = 1)
IfTrueAction2=[!ShowMeter "MeterText"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
DynamicVariables=1
MouseOverAction=[!SetVariable aState (1-#aState#)][!UpdateMeasure MeasureTri]
MouseLeaveAction=[!SetVariable aState (1-#aState#)][!UpdateMeasure MeasureTri]
Basically, you don't want the trigger to toggle the visibility of a meter to be on the meter itself. You need the trigger to be somewhere else. Either that, or don't "hide" the meter, but set its opacity to "1", which means it will be "invisible" for all practical purposes, but will still react to the mouse.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

Sorry, I wasn't clear on my intended functionality.

There is a TextMeter, and there is an ImageMeter. They are not in the same space in the skin's visible or invisible state.

I was thinking a way to test the variable state, which is managed by (lol?) MouseScrollUp/Down/Action.

At any given time there are many "buttons" which are images. One of them Hides the Text Meter on MouseOver, and the text stays hidden at this point.

So,
if the scroll aState=0 the text meter will not show on mouseover of a certain number of buttons
if the scroll aState=1 the text meter will show on mouse over of the same certain number of buttons.

Explanation:
The scroll action shows or hides a group of meters, including the text meter. The mouse over cannot toggle Show if aState=0. But if aState=1 the text meter will show on mouse over.

Maybe that makes more sense?
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

Something like this perhaps:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1
Opacity=255

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 0)
IfTrueAction=[!SetVariable Opacity "1"][!UpdateMeter *][!Redraw]
IfCondition2=(#aState# = 1)
IfTrueAction2=[!SetVariable Opacity "255"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,#Opacity#
SolidColor=47,47,47,#Opacity#
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
DynamicVariables=1
MouseOverAction=[!SetVariable aState (1-#aState#)][!UpdateMeasure MeasureTri]
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

Well the key to all this is [!SetVariable aState (1-#aState#)], which will toggle the value of the variable #aState# between 0 and 1.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

Ok, so this form seems like it should work if I understand correctly:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 1)
IfTrueAction=[!ShowMeter "MeterText"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
DynamicVariables=1
MouseOverAction=[!UpdateMeasure MeasureTri]
However in the view I an grasping at the [!UpdateMeasure MeasureTri] is actually the key to this working? But it does not show.
It really doesn't matter if #aState#=0 in this case. Nor does any MouseLeaveAction.
So if there is something obvious (it usually is with me) I am not doing, please correct the above.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

CodeCode wrote: July 25th, 2021, 12:45 pm Ok, so this form seems like it should work if I understand correctly:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
aState=1

[MeasureTri]
Measure=Calc
IfCondition=(#aState# = 1)
IfTrueAction=[!ShowMeter "MeterText"][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=-1

[MeterText]
Meter=String
FontSize=15
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
Text=Hello World
DynamicVariables=1
MouseOverAction=[!UpdateMeasure MeasureTri]
However in the view I an grasping at the [!UpdateMeasure MeasureTri] is actually the key to this working? But it does not show.
It really doesn't matter if #aState#=0 in this case. Nor does any MouseLeaveAction.
So if there is something obvious (it usually is with me) I am not doing, please correct the above.
Nothing about that will ever change the value of the variable #aState# though... This entire thing just ensures that the meter [MeterText] is visible, which it already is, and never changes that.
User avatar
CodeCode
Posts: 634
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: Using Measure Bangs

Post by CodeCode »

The variable aState is handled with writekeyvalue in conjunction with setv5ariable using a leftmouseupaction.

In this test nothing actually changes, only the metertext will either show or not.

There is a separate button that hides metertext so I am just 'reshowing metertext' with this mouse over. Or trying to anyway.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

CodeCode wrote: July 25th, 2021, 12:51 pm The variable aState is handled with writekeyvalue in conjunction with setv5ariable using a leftmouseupaction.

In this test nothing actually changes, only the metertext will either show or not.

There is a separate button that hides metertext but that is irrelevant in this case.
Yeah, sorry, you have entirely lost me.
User avatar
jsmorley
Developer
Posts: 22288
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Using Measure Bangs

Post by jsmorley »

You CAN'T have a MouseOverAction on a "hidden" meter and expect it to do anything. The meter is a "singularity" when it is hidden, and you can't put the mouse over it.