Update LAM to r17

Sasky [03-02-15 - 01:58]
Update LAM to r17
Filename
lib/LibAddonMenu-2.0/LICENSE
lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
lib/LibAddonMenu-2.0/controls/button.lua
lib/LibAddonMenu-2.0/controls/checkbox.lua
lib/LibAddonMenu-2.0/controls/colorpicker.lua
lib/LibAddonMenu-2.0/controls/custom.lua
lib/LibAddonMenu-2.0/controls/description.lua
lib/LibAddonMenu-2.0/controls/dropdown.lua
lib/LibAddonMenu-2.0/controls/editbox.lua
lib/LibAddonMenu-2.0/controls/header.lua
lib/LibAddonMenu-2.0/controls/panel.lua
lib/LibAddonMenu-2.0/controls/slider.lua
lib/LibAddonMenu-2.0/controls/submenu.lua
lib/LibAddonMenu-2.0/controls/texture.lua
diff --git a/lib/LibAddonMenu-2.0/LICENSE b/lib/LibAddonMenu-2.0/LICENSE
new file mode 100644
index 0000000..82fcf2f
--- /dev/null
+++ b/lib/LibAddonMenu-2.0/LICENSE
@@ -0,0 +1,201 @@
+               The Artistic License 2.0
+
+           Copyright (c) 2015 Ryan Lakanen (Seerah)
+
+     Everyone is permitted to copy and distribute verbatim copies
+      of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package.  If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement.
+
+Definitions
+
+    "Copyright Holder" means the individual(s) or organization(s)
+    named in the copyright notice for the entire Package.
+
+    "Contributor" means any party that has contributed code or other
+    material to the Package, in accordance with the Copyright Holder's
+    procedures.
+
+    "You" and "your" means any person who would like to copy,
+    distribute, or modify the Package.
+
+    "Package" means the collection of files distributed by the
+    Copyright Holder, and derivatives of that collection and/or of
+    those files. A given Package may consist of either the Standard
+    Version, or a Modified Version.
+
+    "Distribute" means providing a copy of the Package or making it
+    accessible to anyone else, or in the case of a company or
+    organization, to others outside of your company or organization.
+
+    "Distributor Fee" means any fee that you charge for Distributing
+    this Package or providing support for this Package to another
+    party.  It does not mean licensing fees.
+
+    "Standard Version" refers to the Package if it has not been
+    modified, or has been modified only in ways explicitly requested
+    by the Copyright Holder.
+
+    "Modified Version" means the Package, if it has been changed, and
+    such changes were not explicitly requested by the Copyright
+    Holder.
+
+    "Original License" means this Artistic License as Distributed with
+    the Standard Version of the Package, in its current version or as
+    it may be modified by The Perl Foundation in the future.
+
+    "Source" form means the source code, documentation source, and
+    configuration files for the Package.
+
+    "Compiled" form means the compiled bytecode, object code, binary,
+    or any other form resulting from mechanical transformation or
+    translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1)  You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2)  You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers.  At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3)  You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder.  The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source
+
+(4)  You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+    (a)  make the Modified Version available to the Copyright Holder
+    of the Standard Version, under the Original License, so that the
+    Copyright Holder may include your modifications in the Standard
+    Version.
+
+    (b)  ensure that installation of your Modified Version does not
+    prevent the user installing or running the Standard Version. In
+    addition, the Modified Version must bear a name that is different
+    from the name of the Standard Version.
+
+    (c)  allow anyone who receives a copy of the Modified Version to
+    make the Source form of the Modified Version available to others
+    under
+
+    (i)  the Original License or
+
+    (ii)  a license that permits the licensee to freely copy,
+    modify and redistribute the Modified Version using the same
+    licensing terms that apply to the copy that the licensee
+    received, and requires that the Source form of the Modified
+    Version, and of any works derived from it, be made freely
+    available in that license fees are prohibited but Distributor
+    Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version
+or Modified Versions without the Source
+
+(5)  You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version.  Such instructions must be
+valid at the time of your distribution.  If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6)  You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package
+
+(7)  You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package.  Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version.  In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10)  Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11)  If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12)  This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13)  This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14)  Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua b/lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
index 1ab94cf..03fb4c4 100644
--- a/lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
+++ b/lib/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
@@ -1,16 +1,34 @@
---	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	--
---	may not be redistributed.								--
---------------------------------------------------------------
+--	LibAddonMenu-2.0 & its files © Ryan Lakanen (Seerah)		--
+--	Distributed under The Artistic License 2.0 (see LICENSE)	--
+------------------------------------------------------------------


 --Register LAM with LibStub
-local MAJOR, MINOR = "LibAddonMenu-2.0", 16
+local MAJOR, MINOR = "LibAddonMenu-2.0", 17
 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
+if not lam then return end	--the same or newer version of this lib is already loaded into memory

+local messages = {}
+local MESSAGE_PREFIX = "[LAM2] "
+local function PrintLater(msg)
+	if(CHAT_SYSTEM.primaryContainer) then
+		d(MESSAGE_PREFIX .. msg)
+	else
+		messages[#messages + 1] = msg
+	end
+end
+
+local function FlushMessages()
+	for i = 1, #messages do
+		d(MESSAGE_PREFIX .. messages[i])
+	end
+	messages = {}
+end
+
+if(LAMSettingsPanelCreated and not LAMCompatibilityWarning) then
+	PrintLater("An old version of LibAddonMenu with compatibility issues was detected. For more information on how to proceed search for LibAddonMenu on esoui.com")
+	LAMCompatibilityWarning = true
+end

 --UPVALUES--
 local wm = WINDOW_MANAGER
@@ -48,23 +66,31 @@ end
 --METHOD: OPEN TO ADDON PANEL--
 --opens to a specific addon's option panel
 --Usage:
---	panel = userdata; the panel returned by the :RegisterOptionsPanel method
---local settings = {en = "Settings", de = "Einstellungen", fr = "Réglages"}
---local locSettings = settings[GetCVar("Language.2")]
+--  panel = userdata; the panel returned by the :RegisterOptionsPanel method
 local locSettings = GetString(SI_GAME_MENU_SETTINGS)
 function lam:OpenToPanel(panel)
 	SCENE_MANAGER:Show("gameMenuInGame")
 	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)
