Updated TOC and LibAddonMenu for 5.2

Jayden Platell [11-05-14 - 21:47]
Updated TOC and LibAddonMenu for 5.2
Filename
Librarian.txt
Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
Libs/LibAddonMenu-2.0/controls/button.lua
Libs/LibAddonMenu-2.0/controls/checkbox.lua
Libs/LibAddonMenu-2.0/controls/colorpicker.lua
Libs/LibAddonMenu-2.0/controls/dropdown.lua
Libs/LibAddonMenu-2.0/controls/editbox.lua
Libs/LibAddonMenu-2.0/controls/slider.lua
Libs/LibAddonMenu-2.0/controls/submenu.lua
Libs/LibAddonMenu-2.0/controls/texture.lua
diff --git a/Librarian.txt b/Librarian.txt
index af05049..c390f16 100644
--- a/Librarian.txt
+++ b/Librarian.txt
@@ -1,6 +1,6 @@
 ## Title: Librarian
 ## Author: Flamage
-## APIVersion: 100009
+## APIVersion: 100010
 ## SavedVariables: Librarian_SavedVariables
 ## OptionalDependsOn: LibAddonMenu-2.0

diff --git a/Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua b/Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
index 24e763f..1ab94cf 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", 15
+local MAJOR, MINOR = "LibAddonMenu-2.0", 16
 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,7 +57,12 @@ 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)
 			KEYBOARD_OPTIONS: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)
 			panel:SetHidden(false)
 		end, 200)
 end
@@ -180,24 +185,10 @@ 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
@@ -235,12 +226,20 @@ local function CreateAddonSettingsPanel()
 		local controlPanelID = "LAM_ADDON_SETTINGS_PANEL"
 		--Russian for TERAB1T's RuESO addon, which creates an "ru" locale
 		--game font does not support Cyrillic, so they are using custom fonts + extended latin charset
-		local controlPanelNames = {en = "Addon Settings", fr = "Extensions", de = "Erweiterungen", ru = "Îacòpoéêè äoïoìîeîèé"}
+		--Spanish provided by Luisen75 for their translation project
+		local controlPanelNames = {
+			en = "Addon Settings",
+			fr = "Extensions",
+			de = "Erweiterungen",
+			ru = "Îacòpoéêè äoïoìîeîèé",
+			es = "Configura Addons",
+		}

 		ZO_OptionsWindow_AddUserPanel(controlPanelID, controlPanelNames[GetCVar("Language.2")] or controlPanelName["en"])

 		lam.panelID = _G[controlPanelID]

+		--ZO_PreHook("ZO_OptionsWindow_ChangePanels", HandlePanelSwitching)
 		ZO_PreHook(ZO_SharedOptions, "ChangePanels", HandlePanelSwitching)

 		LAMSettingsPanelCreated = true
@@ -304,10 +303,13 @@ 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
@@ -317,3 +319,4 @@ end
 --INITIALIZING
 CreateAddonSettingsPanel()
 CreateAddonList()
+
diff --git a/Libs/LibAddonMenu-2.0/controls/button.lua b/Libs/LibAddonMenu-2.0/controls/button.lua
index 609c140..187e901 100644
--- a/Libs/LibAddonMenu-2.0/controls/button.lua
+++ b/Libs/LibAddonMenu-2.0/controls/button.lua
@@ -11,7 +11,7 @@
 }	]]


-local widgetVersion = 4
+local widgetVersion = 5
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("button", widgetVersion) then return end

@@ -54,7 +54,8 @@ function LAMCreateControl.button(parent, buttonData, controlName)
 	local button = control.button
 	button:SetAnchor(isHalfWidth and CENTER or RIGHT)
 	button:SetClickSound("Click")
-	button.data = { tooltipText = buttonData.tooltipText }
+	--button.tooltipText = buttonData.tooltip
+	button.data = {tooltipText = buttonData.tooltip}
 	button:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
 	button:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
 	button:SetHandler("OnClicked", function(self, ...)
@@ -67,7 +68,8 @@ function LAMCreateControl.button(parent, buttonData, controlName)
 	if buttonData.warning then
 		control.warning = wm:CreateControlFromVirtual(nil, control, "ZO_Options_WarningIcon")
 		control.warning:SetAnchor(RIGHT, button, LEFT, -5, 0)
-		control.warning.tooltipText = buttonData.warning
+		--control.warning.tooltipText = buttonData.warning
+		control.warning.data = {tooltipText = buttonData.warning}
 	end

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
diff --git a/Libs/LibAddonMenu-2.0/controls/checkbox.lua b/Libs/LibAddonMenu-2.0/controls/checkbox.lua
index 9235a8b..a777c7d 100644
--- a/Libs/LibAddonMenu-2.0/controls/checkbox.lua
+++ b/Libs/LibAddonMenu-2.0/controls/checkbox.lua
@@ -12,7 +12,7 @@
 }	]]


