diff --git a/Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua b/Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua index a58bf03..24e763f 100644 --- a/Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua +++ b/Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua @@ -1,4 +1,4 @@ --- LibAddonMenu-2.0 & its files © Ryan Lakanen (Seerah) -- +-- LibAddonMenu-2.0 & its files © Ryan Lakanen (Seerah) -- -- All Rights Reserved -- -- Permission is granted to use Seerah's LibAddonMenu-2.0 -- -- in your project. Any modifications to LibAddonMenu-2.0 -- @@ -7,7 +7,7 @@ --Register LAM with LibStub -local MAJOR, MINOR = "LibAddonMenu-2.0", 14 +local MAJOR, MINOR = "LibAddonMenu-2.0", 15 local lam, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not lam then return end --the same or newer version of this lib is already loaded into memory @@ -57,11 +57,7 @@ function lam:OpenToPanel(panel) zo_callLater(function() ZO_GameMenu_InGame.gameMenu.headerControls[locSettings]:SetOpen(true) SCENE_MANAGER:AddFragment(OPTIONS_WINDOW_FRAGMENT) - ZO_OptionsWindow_ChangePanels(lam.panelID) - if not lam.panelSubCategoryControl then - lam.panelSubCategoryControl = _G["ZO_GameMenu_InGameNavigationContainerScrollChildZO_GameMenu_SubCategory"..(lam.panelID + 1)] - end - ZO_TreeEntry_OnMouseUp(lam.panelSubCategoryControl, true) + KEYBOARD_OPTIONS:ChangePanels(lam.panelID) panel:SetHidden(false) end, 200) end @@ -184,10 +180,24 @@ end --Usage: -- addonID = "string"; the same string passed to :RegisterAddonPanel -- optionsTable = table; the table containing all of the options controls and their data +local UpdateOptionsTable + function lam:RegisterOptionControls(addonID, optionsTable) --optionsTable = {sliderData, buttonData, etc} + UpdateOptionsTable(optionsTable) addonToOptionsMap[addonID] = optionsTable end +UpdateOptionsTable = function(optionsTable) + for _, widgetData in ipairs(optionsTable) do + if widgetData.type == "submenu" then + UpdateOptionsTable(widgetData.controls) + end + if widgetData.tooltipText == nil then + widgetData.tooltipText = widgetData.tooltip + widgetData.tooltip = nil + end + end +end --INTERNAL FUNCTION --handles switching between LAM's Addon Settings panel and other panels in the Settings menu @@ -197,7 +207,7 @@ local dummyFunc = function() end local panelWindow = ZO_OptionsWindow local bgL = ZO_OptionsWindowBGLeft local bgR = ZO_OptionsWindowBGLeftBGRight -local function HandlePanelSwitching(panel) +local function HandlePanelSwitching(self, panel) if panel == lam.panelID then --our addon settings panel oldDefaultButton:SetCallback(dummyFunc) oldDefaultButton:SetHidden(true) @@ -231,7 +241,7 @@ local function CreateAddonSettingsPanel() lam.panelID = _G[controlPanelID] - ZO_PreHook("ZO_OptionsWindow_ChangePanels", HandlePanelSwitching) + ZO_PreHook(ZO_SharedOptions, "ChangePanels", HandlePanelSwitching) LAMSettingsPanelCreated = true end @@ -294,9 +304,10 @@ local function CreateAddonList() if self.currentlySelected then self.currentlySelected:SetHidden(false) end end) - list.controlType = OPTIONS_CUSTOM - list.panel = lam.panelID - + list.data = { + controlType = OPTIONS_CUSTOM, + panel = lam.panelID, + } ZO_OptionsWindow_InitializeControl(list) return list @@ -306,4 +317,3 @@ end --INITIALIZING CreateAddonSettingsPanel() CreateAddonList() - diff --git a/Libs/LibAddonMenu-2.0/controls/button.lua b/Libs/LibAddonMenu-2.0/controls/button.lua index 090a812..609c140 100644 --- a/Libs/LibAddonMenu-2.0/controls/button.lua +++ b/Libs/LibAddonMenu-2.0/controls/button.lua @@ -11,7 +11,7 @@ } ]] -local widgetVersion = 3 +local widgetVersion = 4 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("button", widgetVersion) then return end @@ -54,7 +54,7 @@ function LAMCreateControl.button(parent, buttonData, controlName) local button = control.button button:SetAnchor(isHalfWidth and CENTER or RIGHT) button:SetClickSound("Click") - button.tooltipText = buttonData.tooltip + button.data = { tooltipText = buttonData.tooltipText } button:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) button:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) button:SetHandler("OnClicked", function(self, ...) diff --git a/Libs/LibAddonMenu-2.0/controls/checkbox.lua b/Libs/LibAddonMenu-2.0/controls/checkbox.lua index b178043..9235a8b 100644 --- a/Libs/LibAddonMenu-2.0/controls/checkbox.lua +++ b/Libs/LibAddonMenu-2.0/controls/checkbox.lua @@ -12,7 +12,7 @@ } ]] -local widgetVersion = 5 +local widgetVersion = 6 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("checkbox", widgetVersion) then return end @@ -107,7 +107,6 @@ function LAMCreateControl.checkbox(parent, checkboxData, controlName) local control = wm:CreateTopLevelWindow(controlName or checkboxData.reference) control:SetParent(parent.scroll or parent) control:SetMouseEnabled(true) - control.tooltipText = checkboxData.tooltip control:SetHandler("OnMouseEnter", OnMouseEnter) control:SetHandler("OnMouseExit", OnMouseExit) control:SetHandler("OnMouseUp", function(control) diff --git a/Libs/LibAddonMenu-2.0/controls/colorpicker.lua b/Libs/LibAddonMenu-2.0/controls/colorpicker.lua index 42e8e25..69d453d 100644 --- a/Libs/LibAddonMenu-2.0/controls/colorpicker.lua +++ b/Libs/LibAddonMenu-2.0/controls/colorpicker.lua @@ -12,7 +12,7 @@ } ]] -local widgetVersion = 3 +local widgetVersion = 4 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("colorpicker", widgetVersion) then return end @@ -61,7 +61,6 @@ function LAMCreateControl.colorpicker(parent, colorpickerData, controlName) local control = wm:CreateTopLevelWindow(controlName or colorpickerData.reference) control:SetParent(parent.scroll or parent) control:SetMouseEnabled(true) - control.tooltipText = colorpickerData.tooltip control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) diff --git a/Libs/LibAddonMenu-2.0/controls/dropdown.lua b/Libs/LibAddonMenu-2.0/controls/dropdown.lua index 4ced295..39af220 100644 --- a/Libs/LibAddonMenu-2.0/controls/dropdown.lua +++ b/Libs/LibAddonMenu-2.0/controls/dropdown.lua @@ -14,7 +14,7 @@ } ]] -local widgetVersion = 5 +local widgetVersion = 6 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("dropdown", widgetVersion) then return end @@ -88,7 +88,6 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName) local control = wm:CreateTopLevelWindow(controlName or dropdownData.reference) control:SetParent(parent.scroll or parent) control:SetMouseEnabled(true) - control.tooltipText = dropdownData.tooltip control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) diff --git a/Libs/LibAddonMenu-2.0/controls/editbox.lua b/Libs/LibAddonMenu-2.0/controls/editbox.lua index 3b92ea0..140cbd7 100644 --- a/Libs/LibAddonMenu-2.0/controls/editbox.lua +++ b/Libs/LibAddonMenu-2.0/controls/editbox.lua @@ -13,7 +13,7 @@ } ]] -local widgetVersion = 4 +local widgetVersion = 5 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("editbox", widgetVersion) then return end @@ -64,7 +64,6 @@ function LAMCreateControl.editbox(parent, editboxData, controlName) control:SetParent(parent.scroll or parent) control:SetMouseEnabled(true) control:SetResizeToFitDescendents(true) - control.tooltipText = editboxData.tooltip control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) diff --git a/Libs/LibAddonMenu-2.0/controls/slider.lua b/Libs/LibAddonMenu-2.0/controls/slider.lua index d26f314..4366418 100644 --- a/Libs/LibAddonMenu-2.0/controls/slider.lua +++ b/Libs/LibAddonMenu-2.0/controls/slider.lua @@ -15,7 +15,7 @@ } ]] -local widgetVersion = 3 +local widgetVersion = 4 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("slider", widgetVersion) then return end @@ -77,7 +77,6 @@ function LAMCreateControl.slider(parent, sliderData, controlName) control:SetDimensions(510, 40) end control:SetMouseEnabled(true) - control.tooltipText = sliderData.tooltip control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) diff --git a/Libs/LibAddonMenu-2.0/controls/submenu.lua b/Libs/LibAddonMenu-2.0/controls/submenu.lua index 41e8402..0b6634b 100644 --- a/Libs/LibAddonMenu-2.0/controls/submenu.lua +++ b/Libs/LibAddonMenu-2.0/controls/submenu.lua @@ -6,7 +6,7 @@ reference = "MyAddonSubmenu" --(optional) unique global reference to control } ]] -local widgetVersion = 5 +local widgetVersion = 6 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("submenu", widgetVersion) then return end @@ -47,8 +47,8 @@ function LAMCreateControl.submenu(parent, submenuData, controlName) label:SetWrapMode(TEXT_WRAP_MODE_ELLIPSIS) label:SetText(submenuData.name) label:SetMouseEnabled(true) - if submenuData.tooltip then - label.tooltipText = submenuData.tooltip + if submenuData.tooltipText then + label.data = { tooltipText = submenuData.tooltipText } label:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) label:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) end diff --git a/Libs/LibAddonMenu-2.0/controls/texture.lua b/Libs/LibAddonMenu-2.0/controls/texture.lua index 8ce85de..80649d1 100644 --- a/Libs/LibAddonMenu-2.0/controls/texture.lua +++ b/Libs/LibAddonMenu-2.0/controls/texture.lua @@ -10,7 +10,7 @@ --add texture coords support? -local widgetVersion = 3 +local widgetVersion = 4 local LAM = LibStub("LibAddonMenu-2.0") if not LAM:RegisterWidget("texture", widgetVersion) then return end @@ -36,9 +36,9 @@ function LAMCreateControl.texture(parent, textureData, controlName) texture:SetDimensions(textureData.imageWidth, textureData.imageHeight) texture:SetTexture(textureData.image) - if textureData.tooltip then + if textureData.tooltipText then texture:SetMouseEnabled(true) - texture.tooltipText = textureData.tooltip + texture.data = { tooltipText = textureData.tooltipText } texture:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) texture:SetHandler("OnMouseEnter", ZO_Options_OnMouseExit) end diff --git a/Libs/LibStub/LibStub.lua b/Libs/LibStub/LibStub.lua index bfd96df..879d132 100644 --- a/Libs/LibStub/LibStub.lua +++ b/Libs/LibStub/LibStub.lua @@ -3,7 +3,7 @@ -- LibStub developed for World of Warcraft by above members of the WowAce community. -- Ported to Elder Scrolls Online by Seerah -local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 1 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! +local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! local LibStub = _G[LIBSTUB_MAJOR] local strformat = string.format @@ -24,7 +24,7 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then function LibStub:GetLibrary(major, silent) if not self.libs[major] and not silent then - error(("Cannot find a library instance of %q."):strformat(tostring(major)), 2) + error(strformat("Cannot find a library instance of %q.", tostring(major)), 2) end return self.libs[major], self.minors[major] end