+		local settingsMenu = ZO_GameMenu_InGame.gameMenu.headerControls[locSettings]
+		settingsMenu:SetOpen(true)
+		SCENE_MANAGER:AddFragment(OPTIONS_WINDOW_FRAGMENT)
+		KEYBOARD_OPTIONS:ChangePanels(lam.panelID)
+		for i, child in pairs(settingsMenu.children) do
+			if type(child) == "table" and child.data.name == KEYBOARD_OPTIONS.panelNames[lam.panelID] then
+				ZO_TreeEntry_OnMouseUp(child.control, true)
+				break
+			end
+		end
+		local scroll = LAMAddonPanelsMenuScrollChild
+		for i = 1, scroll:GetNumChildren() do
+			local button = scroll:GetChild(i)
+			if button.panel == panel then
+				zo_callHandler(button, "OnClicked")
+				ZO_Scroll_ScrollControlToTop(LAMAddonPanelsMenu, button)
+				break
+			end
+		end
+	end, 200)
 end


@@ -74,62 +100,75 @@ end
 local function CreateOptionsControls(panel)
 	local addonID = panel:GetName()
 	local optionsTable = addonToOptionsMap[addonID]
-
+
 	if optionsTable then
-		local lastAddedControl, lacAtHalfRow
-		for _, widgetData in ipairs(optionsTable) do
-			local widgetType = widgetData.type
+		local isHalf, widget
+		local lastAddedControl, lacAtHalfRow, oIndex, widgetData, widgetType
+		local submenu, subWidgetData, sIndex, subWidgetType, subWidget
+		local anchorOffset = 0
+		local anchorOffsetSub
+		local lastAddedControlSub, lacAtHalfRowSub
+		for oIndex=1,#optionsTable do
+			widgetData = optionsTable[oIndex]
+			widgetType = widgetData.type
 			if widgetType == "submenu" then
-				local submenu = LAMCreateControl[widgetType](panel, widgetData)
+				submenu = LAMCreateControl[widgetType](panel, widgetData)
 				if lastAddedControl then
-					submenu:SetAnchor(TOPLEFT, lastAddedControl, BOTTOMLEFT, 0, 15)
+					submenu:SetAnchor(TOPLEFT, lastAddedControl, BOTTOMLEFT, 0, 15 + anchorOffset)
 				else
 					submenu:SetAnchor(TOPLEFT)
 				end
 				lastAddedControl = submenu
 				lacAtHalfRow = false
-
-				local lastAddedControlSub, lacAtHalfRowSub
-				for _, subWidgetData in ipairs(widgetData.controls) do
-					local subWidgetType = subWidgetData.type
-					local subWidget = LAMCreateControl[subWidgetType](submenu, subWidgetData)
-					local isHalf = subWidgetData.width == "half"
+
+				anchorOffsetSub = 0
+				lacAtHalfRowSub = nil
+				lastAddedControlSub = nil
+				for sIndex=1,#widgetData.controls do
+					subWidgetData = widgetData.controls[sIndex]
+					subWidgetType = subWidgetData.type
+					subWidget = LAMCreateControl[subWidgetType](submenu, subWidgetData)
+					isHalf = subWidgetData.width == "half"
 					if lastAddedControlSub then
 						if lacAtHalfRowSub and isHalf then
 							subWidget:SetAnchor(TOPLEFT, lastAddedControlSub, TOPRIGHT, 5, 0)
 							lacAtHalfRowSub = false
+							anchorOffsetSub = zo_max(0, subWidget:GetHeight() - lastAddedControlSub:GetHeight())
 						else
-							subWidget:SetAnchor(TOPLEFT, lastAddedControlSub, BOTTOMLEFT, 0, 15)
-							lacAtHalfRowSub = isHalf and true or false
+							subWidget:SetAnchor(TOPLEFT, lastAddedControlSub, BOTTOMLEFT, 0, 15 + anchorOffsetSub)
+							lacAtHalfRowSub = isHalf
+							anchorOffsetSub = 0
 							lastAddedControlSub = subWidget
 						end
 					else
 						subWidget:SetAnchor(TOPLEFT)
-						lacAtHalfRowSub = isHalf and true or false
+						lacAtHalfRowSub = isHalf
 						lastAddedControlSub = subWidget
 					end
 				end
 			else
-				local widget = LAMCreateControl[widgetType](panel, widgetData)
-				local isHalf = widgetData.width == "half"
+				widget = LAMCreateControl[widgetType](panel, widgetData)
+				isHalf = widgetData.width == "half"
 				if lastAddedControl then
 					if lacAtHalfRow and isHalf then
 						widget:SetAnchor(TOPLEFT, lastAddedControl, TOPRIGHT, 10, 0)
+						anchorOffset = zo_max(0, widget:GetHeight() - lastAddedControl:GetHeight())
 						lacAtHalfRow = false
 					else
-						widget:SetAnchor(TOPLEFT, lastAddedControl, BOTTOMLEFT, 0, 15)
-						lacAtHalfRow = isHalf and true or false
+						widget:SetAnchor(TOPLEFT, lastAddedControl, BOTTOMLEFT, 0, 15 + anchorOffset)
+						lacAtHalfRow = isHalf
+						anchorOffset = 0
 						lastAddedControl = widget
 					end
 				else
 					widget:SetAnchor(TOPLEFT)
-					lacAtHalfRow = isHalf and true or false
+					lacAtHalfRow = isHalf
 					lastAddedControl = widget
 				end
 			end
-		end
+		end
 	end
-
+
 	optionsCreated[addonID] = true
 	cm:FireCallbacks("LAM-PanelControlsCreated", panel)
 end
