Nilvarno wrote: ↑March 24th, 2019, 8:37 pm
Oh i got that now, in my mind they were the same. I wanted the menu to start hidden. The last code you gave me worked perfectly once i sat the menu parts to hidden=1
There is one more possibility, which usually I prefer much more than toggling (or showing / hiding) the meters. Here is a short description of this method, if you want to give it a try.
First you need a variable, which will control when the meters belonging to the menu will be shown. Let's name this variable Menu. Declare it in the [Variables] section (so, add a such section - usually at the beginning of the code, but finally you can add it anywhere):
Now we'll need a measure which will control when what is visible and what is hidden. Add it as well:
Code: Select all
[MeasureMenu]
Measure=Calc
Formula=#Menu#
IfCondition=(#CURRENTSECTION#>=1)
IfTrueAction=[!ShowMeterGroup "Skin"][!HideMeterGroup "Game1"][!HideMeterGroup "Game2"][!HideMeterGroup "Game3"][!HideMeterGroup "Multy1"][!HideMeterGroup "Emu1"][!Redraw]
IfFalseAction=[!HideMeterGroup "Skin"][!HideMeterGroup "Game1"][!HideMeterGroup "Game2"][!HideMeterGroup "Game3"][!HideMeterGroup "Multy1"][!HideMeterGroup "Emu1"][!Redraw]
DynamicVariables=1
Whenever the value of the Menu variable is toggling between 0 and 1, the menu will be hidden / shown.
You have to modify the KeyDownAction option of the [MeasureToggle] measure, to get the value of the Menu variable toggled between the two needed values. Because the Menu variable is changing dynamically whenever you hitting the appropriate key or you click, a
DynamicVariables=1 option will also have to be added to the [MeasureToggle] measure. Don't forget it. The measure will look like:
Code: Select all
[MeasureToggle]
Measure=Plugin
Plugin=HotKey
HotKey=NUM0
KeyDownAction=[!SetVariable Menu "(1-#Menu#)"][!UpdateMeasure "#CURRENTSECTION#"][!UpdateMeasure "MeasureMenu"][!UpdateMeter "Base"]
DynamicVariables=1
Finally you also have to modify the LeftMouseUpAction option of the [Base] meter and as explained above, also have to add a
DynamicVariables=1 option:
Code: Select all
[Base]
Meter=image
SolidColor=255,0,0
X=0
Y=0
w=50
h=50
LeftMouseUpAction=[!SetVariable Menu "(1-#Menu#)"][!UpdateMeasure "MeasureToggle"][!UpdateMeasure "MeasureMenu"][!UpdateMeter "Base"]
DynamicVariables=1
This procedure has a great advantage: there is extremely easy to control if the meters are shown or hidden on refresh (or load). You simply just have to change the value of the Menu variable within the [Variables] section. Also there is no need to add any
Hidden=1 option, because the visibility of the meters is controlled by the [MeasureMenu] measure.
If you give a try and have questions, please feel free to come back.