-local widgetVersion = 6
+local widgetVersion = 7
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("checkbox", widgetVersion) then return end

@@ -107,6 +107,7 @@ 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)
@@ -148,11 +149,13 @@ function LAMCreateControl.checkbox(parent, checkboxData, controlName)
 	if checkboxData.warning then
 		control.warning = wm:CreateControlFromVirtual(nil, control, "ZO_Options_WarningIcon")
 		control.warning:SetAnchor(RIGHT, checkbox, LEFT, -5, 0)
-		control.warning.tooltipText = checkboxData.warning
+		--control.warning.tooltipText = checkboxData.warning
+		control.warning.data = {tooltipText = checkboxData.warning}
 	end

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = checkboxData
+	control.data.tooltipText = checkboxData.tooltip

 	if checkboxData.disabled then
 		control.UpdateDisabled = UpdateDisabled
diff --git a/Libs/LibAddonMenu-2.0/controls/colorpicker.lua b/Libs/LibAddonMenu-2.0/controls/colorpicker.lua
index 69d453d..abd9ba4 100644
--- a/Libs/LibAddonMenu-2.0/controls/colorpicker.lua
+++ b/Libs/LibAddonMenu-2.0/controls/colorpicker.lua
@@ -7,12 +7,12 @@
 	width = "full",	--or "half" (optional)
 	disabled = function() return db.someBooleanSetting end,	--or boolean (optional)
 	warning = "Will need to reload the UI.",	--(optional)
-	default = {defaults.r, defaults.g, defaults.b, defaults.a},	--(optional) table of default color values
+	default = {r = defaults.r, g = defaults.g, b = defaults.b, a = defaults.a},	--(optional) table of default color values (or default = defaultColor, where defaultColor is a table with keys of r, g, b[, a])
 	reference = "MyAddonColorpicker"	--(optional) unique global reference to control
 }	]]


-local widgetVersion = 4
+local widgetVersion = 5
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("colorpicker", widgetVersion) then return end

@@ -61,6 +61,7 @@ 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)

@@ -116,11 +117,13 @@ function LAMCreateControl.colorpicker(parent, colorpickerData, controlName)
 	if colorpickerData.warning then
 		control.warning = wm:CreateControlFromVirtual(nil, control, "ZO_Options_WarningIcon")
 		control.warning:SetAnchor(RIGHT, control.color, LEFT, -5, 0)
-		control.warning.tooltipText = colorpickerData.warning
+		--control.warning.tooltipText = colorpickerData.warning
+		control.warning.data = {tooltipText = colorpickerData.warning}
 	end

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = colorpickerData
+	control.data.tooltipText = colorpickerData.tooltip

 	if colorpickerData.disabled then
 		control.UpdateDisabled = UpdateDisabled
diff --git a/Libs/LibAddonMenu-2.0/controls/dropdown.lua b/Libs/LibAddonMenu-2.0/controls/dropdown.lua
index 39af220..94cd820 100644
--- a/Libs/LibAddonMenu-2.0/controls/dropdown.lua
+++ b/Libs/LibAddonMenu-2.0/controls/dropdown.lua
@@ -14,7 +14,7 @@
 }	]]


-local widgetVersion = 6
+local widgetVersion = 7
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("dropdown", widgetVersion) then return end

@@ -88,6 +88,7 @@ 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)

@@ -127,11 +128,13 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName)
 	if dropdownData.warning then
 		control.warning = wm:CreateControlFromVirtual(nil, control, "ZO_Options_WarningIcon")
 		control.warning:SetAnchor(RIGHT, combobox, LEFT, -5, 0)
-		control.warning.tooltipText = dropdownData.warning
+		--control.warning.tooltipText = dropdownData.warning
+		control.warning.data = {tooltipText = dropdownData.warning}
 	end

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = dropdownData
+	control.data.tooltipText = dropdownData.tooltip

 	if dropdownData.disabled then
 		control.UpdateDisabled = UpdateDisabled