@@ -143,14 +182,16 @@ local function ToggleAddonPanels(panel)	--called in OnShow of newly shown panel
 		currentlySelected:SetHidden(true)
 	end
 	LAMAddonPanelsMenu.currentlySelected = panel
-
+
 	if not optionsCreated[panel:GetName()] then	--if this is the first time opening this panel, create these options
 		CreateOptionsControls(panel)
 	end
-
+
 	cm:FireCallbacks("LAM-RefreshPanel", panel)
 end

+local Initialize
+local hasInitialized = false

 --METHOD: REGISTER ADDON PANEL
 --registers your addon with LibAddonMenu and creates a panel
@@ -158,6 +199,7 @@ end
 --	addonID = "string"; unique ID which will be the global name of your panel
 --	panelData = table; data object for your panel - see controls\panel.lua
 function lam:RegisterAddonPanel(addonID, panelData)
+	if(not hasInitialized) then Initialize(addonID) end
 	local panel = lamcc.panel(nil, panelData, addonID)	--addonID==global name of panel
 	panel:SetHidden(true)
 	panel:SetAnchor(TOPLEFT, LAMAddonPanelsMenu, TOPRIGHT, 10, 0)
@@ -235,12 +277,11 @@ local function CreateAddonSettingsPanel()
 			es = "Configura Addons",
 		}

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

 		lam.panelID = _G[controlPanelID]

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

 		LAMSettingsPanelCreated = true
 	end
@@ -315,8 +356,29 @@ local function CreateAddonList()
 	return list
 end

-
 --INITIALIZING
-CreateAddonSettingsPanel()
-CreateAddonList()
+local safeToInitialize = false
+
+local eventHandle = table.concat({MAJOR, MINOR}, "r")
+local function OnLoad(_, addonName)
+	-- wait for the first loaded event
+	EVENT_MANAGER:UnregisterForEvent(eventHandle, EVENT_ADD_ON_LOADED)
+	safeToInitialize = true
+end
+EVENT_MANAGER:RegisterForEvent(eventHandle, EVENT_ADD_ON_LOADED, OnLoad)

+local function OnActivated(_, addonName)
+	EVENT_MANAGER:UnregisterForEvent(eventHandle, EVENT_PLAYER_ACTIVATED)
+	FlushMessages()
+end
+EVENT_MANAGER:RegisterForEvent(eventHandle, EVENT_PLAYER_ACTIVATED, OnActivated)
+
+function Initialize(addonID)
+	if(not safeToInitialize) then
+		local msg = string.format("The panel with id '%s' was registered before addon loading has completed. This might break the AddOn Settings menu.", addonID)
+		PrintLater(msg)
+	end
+	CreateAddonSettingsPanel()
+	CreateAddonList()
+	hasInitialized = true
+end
diff --git a/lib/LibAddonMenu-2.0/controls/button.lua b/lib/LibAddonMenu-2.0/controls/button.lua
index 187e901..8a6ecda 100644
--- a/lib/LibAddonMenu-2.0/controls/button.lua
+++ b/lib/LibAddonMenu-2.0/controls/button.lua
@@ -11,7 +11,7 @@
 }	]]


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

@@ -33,13 +33,12 @@ end

 --controlName is optional
 function LAMCreateControl.button(parent, buttonData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or buttonData.reference)
-	control:SetParent(parent.scroll or parent)
-
+	local control = wm:CreateControl(controlName or buttonData.reference, parent.scroll or parent, CT_CONTROL)
+
 	local isHalfWidth = buttonData.width == "half"
 	control:SetDimensions(isHalfWidth and 250 or 510, isHalfWidth and 55 or 28)
 	control:SetMouseEnabled(true)
-
+
 	if buttonData.icon then
 		control.button = wm:CreateControl(nil, control, CT_BUTTON)
 		control.button:SetDimensions(26, 26)
@@ -64,26 +63,26 @@ function LAMCreateControl.button(parent, buttonData, controlName)
 				cm:FireCallbacks("LAM-RefreshPanel", control)
 			end
 		end)
-
+
 	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.data = {tooltipText = buttonData.warning}
 	end
-
+
 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = buttonData
-
+
 	if buttonData.disabled then
 		control.UpdateDisabled = UpdateDisabled
 		control:UpdateDisabled()
-
+
 		--this is here because buttons don't have an UpdateValue method
 		if control.panel.data.registerForRefresh then	--if our parent window wants to refresh controls, then add this to the list
 			tinsert(control.panel.controlsToRefresh, control)
 		end
 	end
-
+
 	return control
 end
\ No newline at end of file
diff --git a/lib/LibAddonMenu-2.0/controls/checkbox.lua b/lib/LibAddonMenu-2.0/controls/checkbox.lua
index a777c7d..ef8bf09 100644
--- a/lib/LibAddonMenu-2.0/controls/checkbox.lua
+++ b/lib/LibAddonMenu-2.0/controls/checkbox.lua
@@ -12,7 +12,7 @@
 }	]]


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

@@ -36,16 +36,16 @@ local function UpdateDisabled(control)
 	else
 		disable = control.data.disabled
 	end
-
+
 	control.label:SetColor((disable and ZO_DEFAULT_DISABLED_COLOR or control.value and ZO_DEFAULT_ENABLED_COLOR or ZO_DEFAULT_DISABLED_COLOR):UnpackRGBA())
 	control.checkbox:SetColor((disable and ZO_DEFAULT_DISABLED_COLOR or ZO_NORMAL_TEXT):UnpackRGBA())
 	--control:SetMouseEnabled(not disable)
 	--control:SetMouseEnabled(true)
-
+
 	control.isDisabled = disable
 end

-local function ToggleCheckbox(control)
+local function ToggleCheckbox(control)
 	if control.value then
 		control.label:SetColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGBA())
 		control.checkbox:SetText(control.checkedText)
@@ -69,13 +69,13 @@ local function UpdateValue(control, forceDefault, value)
 		value = control.data.getFunc()
 	end
 	control.value = value
