Go to Page... |
Compatibility: | Flames of Ambition (6.3.5) Markarth (6.2.5) |
Updated: | 04/12/21 10:54 AM |
Created: | 08/30/18 11:49 AM |
Monthly downloads: | 12,352 |
Total downloads: | 2,067,674 |
Favorites: | 1,183 |
MD5: |
## DependsOn: LibMainMenu-2.0 |
local LMM = LibMainMenu2
local descriptor = "Unique Name" -- e.g. your addon name -- this as part of the EVENT_ADD_ON_LOADED local LMM2 = LibMainMenu2 LMM2:Init() local sceneName = "gameMenuInGame" -- Your scene name. This is just a working example. -- Add to main menu local categoryLayoutInfo = { binding = "YOUR_KEYBIND_ACTION_NAME", categoryName = SI_BINDING_NAME_YOUR_KEYBIND_ACTION_NAME, callback = function(buttonData) if not SCENE_MANAGER:IsShowing(sceneName) then SCENE_MANAGER:Show(sceneName) else SCENE_MANAGER:ShowBaseScene() end end, visible = function(buttonData) return true end, normal = "esoui/art/inventory/inventory_tabicon_consumables_up.dds", pressed = "esoui/art/inventory/inventory_tabicon_consumables_down.dds", highlight = "esoui/art/inventory/inventory_tabicon_consumables_over.dds", disabled = "esoui/art/inventory/inventory_tabicon_consumables_disabled.dds", } LMM2:AddMenuItem(descriptor, sceneName, categoryLayoutInfo, nil) -- end part of the EVENT_ADD_ON_LOADED
LMM2:Refresh()
LMM2:SelectMenuItem(descriptor)
local menuIndex = LMM:MainMenuAddCategory(arrayOfCategoryData) LMM:MainMenuAddSceneGroup(menuIndex, GroupSceneString, iconData)
-- Toggle LMM:ToggleCategory(menuIndex) -- Specific scene LMM:Update(menuIndex, "MyAddonAnotherScene")
binding = stringOfYourKeyBinding categoryName = stringOfCategoryName normal = texturePath pressed = texturePath highlight = texturePath |
MYADDON_MAIN_MENU_CATEGORY_DATA = { binding = "MYADDON_SHOW_PANEL", categoryName = SI_MYADDON_MAIN_MENU_TITLE, normal = "EsoUI/Art/MainMenu/menuBar_champion_up.dds", pressed = "EsoUI/Art/MainMenu/menuBar_champion_down.dds", highlight = "EsoUI/Art/MainMenu/menuBar_champion_over.dds", }
categoryName = string descriptor = integer normal = texturePath pressed = texturePath highlight = texturePath |
local iconData = { { categoryName = SI_MYADDON_MAIN_MENU_TITLE, -- the title at the right (near the buttons) descriptor = "MyAddonMain", normal = "EsoUI/Art/MainMenu/menuBar_champion_up.dds", pressed = "EsoUI/Art/MainMenu/menuBar_champion_down.dds", highlight = "EsoUI/Art/MainMenu/menuBar_champion_over.dds", }, { categoryName = SI_MYADDON_ANOTHER_MENU_TITLE, -- the title at the right (near the buttons) visible = function() return IsChampionSystemUnlocked() end, -- is tab visible ? descriptor = "MyAddonAnother", normal = "EsoUI/Art/Guild/tabicon_history_up.dds", pressed = "EsoUI/Art/Guild/tabicon_history_down.dds", highlight = "EsoUI/Art/Guild/tabicon_history_over.dds", }, } -- Register the group and add the buttons LMM:MainMenuAddSceneGroup(menuIndex, "MyAddonSceneGroup", iconData)
<GuiXml> <Controls> <TopLevelControl name="MyUINameInXML" inherits="ZO_RightPanelFootPrint" hidden="true"> <OnInitialized> MyAddon.initData(self) </OnInitialized> <Controls> </Controls> </TopLevelControl> </Controls> </GuiXml>
function MyAddon.CreateScene() -- Main Scene MYADDON_MAIN_SCENE = ZO_Scene:New("MyAddonMain", SCENE_MANAGER) -- Mouse standard position and background MYADDON_MAIN_SCENE:AddFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW) MYADDON_MAIN_SCENE:AddFragmentGroup(FRAGMENT_GROUP.FRAME_TARGET_STANDARD_RIGHT_PANEL) -- Background Right, it will set ZO_RightPanelFootPrint and its stuff. MYADDON_MAIN_SCENE:AddFragment(RIGHT_BG_FRAGMENT) -- The title fragment MYADDON_MAIN_SCENE:AddFragment(TITLE_FRAGMENT) -- Set Title ZO_CreateStringId("SI_MYADDON_MAIN_MENU_TITLE", "My Addon Name") MYADDON_MAIN_TITLE_FRAGMENT = ZO_SetTitleFragment:New(SI_MYADDON_MAIN_MENU_TITLE) MYADDON_MAIN_SCENE:AddFragment(MYADDON_MAIN_TITLE_FRAGMENT) -- Add the XML to our scene MYADDON_MAIN_WINDOW = ZO_FadeSceneFragment:New(MyUINameInXML) MYADDON_MAIN_SCENE:AddFragment(MYADDON_MAIN_WINDOW) end
-- Build the Menu -- Its name for the menu (the meta scene) ZO_CreateStringId("SI_MYADDON_MAIN_MENU_TITLE", "My Addon Name") -- Its infos, ZO_CreateStringId("SI_BINDING_NAME_MYADDON_SHOW_PANEL", "Toggle My Addon") -- you also need to use a bindings.xml in order to display your keybind in options. MYADDON_MAIN_MENU_CATEGORY_DATA = { binding = "MYADDON_SHOW_PANEL", categoryName = SI_MYADDON_MAIN_MENU_TITLE, normal = "EsoUI/Art/MainMenu/menuBar_champion_up.dds", pressed = "EsoUI/Art/MainMenu/menuBar_champion_down.dds", highlight = "EsoUI/Art/MainMenu/menuBar_champion_over.dds", } -- Then the scenes -- Main Scene is created trought our function described in 1st section MyAddon.CreateScene() -- Another Scene , because using main menu without having 2 scenes should be avoided. MYADDON_ANOTHER_SCENE = ZO_Scene:New("MyAddonAnother", SCENE_MANAGER) -- Mouse standard position and background MYADDON_ANOTHER_SCENE:AddFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW) MYADDON_ANOTHER_SCENE:AddFragmentGroup(FRAGMENT_GROUP.FRAME_TARGET_STANDARD_RIGHT_PANEL) -- Background Right, it will set ZO_RightPanelFootPrint and its stuff. MYADDON_ANOTHER_SCENE:AddFragment(RIGHT_BG_FRAGMENT) -- The title fragment MYADDON_ANOTHER_SCENE:AddFragment(TITLE_FRAGMENT) -- Set Title ZO_CreateStringId("SI_MYADDON_IMPORT_MENU_TITLE", "Another title") MYADDON_ANOTHER_TITLE_FRAGMENT = ZO_SetTitleFragment:New(SI_MYADDON_MAIN_MENU_TITLE) -- The title at the left of the scene is the "global one" but we can change it MYADDON_ANOTHER_SCENE:AddFragment(MYADDON_ANOTHER_TITLE_FRAGMENT) -- Add the XML to our scene MYADDON_ANOTHER_WINDOW = ZO_FadeSceneFragment:New(AnotherPieceofXML) MYADDON_ANOTHER_SCENE:AddFragment(MYADDON_ANOTHER_WINDOW) -- Set tabs and visibility, etc do local iconData = { { categoryName = SI_MYADDON_MAIN_MENU_TITLE, -- the title at the right (near the buttons) descriptor = "MyAddonMain", normal = "EsoUI/Art/MainMenu/menuBar_champion_up.dds", pressed = "EsoUI/Art/MainMenu/menuBar_champion_down.dds", highlight = "EsoUI/Art/MainMenu/menuBar_champion_over.dds", }, { categoryName = SI_MYADDON_ANOTHER_MENU_TITLE, -- the title at the right (near the buttons) visible = function() return IsChampionSystemUnlocked() end, -- is tab visible ? descriptor = "MyAddonAnother", normal = "EsoUI/Art/Guild/tabicon_history_up.dds", pressed = "EsoUI/Art/Guild/tabicon_history_down.dds", highlight = "EsoUI/Art/Guild/tabicon_history_over.dds", }, } -- Register Scenes and the group name SCENE_MANAGER:AddSceneGroup("MyAddonSceneGroup", ZO_SceneGroup:New("MyAddonMain", "MyAddonAnother")) -- ZOS have hardcoded its categories, so here is LibMainMenu utility. MENU_CATEGORY_MYADDON = LMM:MainMenuAddCategory(MYADDON_MAIN_MENU_CATEGORY_DATA) -- Register the group and add the buttons LMM:MainMenuAddSceneGroup(MENU_CATEGORY_MYADDON, "MyAddonSceneGroup", iconData) end
-- Toggle LMM:ToggleCategory(MENU_CATEGORY_MYADDON)
-- Toggle LMM:Update(MENU_CATEGORY_MYADDON, "MyAddonAnother")
File Name |
Version |
Size |
Uploader |
Date |
4.3.6 |
2kB |
votan |
02/20/21 09:11 AM |
|
4.3.5 |
2kB |
votan |
11/01/20 08:58 AM |
|
4.3.4 |
2kB |
votan |
08/22/20 04:55 AM |
|
4.3.3 |
2kB |
votan |
05/24/20 10:39 AM |
|
4.3.2 |
2kB |
votan |
02/15/20 11:44 AM |
|
4.3.1 |
2kB |
votan |
10/19/19 08:27 AM |
|
4.3.0 |
2kB |
votan |
07/17/19 11:17 AM |
|
4.2.0 |
2kB |
votan |
06/01/19 09:32 AM |
|
4.1.0 |
2kB |
votan |
05/18/19 08:07 AM |
|
3.0.2 |
11kB |
votan |
02/23/19 10:15 AM |
|
3.0.1 |
3kB |
votan |
10/13/18 09:25 AM |
|
3.0 |
9kB |
votan |
08/30/18 11:49 AM |
Comment Options |
05/18/19, 09:58 AM | |
there is 2 version of this lib
Hervestmap is using Ayantir version 5 of this lib https://www.esoui.com/downloads/info...bMainMenu.html
So which is the good one ? is there not a risk of conflict ? Thank you |
|
|
Anceane |
View Public Profile |
Send a private message to Anceane |
Send email to Anceane |
Find More Posts by Anceane |
Add Anceane to Your Buddy List |
04/30/19, 10:54 AM | |
|
LibMainMenu-2.0 for PTS with stripped LibStub + added TXT file IsLibrray etc.
-> Global variable: Lua Code:
Edit - 2019-05-11 Updated and fixed to be compatible without LibStub and with it
Last edited by Baertram : 05/11/19 at 09:57 AM.
|
|
Baertram |
View Public Profile |
Send a private message to Baertram |
Send email to Baertram |
Find More Posts by Baertram |
Add Baertram to Your Buddy List |
votan |
View Public Profile |
Send a private message to votan |
Send email to votan |
Find More Posts by votan |
Add votan to Your Buddy List |
09/01/18, 05:17 PM | |
Forum posts: 1
File comments: 402
Uploads: 0
|
LibMainMenu-2.0 ..... Who needs it?
Which TESO players must download and install this "add-on"?? IMHO, the developers of the add-ons which use its functions should include it with the installation of their add-on.
ZOS (?) has added a Libraries category at the bottom of the list of addons. It evidently lists the "libraries" which are installed in the respective addon folders in the ...\Elder Scrolls \live\Addons folder. Unfortunately, I haven't been able to find any mention of it in the Patch Notes for Update 17, after which it appeared. What purpose does it serve? |
|
Shadowshire |
View Public Profile |
Send a private message to Shadowshire |
Send email to Shadowshire |
Find More Posts by Shadowshire |
Add Shadowshire to Your Buddy List |