diff --git a/Libs/LibAddonMenu-2.0/controls/editbox.lua b/Libs/LibAddonMenu-2.0/controls/editbox.lua
index 140cbd7..0d273d3 100644
--- a/Libs/LibAddonMenu-2.0/controls/editbox.lua
+++ b/Libs/LibAddonMenu-2.0/controls/editbox.lua
@@ -13,7 +13,7 @@
 }	]]


-local widgetVersion = 5
+local widgetVersion = 6
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("editbox", widgetVersion) then return end

@@ -64,6 +64,7 @@ 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)

@@ -131,11 +132,13 @@ function LAMCreateControl.editbox(parent, editboxData, controlName)
 	if editboxData.warning then
 		control.warning = wm:CreateControlFromVirtual(nil, control, "ZO_Options_WarningIcon")
 		control.warning:SetAnchor(TOPRIGHT, control.bg, TOPLEFT, -5, 0)
-		control.warning.tooltipText = editboxData.warning
+		--control.warning.tooltipText = editboxData.warning
+		control.warning.data = {tooltipText = editboxData.warning}
 	end

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = editboxData
+	control.data.tooltipText = editboxData.tooltip

 	if editboxData.disabled then
 		control.UpdateDisabled = UpdateDisabled
diff --git a/Libs/LibAddonMenu-2.0/controls/slider.lua b/Libs/LibAddonMenu-2.0/controls/slider.lua
index 4366418..f7ab0a3 100644
--- a/Libs/LibAddonMenu-2.0/controls/slider.lua
+++ b/Libs/LibAddonMenu-2.0/controls/slider.lua
@@ -15,7 +15,7 @@
 }	]]


-local widgetVersion = 4
+local widgetVersion = 5
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("slider", widgetVersion) then return end

@@ -77,6 +77,7 @@ 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)

@@ -160,11 +161,13 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 	if sliderData.warning then
 		control.warning = wm:CreateControlFromVirtual(nil, control, "ZO_Options_WarningIcon")
 		control.warning:SetAnchor(RIGHT, slider, LEFT, -5, 0)
-		control.warning.tooltipText = sliderData.warning
+		--control.warning.tooltipText = sliderData.warning
+		control.warning.data = {tooltipText = sliderData.warning}
 	end

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is the submenu's parent
 	control.data = sliderData
+	control.data.tooltipText = sliderData.tooltip

 	if sliderData.disabled then
 		control.UpdateDisabled = UpdateDisabled
diff --git a/Libs/LibAddonMenu-2.0/controls/submenu.lua b/Libs/LibAddonMenu-2.0/controls/submenu.lua
index 0b6634b..761dda5 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 = 6
+local widgetVersion = 7
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("submenu", widgetVersion) then return end

@@ -18,7 +18,8 @@ local tinsert = table.insert
 local function UpdateValue(control)
 	control.label:SetText(control.data.name)
 	if control.data.tooltip then
-		control.label.tooltipText = control.data.tooltip
+		--control.label.tooltipText = control.data.tooltip
+		control.label.data = {tooltipText = control.data.tooltip}
 	end
 end

@@ -47,8 +48,9 @@ function LAMCreateControl.submenu(parent, submenuData, controlName)
 	label:SetWrapMode(TEXT_WRAP_MODE_ELLIPSIS)
 	label:SetText(submenuData.name)
 	label:SetMouseEnabled(true)
-	if submenuData.tooltipText then
-		label.data = { tooltipText = submenuData.tooltipText }
+	if submenuData.tooltip then
+		--label.tooltipText = submenuData.tooltip
+		label.data = {tooltipText = submenuData.tooltip}
 		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 80649d1..928ab82 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 = 4
+local widgetVersion = 5
 local LAM = LibStub("LibAddonMenu-2.0")
 if not LAM:RegisterWidget("texture", widgetVersion) then return end

@@ -36,9 +36,10 @@ function LAMCreateControl.texture(parent, textureData, controlName)
 	texture:SetDimensions(textureData.imageWidth, textureData.imageHeight)
 	texture:SetTexture(textureData.image)

-	if textureData.tooltipText then
+	if textureData.tooltip then
 		texture:SetMouseEnabled(true)
-		texture.data = { tooltipText = textureData.tooltipText }
+		--texture.tooltipText = textureData.tooltip
+		texture.data = {tooltipText = textureData.tooltip}
 		texture:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
 		texture:SetHandler("OnMouseEnter", ZO_Options_OnMouseExit)
 	end