-
+
 	ToggleCheckbox(control)
 end

 local function OnMouseEnter(control)
 	ZO_Options_OnMouseEnter(control)
-
+
 	if control.isDisabled then return end

 	local label = control.label
@@ -88,8 +88,8 @@ local function OnMouseEnter(control)
 end

 local function OnMouseExit(control)
-    ZO_Options_OnMouseExit(control)
-
+	ZO_Options_OnMouseExit(control)
+
 	if control.isDisabled then return end

 	local label = control.label
@@ -104,8 +104,7 @@ end

 --controlName is optional
 function LAMCreateControl.checkbox(parent, checkboxData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or checkboxData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or checkboxData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetMouseEnabled(true)
 	--control.tooltipText = checkboxData.tooltip
 	control:SetHandler("OnMouseEnter", OnMouseEnter)
@@ -116,7 +115,7 @@ function LAMCreateControl.checkbox(parent, checkboxData, controlName)
 			control.value = not control.value
 			control:UpdateValue(false, control.value)
 		end)
-
+
 	control.label = wm:CreateControl(nil, control, CT_LABEL)
 	local label = control.label
 	label:SetFont("ZoFontWinH4")
@@ -143,27 +142,27 @@ function LAMCreateControl.checkbox(parent, checkboxData, controlName)
 		checkbox:SetDimensions(200, 26)
 		checkbox:SetAnchor(RIGHT)
 		label:SetAnchor(LEFT)
-		label:SetAnchor(RIGHT, checkbox, LEFT, -5, 0)
+		label:SetAnchor(RIGHT, checkbox, LEFT, -5, 0)
 	end
-
+
 	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.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
 		control:UpdateDisabled()
 	end
 	control.UpdateValue = UpdateValue
 	control:UpdateValue()
-
+
 	if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then	--if our parent window wants to refresh controls, then add this to the list
 		tinsert(control.panel.controlsToRefresh, control)
 	end
diff --git a/lib/LibAddonMenu-2.0/controls/colorpicker.lua b/lib/LibAddonMenu-2.0/controls/colorpicker.lua
index abd9ba4..c5724b0 100644
--- a/lib/LibAddonMenu-2.0/controls/colorpicker.lua
+++ b/lib/LibAddonMenu-2.0/controls/colorpicker.lua
@@ -12,7 +12,7 @@
 }	]]


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

@@ -28,13 +28,13 @@ local function UpdateDisabled(control)
 	else
 		disable = control.data.disabled
 	end
-
+
 	if disable then
 		control.label:SetColor(ZO_DEFAULT_DISABLED_COLOR:UnpackRGBA())
 	else
 		control.label:SetColor(ZO_DEFAULT_ENABLED_COLOR:UnpackRGBA())
 	end
-
+
 	control.isDisabled = disable
 end

@@ -58,13 +58,11 @@ end


 function LAMCreateControl.colorpicker(parent, colorpickerData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or colorpickerData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or colorpickerData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetMouseEnabled(true)
-	--control.tooltipText = colorpickerData.tooltip
 	control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
 	control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
-
+
 	control.label = wm:CreateControl(nil, control, CT_LABEL)
 	local label = control.label
 	label:SetDimensions(300, 26)
@@ -72,10 +70,10 @@ function LAMCreateControl.colorpicker(parent, colorpickerData, controlName)
 	label:SetFont("ZoFontWinH4")
 	label:SetWrapMode(TEXT_WRAP_MODE_ELLIPSIS)
 	label:SetText(colorpickerData.name)
-
+
 	control.color = wm:CreateControl(nil, control, CT_CONTROL)
 	local color = control.color
-
+
 	local isHalfWidth = colorpickerData.width == "half"
 	if isHalfWidth then
 		control:SetDimensions(250, 55)
@@ -88,12 +86,12 @@ function LAMCreateControl.colorpicker(parent, colorpickerData, controlName)
 		color:SetDimensions(200, 24)
 		color:SetAnchor(TOPRIGHT)
 	end
-
+
 	control.thumb = wm:CreateControl(nil, color, CT_TEXTURE)
 	local thumb = control.thumb
 	thumb:SetDimensions(36, 18)
 	thumb:SetAnchor(LEFT, color, LEFT, 4, 0)
-
+
 	color.border = wm:CreateControl(nil, color, CT_TEXTURE)
 	local border = color.border
 	border:SetTexture("EsoUI\\Art\\ChatWindow\\chatOptions_bgColSwatch_frame.dds")
@@ -104,10 +102,10 @@ function LAMCreateControl.colorpicker(parent, colorpickerData, controlName)
 	local function ColorPickerCallback(r, g, b, a)
 			control:UpdateValue(false, r, g, b, a)
 		end
-
+
 	control:SetHandler("OnMouseUp", function(self, btn, upInside)
 			if self.isDisabled then return end
-
+
 			if upInside then
 				local r, g, b, a = colorpickerData.getFunc()
 				COLOR_PICKER:Show(ColorPickerCallback, r, g, b, a, colorpickerData.name)
@@ -120,11 +118,11 @@ function LAMCreateControl.colorpicker(parent, colorpickerData, controlName)
 		--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
 		control:UpdateDisabled()
diff --git a/lib/LibAddonMenu-2.0/controls/custom.lua b/lib/LibAddonMenu-2.0/controls/custom.lua
index 54c9775..6a31c34 100644
--- a/lib/LibAddonMenu-2.0/controls/custom.lua
+++ b/lib/LibAddonMenu-2.0/controls/custom.lua
@@ -5,7 +5,7 @@
 	width = "full",	--or "half" (optional)
 }	]]

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

@@ -19,10 +19,9 @@ local function UpdateValue(control)
 end

 function LAMCreateControl.custom(parent, customData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or customData.reference)
