As suggested by balala, here is a sample menu system that uses Meter Groups and has all the menu items in the same file.wolfnuka wrote: ↑January 13th, 2020, 10:04 pm sure, no problem:
...
what i am having issues with, is finding a way to hold the submenu items, and deactivate them and activate them as needed depending on the selected main menu icon, one way would be to put each submenu on a different .ini file, and activate them when the corresponding main menu icon is pressed, but then how to deactivate them as another main menu icon is pressed?
This eliminates the need to activate/deactivate multiple skins; everything is in 1 skin.
I used your "bar" images sections for the main menu and sub-menu areas (they should be Image Meters since Bar Meters require a MeasureName to work).
I removed your highlighting sections and use !SetOption to change the SolidColor of the main icons to highlight them when hovered.
I use the mouse leave on the [bar2] section to hide all sub-menus when the mouse leaves the background.
I created 3 groups of meters:
Group=Menu is all sub-menus and the sub-menu background ([bar2]); this is used to hide all sub-menus when an item is clicked or the mouse moves off the background. Notice that [Bar2] is a member in ALL 'Menu#' groups.
Group=Menu1 is the game menu items and bar2 background; it is visible when you click [Image1]
Group=Menu2 is the work items and bar2 background; it is visible when you click [Image2]
To add more menus, add another [Image#] main menu icon. And create a group 'Menu3' with the items you want to show in that sub-menu (the easiest way to create a new sub-menu is to copy a previous group of 'Menu#' meters and edit the group name, text or image, and the mouse actions).
Code: Select all
;================Menu items background=========================
[Bar2]
Group=Menu | Menu1 | Menu2
Meter=Image
W=250
H=(#SCREENAREAHEIGHT#-400)
SolidColor=241,241,241,90
Hidden=1
MouseLeaveAction=[!HideMeterGroup Menu][!UpdateMeter *][!Redraw]
;================MAIN MENU BACKGROUND=========================
[Bar1]
Meter=Image
W=50
H=(#SCREENAREAHEIGHT#-400)
SolidColor=333333
;================MAIN MENU ICON PATH & SHORTCUTS ADDRESSES======
[Image1]
Meter=Image
ImageName=buttonr
;Joystick
H=35
W=35
x=9
y=2r
SolidColor=0,0,0,1
LeftMouseUpAction=[!HideMeterGroup Menu][!ToggleMeterGroup Menu1][!UpdateMeter *][!Redraw]
MouseOverAction=[!SetOption #CurrentSection# SolidColor "160,160,160,160"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CurrentSection# SolidColor "160,160,160,1"][!UpdateMeter *][!Redraw]
ToolTipText="Gaming"
[Image2]
Meter=Image
ImageName=buttong
;Joystick
H=35
W=35
x=r
y=2R
SolidColor=0,0,0,1
LeftMouseUpAction=[!HideMeterGroup Menu][!ToggleMeterGroup Menu2][!UpdateMeter *][!Redraw]
MouseOverAction=[!SetOption #CurrentSection# SolidColor "160,160,160,160"][!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CurrentSection# SolidColor "160,160,160,1"][!UpdateMeter *][!Redraw]
ToolTipText="Work"
;================MENU1 ITEMS======
[Menu1.1]
Group=Menu | Menu1
Meter=String
X=52
Y=[Image1:Y]
FontSize=14
Text="Game1"
Hidden=1
DynamicVariables=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game1 clicked."]
[Menu1.2]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game2"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game2 clicked."]
[Menu1.3]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game3"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game3 clicked."]
[Menu1.4]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game4"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game4 clicked."]
[Menu1.5]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game5"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game5 clicked."]
[Menu1.6]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game6"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game6 clicked."]
[Menu1.7]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game7"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game7 clicked."]
[Menu1.8]
Group=Menu | Menu1
Meter=String
X=r
Y=2R
FontSize=14
Text="Game8"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Game8 clicked."]
;================MENU2 ITEMS======
[Menu2.1]
Group=Menu | Menu2
Meter=String
X=52
Y=[Image1:Y]
FontSize=14
Text="Work1"
Hidden=1
DynamicVariables=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work1 clicked."]
[Menu2.2]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work2"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work2 clicked."]
[Menu2.3]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work3"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work3 clicked."]
[Menu2.4]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work4"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work4 clicked."]
[Menu2.5]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work5"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work5 clicked."]
[Menu2.6]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work6"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work6 clicked."]
[Menu2.7]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work7"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work7 clicked."]
[Menu2.8]
Group=Menu | Menu2
Meter=String
X=r
Y=2R
FontSize=14
Text="Work8"
Hidden=1
LeftMouseUpAction=[!HideMeterGroup Menu][!Log "Work8 clicked."]