Change Log:
--------------------
version 3.0.1:
- API bump 100025 "Murkmire".
Description:
--------------------
Description
Library to add main menu entries.
For example used in Potion Maker and Votan's Settings Menu and FCOItemSaver.
Example
local descriptor = "Unique Name" -- e.g. your addon name
-- this as part of the EVENT_ADD_ON_LOADED
local LMM2 = LibStub("LibMainMenu-2.0")
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
Force refresh of visibility:
LMM2:Refresh()
Click on the menu entry by code:
LMM2:SelectMenuItem(descriptor)
--------------------
version 3.0.1:
- API bump 100025 "Murkmire".
Description:
--------------------
Description
Library to add main menu entries.
For example used in Potion Maker and Votan's Settings Menu and FCOItemSaver.
Example
local descriptor = "Unique Name" -- e.g. your addon name
-- this as part of the EVENT_ADD_ON_LOADED
local LMM2 = LibStub("LibMainMenu-2.0")
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
Force refresh of visibility:
LMM2:Refresh()
Click on the menu entry by code:
LMM2:SelectMenuItem(descriptor)