+	local control = wm:CreateControl(controlName or customData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetResizeToFitDescendents(true)
-	control:SetParent(parent.scroll or parent)
-
+
 	local isHalfWidth = customData.width == "half"
 	if isHalfWidth then	--note these restrictions
 		control:SetDimensionConstraints(250, 55, 250, 100)
@@ -34,12 +33,12 @@ function LAMCreateControl.custom(parent, customData, controlName)

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = customData
-
+
 	control.UpdateValue = UpdateValue
-
+
 	if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then	--if our parent window wants to refresh controls, then add this to the list
 		tinsert(control.panel.controlsToRefresh, control)
 	end
-
+
 	return control
 end
\ No newline at end of file
diff --git a/lib/LibAddonMenu-2.0/controls/description.lua b/lib/LibAddonMenu-2.0/controls/description.lua
index 5d7219d..b886b83 100644
--- a/lib/LibAddonMenu-2.0/controls/description.lua
+++ b/lib/LibAddonMenu-2.0/controls/description.lua
@@ -7,7 +7,7 @@
 }	]]


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

@@ -22,9 +22,8 @@ local function UpdateValue(control)
 end

 function LAMCreateControl.description(parent, descriptionData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or descriptionData.reference)
+	local control = wm:CreateControl(controlName or descriptionData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetResizeToFitDescendents(true)
-	control:SetParent(parent.scroll or parent)
 	local isHalfWidth = descriptionData.width == "half"
 	if isHalfWidth then
 		control:SetDimensionConstraints(250, 55, 250, 100)
@@ -33,7 +32,7 @@ function LAMCreateControl.description(parent, descriptionData, controlName)
 		control:SetDimensionConstraints(510, 40, 510, 100)
 		control:SetDimensions(510, 30)
 	end
-
+
 	control.desc = wm:CreateControl(nil, control, CT_LABEL)
 	local desc = control.desc
 	desc:SetVerticalAlignment(TEXT_ALIGN_TOP)
@@ -55,13 +54,13 @@ function LAMCreateControl.description(parent, descriptionData, controlName)

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = descriptionData
-
+
 	control.UpdateValue = UpdateValue
-
+
 	if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then	--if our parent window wants to refresh controls, then add this to the list
 		tinsert(control.panel.controlsToRefresh, control)
 	end
-
+
 	return control

 end
\ No newline at end of file
diff --git a/lib/LibAddonMenu-2.0/controls/dropdown.lua b/lib/LibAddonMenu-2.0/controls/dropdown.lua
index 94cd820..795404c 100644
--- a/lib/LibAddonMenu-2.0/controls/dropdown.lua
+++ b/lib/LibAddonMenu-2.0/controls/dropdown.lua
@@ -14,7 +14,7 @@
 }	]]


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

@@ -30,7 +30,7 @@ local function UpdateDisabled(control)
 	else
 		disable = control.data.disabled
 	end
-
+
 	control.dropdown:SetEnabled(not disable)
 	if disable then
 		control.label:SetColor(ZO_DEFAULT_DISABLED_COLOR:UnpackRGBA())
@@ -39,7 +39,7 @@ local function UpdateDisabled(control)
 	end
 end

-local function UpdateValue(control, forceDefault, value)
+local function UpdateValue(control, forceDefault, value)
 	if forceDefault then	--if we are forcing defaults
 		value = control.data.default
 		control.data.setFunc(value)
@@ -56,13 +56,13 @@ local function UpdateValue(control, forceDefault, value)
 	end
 end

-local function DropdownCallback(choice, choiceText, choice)
+local function DropdownCallback(control, choiceText, choice)
 	choice.control:UpdateValue(false, choiceText)
 end

 local function UpdateChoices(control, choices)
 	control.dropdown:ClearItems()	--remove previous choices	--(need to call :SetSelectedItem()?)
-
+
 	--build new list of choices
 	local choices = choices or control.data.choices
 	for i = 1, #choices do
@@ -83,15 +83,12 @@ local function GrabSortingInfo(sortInfo)
 end


-local comboboxCount = 1
 function LAMCreateControl.dropdown(parent, dropdownData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or dropdownData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or dropdownData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetMouseEnabled(true)
-	--control.tooltipText = dropdownData.tooltip
 	control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
 	control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
-
+
 	control.label = wm:CreateControl(nil, control, CT_LABEL)
 	local label = control.label
 	label:SetAnchor(TOPLEFT)
@@ -99,8 +96,16 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName)
 	label:SetWrapMode(TEXT_WRAP_MODE_ELLIPSIS)
 	label:SetText(dropdownData.name)

-	control.combobox = wm:CreateControlFromVirtual(parent:GetName().."Combobox"..comboboxCount, control, "ZO_ComboBox")
-	comboboxCount = comboboxCount + 1
+	local countControl = parent
+	local name = parent:GetName()
+	if not name or #name == 0 then
+		countControl = LAMCreateControl
+		name = "LAM"
+	end
+	local comboboxCount = (countControl.comboboxCount or 0) + 1
+	countControl.comboboxCount = comboboxCount
+	control.combobox = wm:CreateControlFromVirtual(zo_strjoin(nil, name, "Combobox", comboboxCount), control, "ZO_ComboBox")
+
 	local combobox = control.combobox
 	combobox:SetHandler("OnMouseEnter", function() ZO_Options_OnMouseEnter(control) end)
 	combobox:SetHandler("OnMouseExit", function() ZO_Options_OnMouseExit(control) end)
@@ -111,7 +116,7 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName)
 		local sortType, sortOrder = sortInfo[1], sortInfo[2]
 		dropdown:SetSortOrder(sortOrder == "up" and ZO_SORT_ORDER_UP or ZO_SORT_ORDER_DOWN, sortType == "name" and ZO_SORT_BY_NAME or ZO_SORT_BY_NAME_NUMERIC)
 	end
-
+
 	local isHalfWidth = dropdownData.width == "half"
 	if isHalfWidth then
 		control:SetDimensions(250, 55)
@@ -124,18 +129,17 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName)
 		combobox:SetDimensions(200, 26)
 		combobox:SetAnchor(TOPRIGHT)
 	end
-
+
 	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.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
 		control:UpdateDisabled()
@@ -144,7 +148,7 @@ function LAMCreateControl.dropdown(parent, dropdownData, controlName)
 	control:UpdateChoices(dropdownData.choices)
 	control.UpdateValue = UpdateValue
 	control:UpdateValue()
-
+
 	if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then	--if our parent window wants to refresh controls, then add this to the list
 		tinsert(control.panel.controlsToRefresh, control)
 	end
diff --git a/lib/LibAddonMenu-2.0/controls/editbox.lua b/lib/LibAddonMenu-2.0/controls/editbox.lua
index 0d273d3..3ab069f 100644
--- a/lib/LibAddonMenu-2.0/controls/editbox.lua
+++ b/lib/LibAddonMenu-2.0/controls/editbox.lua
@@ -13,7 +13,7 @@
 }	]]


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

@@ -60,24 +60,22 @@ end


 function LAMCreateControl.editbox(parent, editboxData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or editboxData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or editboxData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetMouseEnabled(true)
 	control:SetResizeToFitDescendents(true)
-	--control.tooltipText = editboxData.tooltip
 	control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
 	control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
-
+
 	control.label = wm:CreateControl(nil, control, CT_LABEL)
 	local label = control.label
 	label:SetAnchor(TOPLEFT)
 	label:SetFont("ZoFontWinH4")
 	label:SetWrapMode(TEXT_WRAP_MODE_ELLIPSIS)
 	label:SetText(editboxData.name)
-
+
 	control.bg = wm:CreateControlFromVirtual(nil, control, "ZO_EditBackdrop")
 	local bg = control.bg
-
+
 	if editboxData.isMultiline then
 		control.editbox = wm:CreateControlFromVirtual(nil, bg, "ZO_DefaultEditMultiLineForBackdrop")
 		control.editbox:SetHandler("OnMouseWheel", function(self, delta)
@@ -109,7 +107,7 @@ function LAMCreateControl.editbox(parent, editboxData, controlName)
 	editbox:SetHandler("OnEscape", function(self) self:LoseFocus() control:UpdateValue(false, self:GetText()) end)
 	editbox:SetHandler("OnMouseEnter", function() ZO_Options_OnMouseEnter(control) end)
 	editbox:SetHandler("OnMouseExit", function() ZO_Options_OnMouseExit(control) end)
-
+
 	local isHalfWidth = editboxData.width == "half"
 	if isHalfWidth then
 		control:SetDimensions(250, 55)
@@ -139,7 +137,7 @@ function LAMCreateControl.editbox(parent, editboxData, controlName)
 	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
 		control:UpdateDisabled()
diff --git a/lib/LibAddonMenu-2.0/controls/header.lua b/lib/LibAddonMenu-2.0/controls/header.lua
index bbf2c60..83c862b 100644
--- a/lib/LibAddonMenu-2.0/controls/header.lua
+++ b/lib/LibAddonMenu-2.0/controls/header.lua
@@ -6,7 +6,7 @@
 }	]]


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

@@ -18,11 +18,10 @@ local function UpdateValue(control)
 end

 function LAMCreateControl.header(parent, headerData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or headerData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or headerData.reference, parent.scroll or parent, CT_CONTROL)
 	local isHalfWidth = headerData.width == "half"
 	control:SetDimensions(isHalfWidth and 250 or 510, 30)
-
+
 	control.divider = wm:CreateControlFromVirtual(nil, control, "ZO_Options_Divider")
 	local divider = control.divider
 	divider:SetWidth(isHalfWidth and 250 or 510)
@@ -33,15 +32,15 @@ function LAMCreateControl.header(parent, headerData, controlName)
 	header:SetAnchor(TOPLEFT, divider, BOTTOMLEFT)
 	header:SetAnchor(BOTTOMRIGHT)
 	header:SetText(headerData.name)
-
+
 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = headerData
-
+
 	control.UpdateValue = UpdateValue
-
+
 	if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then	--if our parent window wants to refresh controls, then add this to the list
 		tinsert(control.panel.controlsToRefresh, control)
 	end
-
+
 	return control
 end
\ No newline at end of file
diff --git a/lib/LibAddonMenu-2.0/controls/panel.lua b/lib/LibAddonMenu-2.0/controls/panel.lua
index 5f9f41b..8db73ee 100644
--- a/lib/LibAddonMenu-2.0/controls/panel.lua
+++ b/lib/LibAddonMenu-2.0/controls/panel.lua
@@ -21,10 +21,10 @@ local cm = CALLBACK_MANAGER
 local function RefreshPanel(control)
 	local panel = control.panel or control	--callback can be fired by a single control or by the panel showing
 	local panelControls = panel.controlsToRefresh
-
+
 	for i = 1, #panelControls do
 		local updateControl = panelControls[i]
-		if  updateControl ~= control then
+		if  updateControl ~= control then
 			if updateControl.UpdateValue then
 				updateControl:UpdateValue()
 			end
@@ -37,18 +37,18 @@ end

 local function ForceDefaults(panel)
 	local panelControls = panel.controlsToRefresh
-
+
 	for i = 1, #panelControls do
 		local updateControl = panelControls[i]
 		if updateControl.UpdateValue and updateControl.data.default ~= nil then
 			updateControl:UpdateValue(true)
 		end
 	end
-
+
 	if panel.data.resetFunc then
 		panel.data.resetFunc()
 	end
-
+
 	cm:FireCallbacks("LAM-RefreshPanel", panel)
 end
 ESO_Dialogs["LAM_DEFAULTS"] = {
@@ -81,12 +81,12 @@ function LAMCreateControl.panel(parent, panelData, controlName)
 	bg:SetAnchorFill()
 	bg:SetEdgeTexture("EsoUI\\Art\\miscellaneous\\borderedinsettransparent_edgefile.dds", 128, 16)
 	bg:SetCenterColor(0, 0, 0, 0)
-
+
 	control.label = wm:CreateControlFromVirtual(nil, control, "ZO_Options_SectionTitleLabel")
 	local label = control.label
 	label:SetAnchor(TOPLEFT, control, TOPLEFT, 10, 10)
 	label:SetText(panelData.displayName and panelData.displayName or panelData.name)
-
+
 	if panelData.author or panelData.version then
 		control.info = wm:CreateControl(nil, control, CT_LABEL)
 		local info = control.info
@@ -103,7 +103,7 @@ function LAMCreateControl.panel(parent, panelData, controlName)
 			info:SetText("Version: "..panelData.version)
 		end
 	end
-
+
 	control.container = wm:CreateControlFromVirtual("LAMAddonPanelContainer"..LAMCreateControl.scrollCount, control, "ZO_ScrollContainer")
 	LAMCreateControl.scrollCount = LAMCreateControl.scrollCount + 1
 	local container = control.container
@@ -111,7 +111,7 @@ function LAMCreateControl.panel(parent, panelData, controlName)
 	container:SetAnchor(BOTTOMRIGHT, control, BOTTOMRIGHT, -3, -3)
 	control.scroll = GetControl(control.container, "ScrollChild")
 	control.scroll:SetResizeToFitPadding(0, 20)
-
+
 	if panelData.registerForDefaults then
 		control.defaultButton = wm:CreateControlFromVirtual(nil, control, "ZO_DefaultTextButton")
 		local defaultButton = control.defaultButton
@@ -133,6 +133,6 @@ function LAMCreateControl.panel(parent, panelData, controlName)

 	control.data = panelData
 	control.controlsToRefresh = {}
-
+
 	return control
 end
\ No newline at end of file
diff --git a/lib/LibAddonMenu-2.0/controls/slider.lua b/lib/LibAddonMenu-2.0/controls/slider.lua
index f7ab0a3..845fa7d 100644
--- a/lib/LibAddonMenu-2.0/controls/slider.lua
+++ b/lib/LibAddonMenu-2.0/controls/slider.lua
@@ -15,7 +15,7 @@
 }	]]


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

@@ -32,7 +32,7 @@ local function UpdateDisabled(control)
 	else
 		disable = control.data.disabled
 	end
-
+
 	control.slider:SetEnabled(not disable)
 	control.slidervalue:SetEditEnabled(not disable)
 	if disable then
@@ -61,15 +61,14 @@ local function UpdateValue(control, forceDefault, value)
 	else
 		value = control.data.getFunc()
 	end
-
+
 	control.slider:SetValue(value)
 	control.slidervalue:SetText(value)
 end


 function LAMCreateControl.slider(parent, sliderData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or sliderData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or sliderData.reference, parent.scroll or parent, CT_CONTROL)
 	local isHalfWidth = sliderData.width == "half"
 	if isHalfWidth then
 		control:SetDimensions(250, 55)
@@ -80,7 +79,7 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 	--control.tooltipText = sliderData.tooltip
 	control:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
 	control:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
-
+
 	control.label = wm:CreateControl(nil, control, CT_LABEL)
 	local label = control.label
 	label:SetFont("ZoFontWinH4")
@@ -88,7 +87,7 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 	label:SetWrapMode(TEXT_WRAP_MODE_ELLIPSIS)
 	label:SetAnchor(isHalfWidth and TOPLEFT or LEFT)
 	label:SetText(sliderData.name)
-
+
 	--skipping creating the backdrop...  Is this the actual slider texture?
 	control.slider = wm:CreateControl(nil, control, CT_SLIDER)
 	local slider = control.slider
@@ -107,14 +106,14 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 	slider:SetMinMax(minValue, maxValue)
 	slider:SetHandler("OnMouseEnter", function() ZO_Options_OnMouseEnter(control) end)
 	slider:SetHandler("OnMouseEnter", function() ZO_Options_OnMouseExit(control) end)
-
+
 	slider.bg = wm:CreateControl(nil, slider, CT_BACKDROP)
 	local bg = slider.bg
 	bg:SetCenterColor(0, 0, 0)
 	bg:SetAnchor(TOPLEFT, slider, TOPLEFT, 0, 4)
 	bg:SetAnchor(BOTTOMRIGHT, slider, BOTTOMRIGHT, 0, -4)
 	bg:SetEdgeTexture("EsoUI\\Art\\Tooltips\\UI-SliderBackdrop.dds", 32, 4)
-
+
 	control.minText = wm:CreateControl(nil, slider, CT_LABEL)
 	local minText = control.minText
 	minText:SetFont("ZoFontGameSmall")
@@ -126,7 +125,7 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 	maxText:SetFont("ZoFontGameSmall")
 	maxText:SetAnchor(TOPRIGHT, slider, BOTTOMRIGHT)
 	maxText:SetText(sliderData.max)
-
+
 	control.slidervalueBG = wm:CreateControlFromVirtual(nil, slider, "ZO_EditBackdrop")
 	control.slidervalueBG:SetDimensions(50, 16)
 	control.slidervalueBG:SetAnchor(TOP, slider, BOTTOM, 0, 0)
@@ -145,7 +144,7 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 			self:LoseFocus()
 			control:UpdateValue(false, tonumber(self:GetText()))
 		end)
-
+
 	local range = maxValue - minValue
 	slider:SetValueStep(sliderData.step or 1)
 	slider:SetHandler("OnValueChanged", function(self, value, eventReason)
@@ -157,18 +156,18 @@ function LAMCreateControl.slider(parent, sliderData, controlName)
 			--sliderData.setFunc(value)
 			control:UpdateValue(false, value)	--does this work here instead?
 		end)
-
+
 	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.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
 		control:UpdateDisabled()
diff --git a/lib/LibAddonMenu-2.0/controls/submenu.lua b/lib/LibAddonMenu-2.0/controls/submenu.lua
index 761dda5..d3da3eb 100644
--- a/lib/LibAddonMenu-2.0/controls/submenu.lua
+++ b/lib/LibAddonMenu-2.0/controls/submenu.lua
@@ -6,7 +6,7 @@
 	reference = "MyAddonSubmenu"	--(optional) unique global reference to control
 }	]]

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

@@ -18,7 +18,6 @@ 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.data = {tooltipText = control.data.tooltip}
 	end
 end
@@ -26,7 +25,7 @@ end
 local function AnimateSubmenu(clicked)
 	local control = clicked:GetParent()
 	control.open = not control.open
-
+
 	if control.open then
 		control.animation:PlayFromStart()
 	else
@@ -36,11 +35,10 @@ end


 function LAMCreateControl.submenu(parent, submenuData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or submenuData.reference)
-	control:SetParent(parent.scroll or parent)
+	local control = wm:CreateControl(controlName or submenuData.reference, parent.scroll or parent, CT_CONTROL)
 	control.panel = parent
 	control:SetDimensions(523, 40)
-
+
 	control.label = wm:CreateControlFromVirtual(nil, control, "ZO_Options_SectionTitleLabel")
 	local label = control.label
 	label:SetAnchor(TOPLEFT, control, TOPLEFT, 5, 5)
@@ -49,12 +47,11 @@ function LAMCreateControl.submenu(parent, submenuData, controlName)
 	label:SetText(submenuData.name)
 	label:SetMouseEnabled(true)
 	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
-
+
 	control.scroll = wm:CreateControl(nil, control, CT_SCROLL)
 	local scroll = control.scroll
 	scroll:SetParent(control)
@@ -68,23 +65,18 @@ function LAMCreateControl.submenu(parent, submenuData, controlName)
 	bg:SetEdgeTexture("EsoUI\\Art\\Tooltips\\UI-Border.dds", 128, 16)
 	bg:SetCenterTexture("EsoUI\\Art\\Tooltips\\UI-TooltipCenter.dds")
 	bg:SetInsets(16, 16, -16, -16)
-
+
 	control.arrow = wm:CreateControl(nil, bg, CT_TEXTURE)
 	local arrow = control.arrow
 	arrow:SetDimensions(28, 28)
 	arrow:SetTexture("EsoUI\\Art\\Miscellaneous\\list_sortdown.dds")	--list_sortup for the other way
 	arrow:SetAnchor(TOPRIGHT, bg, TOPRIGHT, -5, 5)
-
+
 	--figure out the cool animation later...
 	control.animation = am:CreateTimeline()
 	local animation = control.animation
 	animation:SetPlaybackType(ANIMATION_SIZE, 0)	--2nd arg = loop count
-	--animation:SetDuration(1)
-	--animation:SetEasingFunction(ZO_LinearEase)	--is this needed?
-	--animation:SetHeightStartAndEnd(40, 80)	--SetStartAndEndHeight
-	--animation:SetStartAndEndHeight(40, 80)	--SetStartAndEndHeight
-	--animation:SetAnimatedControl(control)
-
+
 	control:SetResizeToFitDescendents(true)
 	control.open = false
 	label:SetHandler("OnMouseUp", AnimateSubmenu)
@@ -99,7 +91,7 @@ function LAMCreateControl.submenu(parent, submenuData, controlName)
 				scroll:SetHeight(0)
 			end
 		end)
-
+
 	--small strip at the bottom of the submenu that you can click to close it
 	control.btmToggle = wm:CreateControl(nil, control, CT_TEXTURE)
 	local btmToggle = control.btmToggle
@@ -109,15 +101,14 @@ function LAMCreateControl.submenu(parent, submenuData, controlName)
 	btmToggle:SetHeight(15)
 	btmToggle:SetAlpha(0)
 	btmToggle:SetHandler("OnMouseUp", AnimateSubmenu)
-
+
 	control.data = submenuData
-
+
 	control.UpdateValue = UpdateValue
-
+
 	if control.panel.data.registerForRefresh or control.panel.data.registerForDefaults then	--if our parent window wants to refresh controls, then add this to the list
 		tinsert(control.panel.controlsToRefresh, control)
 	end
-
+
 	return control
 end
-
diff --git a/lib/LibAddonMenu-2.0/controls/texture.lua b/lib/LibAddonMenu-2.0/controls/texture.lua
index 928ab82..26b0353 100644
--- a/lib/LibAddonMenu-2.0/controls/texture.lua
+++ b/lib/LibAddonMenu-2.0/controls/texture.lua
@@ -10,17 +10,16 @@

 --add texture coords support?

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

 local wm = WINDOW_MANAGER

 function LAMCreateControl.texture(parent, textureData, controlName)
-	local control = wm:CreateTopLevelWindow(controlName or textureData.reference)
+	local control = wm:CreateControl(controlName or textureData.reference, parent.scroll or parent, CT_CONTROL)
 	control:SetResizeToFitDescendents(true)
-	control:SetParent(parent.scroll or parent)
-
+
 	local isHalfWidth = textureData.width == "half"
 	if isHalfWidth then
 		control:SetDimensionConstraints(250, 55, 250, 100)
@@ -29,13 +28,13 @@ function LAMCreateControl.texture(parent, textureData, controlName)
 		control:SetDimensionConstraints(510, 30, 510, 100)
 		control:SetDimensions(510, 30)
 	end
-
+
 	control.texture = wm:CreateControl(nil, control, CT_TEXTURE)
 	local texture = control.texture
 	texture:SetAnchor(CENTER)
 	texture:SetDimensions(textureData.imageWidth, textureData.imageHeight)
 	texture:SetTexture(textureData.image)
-
+
 	if textureData.tooltip then
 		texture:SetMouseEnabled(true)
 		--texture.tooltipText = textureData.tooltip
@@ -46,6 +45,6 @@ function LAMCreateControl.texture(parent, textureData, controlName)

 	control.panel = parent.panel or parent	--if this is in a submenu, panel is its parent
 	control.data = textureData
-
+
 	return control
 end
\ No newline at end of file