+Date: Wed Nov 3 19:49:57 2021 +0100
- In _SetCell(): Replaced non-existent "tooltip" argument with "self" in call to cell:SetupCell()
+ update for WoW 9.1.5's new TooltipBackdropTemplate
diff --git a/Libs/LibQTip-1.0/LibQTip-1.0.lua b/Libs/LibQTip-1.0/LibQTip-1.0.lua
index b7c7ce3..137accd 100755
--- a/Libs/LibQTip-1.0/LibQTip-1.0.lua
+++ b/Libs/LibQTip-1.0/LibQTip-1.0.lua
@@ -1,5 +1,5 @@
local MAJOR = "LibQTip-1.0"
-local MINOR = 48 -- Should be manually increased
+local MINOR = 49 -- Should be manually increased
local LibStub = _G.LibStub
assert(LibStub, MAJOR .. " requires LibStub")
@@ -7,7 +7,7 @@ assert(LibStub, MAJOR .. " requires LibStub")
local lib, oldMinor = LibStub:NewLibrary(MAJOR, MINOR)
if not lib then
- return
+ return
end -- No upgrade needed
------------------------------------------------------------------------------
@@ -37,12 +37,7 @@ local geterrorhandler = _G.geterrorhandler
------------------------------------------------------------------------------
-- Tables and locals
------------------------------------------------------------------------------
-if BackdropTemplateMixin and oldMinor and (oldMinor < 48) and lib.frameMetatable then
- -- mix new BackdropTemplateMixin into frame metatable
- Mixin(lib.frameMetatable["__index"], BackdropTemplateMixin)
-else
- lib.frameMetatable = lib.frameMetatable or {__index = CreateFrame("Frame", nil, nil, BackdropTemplateMixin and "BackdropTemplate")}
-end
+lib.frameMetatable = lib.frameMetatable or {__index = CreateFrame("Frame")}
lib.tipPrototype = lib.tipPrototype or setmetatable({}, lib.frameMetatable)
lib.tipMetatable = lib.tipMetatable or {__index = lib.tipPrototype}
@@ -121,51 +116,51 @@ local CELL_MARGIN_V = 3
-- @usage Acquire a tooltip with at least 5 columns, justification : left, center, left, left, left
-- local tip = LibStub('LibQTip-1.0'):Acquire('MyFooBarTooltip', 5, "LEFT", "CENTER")
function lib:Acquire(key, ...)
- if key == nil then
- error("attempt to use a nil key", 2)
- end
+ if key == nil then
+ error("attempt to use a nil key", 2)
+ end
- local tooltip = activeTooltips[key]
+ local tooltip = activeTooltips[key]
- if not tooltip then
- tooltip = AcquireTooltip()
- InitializeTooltip(tooltip, key)
- activeTooltips[key] = tooltip
- end
+ if not tooltip then
+ tooltip = AcquireTooltip()
+ InitializeTooltip(tooltip, key)
+ activeTooltips[key] = tooltip
+ end
- if select("#", ...) > 0 then
- -- Here we catch any error to properly report it for the calling code
- local ok, msg = pcall(tooltip.SetColumnLayout, tooltip, ...)
+ if select("#", ...) > 0 then
+ -- Here we catch any error to properly report it for the calling code
+ local ok, msg = pcall(tooltip.SetColumnLayout, tooltip, ...)
- if not ok then
- error(msg, 2)
- end
- end
+ if not ok then
+ error(msg, 2)
+ end
+ end
- return tooltip
+ return tooltip
end
function lib:Release(tooltip)
- local key = tooltip and tooltip.key
+ local key = tooltip and tooltip.key
- if not key or activeTooltips[key] ~= tooltip then
- return
- end
+ if not key or activeTooltips[key] ~= tooltip then
+ return
+ end
- ReleaseTooltip(tooltip)
- activeTooltips[key] = nil
+ ReleaseTooltip(tooltip)
+ activeTooltips[key] = nil
end
function lib:IsAcquired(key)
- if key == nil then
- error("attempt to use a nil key", 2)
- end
+ if key == nil then
+ error("attempt to use a nil key", 2)
+ end
- return not (not activeTooltips[key])
+ return not (not activeTooltips[key])
end
function lib:IterateTooltips()
- return pairs(activeTooltips)
+ return pairs(activeTooltips)
end
------------------------------------------------------------------------------
@@ -174,26 +169,26 @@ end
local frameHeap = lib.frameHeap
local function AcquireFrame(parent)
- local frame = tremove(frameHeap) or CreateFrame("Frame", nil, nil, BackdropTemplateMixin and "BackdropTemplate")
- frame:SetParent(parent)
- --[===[@debug@
- usedFrames = usedFrames + 1
- --@end-debug@]===]
- return frame
+ local frame = tremove(frameHeap) or CreateFrame("Frame", nil, nil, BackdropTemplateMixin and "BackdropTemplate")
+ frame:SetParent(parent)
+ --[===[@debug@
+ usedFrames = usedFrames + 1
+ --@end-debug@]===]
+ return frame
end
local function ReleaseFrame(frame)
- frame:Hide()
- frame:SetParent(nil)
- frame:ClearAllPoints()
- frame:SetBackdrop(nil)
+ frame:Hide()
+ frame:SetParent(nil)
+ frame:ClearAllPoints()
+ frame:SetBackdrop(nil)
- ClearFrameScripts(frame)
+ ClearFrameScripts(frame)
- tinsert(frameHeap, frame)
- --[===[@debug@
- usedFrames = usedFrames - 1
- --@end-debug@]===]
+ tinsert(frameHeap, frame)
+ --[===[@debug@
+ usedFrames = usedFrames - 1
+ --@end-debug@]===]
end
------------------------------------------------------------------------------
@@ -202,18 +197,18 @@ end
local timerHeap = lib.timerHeap
local function AcquireTimer(parent)
- local frame = tremove(timerHeap) or CreateFrame("Frame")
- frame:SetParent(parent)
- return frame
+ local frame = tremove(timerHeap) or CreateFrame("Frame")
+ frame:SetParent(parent)
+ return frame
end
local function ReleaseTimer(frame)
- frame:Hide()
- frame:SetParent(nil)
+ frame:Hide()
+ frame:SetParent(nil)
- ClearFrameScripts(frame)
+ ClearFrameScripts(frame)
- tinsert(timerHeap, frame)
+ tinsert(timerHeap, frame)
end
------------------------------------------------------------------------------
@@ -225,18 +220,18 @@ local layoutCleaner = lib.layoutCleaner
layoutCleaner.registry = layoutCleaner.registry or {}
function layoutCleaner:RegisterForCleanup(tooltip)
- self.registry[tooltip] = true
- self:Show()
+ self.registry[tooltip] = true
+ self:Show()
end
function layoutCleaner:CleanupLayouts()
- self:Hide()
+ self:Hide()
- for tooltip in pairs(self.registry) do
- FixCellSizes(tooltip)
- end
+ for tooltip in pairs(self.registry) do
+ FixCellSizes(tooltip)
+ end
- wipe(self.registry)
+ wipe(self.registry)
end
layoutCleaner:SetScript("OnUpdate", layoutCleaner.CleanupLayouts)
@@ -245,136 +240,137 @@ layoutCleaner:SetScript("OnUpdate", layoutCleaner.CleanupLayouts)
-- CellProvider and Cell
------------------------------------------------------------------------------
function providerPrototype:AcquireCell()
- local cell = tremove(self.heap)
+ local cell = tremove(self.heap)
- if not cell then
- cell = setmetatable(CreateFrame("Frame", nil, UIParent), self.cellMetatable)
+ if not cell then
+ cell = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate")
+ setmetatable(cell, self.cellMetatable)
- if type(cell.InitializeCell) == "function" then
- cell:InitializeCell()
- end
- end
+ if type(cell.InitializeCell) == "function" then
+ cell:InitializeCell()
+ end
+ end
- self.cells[cell] = true
+ self.cells[cell] = true
- return cell
+ return cell
end
function providerPrototype:ReleaseCell(cell)
- if not self.cells[cell] then
- return
- end
+ if not self.cells[cell] then
+ return
+ end
- if type(cell.ReleaseCell) == "function" then
- cell:ReleaseCell()
- end
+ if type(cell.ReleaseCell) == "function" then
+ cell:ReleaseCell()
+ end
- self.cells[cell] = nil
- tinsert(self.heap, cell)
+ self.cells[cell] = nil
+ tinsert(self.heap, cell)
end
function providerPrototype:GetCellPrototype()
- return self.cellPrototype, self.cellMetatable
+ return self.cellPrototype, self.cellMetatable
end
function providerPrototype:IterateCells()
- return pairs(self.cells)
+ return pairs(self.cells)
end
function lib:CreateCellProvider(baseProvider)
- local cellBaseMetatable, cellBasePrototype
+ local cellBaseMetatable, cellBasePrototype
- if baseProvider and baseProvider.GetCellPrototype then
- cellBasePrototype, cellBaseMetatable = baseProvider:GetCellPrototype()
- else
- cellBaseMetatable = cellMetatable
- end
+ if baseProvider and baseProvider.GetCellPrototype then
+ cellBasePrototype, cellBaseMetatable = baseProvider:GetCellPrototype()
+ else
+ cellBaseMetatable = cellMetatable
+ end
- local newCellPrototype = setmetatable({}, cellBaseMetatable)
- local newCellProvider = setmetatable({}, providerMetatable)
+ local newCellPrototype = setmetatable({}, cellBaseMetatable)
+ local newCellProvider = setmetatable({}, providerMetatable)
- newCellProvider.heap = {}
- newCellProvider.cells = {}
- newCellProvider.cellPrototype = newCellPrototype
- newCellProvider.cellMetatable = {__index = newCellPrototype}
+ newCellProvider.heap = {}
+ newCellProvider.cells = {}
+ newCellProvider.cellPrototype = newCellPrototype
+ newCellProvider.cellMetatable = {__index = newCellPrototype}
- return newCellProvider, newCellPrototype, cellBasePrototype
+ return newCellProvider, newCellPrototype, cellBasePrototype
end
------------------------------------------------------------------------------
-- Basic label provider
------------------------------------------------------------------------------
if not lib.LabelProvider then
- lib.LabelProvider, lib.LabelPrototype = lib:CreateCellProvider()
+ lib.LabelProvider, lib.LabelPrototype = lib:CreateCellProvider()
end
local labelProvider = lib.LabelProvider
local labelPrototype = lib.LabelPrototype
function labelPrototype:InitializeCell()
- self.fontString = self:CreateFontString()
- self.fontString:SetFontObject(_G.GameTooltipText)
+ self.fontString = self:CreateFontString()
+ self.fontString:SetFontObject(_G.GameTooltipText)
end
function labelPrototype:SetupCell(tooltip, value, justification, font, leftPadding, rightPadding, maxWidth, minWidth, ...)
- local fontString = self.fontString
- local line = tooltip.lines[self._line]
+ local fontString = self.fontString
+ local line = tooltip.lines[self._line]
- -- detatch fs from cell for size calculations
- fontString:ClearAllPoints()
- fontString:SetFontObject(font or (line.is_header and tooltip:GetHeaderFont() or tooltip:GetFont()))
- fontString:SetJustifyH(justification)
- fontString:SetText(tostring(value))
+ -- detatch fs from cell for size calculations
+ fontString:ClearAllPoints()
+ fontString:SetFontObject(font or (line.is_header and tooltip:GetHeaderFont() or tooltip:GetFont()))
+ fontString:SetJustifyH(justification)
+ fontString:SetText(tostring(value))
- leftPadding = leftPadding or 0
- rightPadding = rightPadding or 0
+ leftPadding = leftPadding or 0
+ rightPadding = rightPadding or 0
- local width = fontString:GetStringWidth() + leftPadding + rightPadding
+ local width = fontString:GetStringWidth() + leftPadding + rightPadding
- if maxWidth and minWidth and (maxWidth < minWidth) then
- error("maximum width cannot be lower than minimum width: " .. tostring(maxWidth) .. " < " .. tostring(minWidth), 2)
- end
+ if maxWidth and minWidth and (maxWidth < minWidth) then
+ error("maximum width cannot be lower than minimum width: " .. tostring(maxWidth) .. " < " .. tostring(minWidth), 2)
+ end
- if maxWidth and (maxWidth < (leftPadding + rightPadding)) then
- error("maximum width cannot be lower than the sum of paddings: " .. tostring(maxWidth) .. " < " .. tostring(leftPadding) .. " + " .. tostring(rightPadding), 2)
- end
+ if maxWidth and (maxWidth < (leftPadding + rightPadding)) then
+ error("maximum width cannot be lower than the sum of paddings: " .. tostring(maxWidth) .. " < " .. tostring(leftPadding) .. " + " .. tostring(rightPadding), 2)
+ end
- if minWidth and width < minWidth then
- width = minWidth
- end
+ if minWidth and width < minWidth then
+ width = minWidth
+ end
- if maxWidth and maxWidth < width then
- width = maxWidth
- end
+ if maxWidth and maxWidth < width then
+ width = maxWidth
+ end
- fontString:SetWidth(width - (leftPadding + rightPadding))
- -- Use GetHeight() instead of GetStringHeight() so lines which are longer than width will wrap.
- local height = fontString:GetHeight()
+ fontString:SetWidth(width - (leftPadding + rightPadding))
+ -- Use GetHeight() instead of GetStringHeight() so lines which are longer than width will wrap.
+ local height = fontString:GetHeight()
- -- reanchor fs to cell
- fontString:SetWidth(0)
- fontString:SetPoint("TOPLEFT", self, "TOPLEFT", leftPadding, 0)
- fontString:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -rightPadding, 0)
- --~ fs:SetPoint("TOPRIGHT", self, "TOPRIGHT", -r_pad, 0)
+ -- reanchor fs to cell
+ fontString:SetWidth(0)
+ fontString:SetPoint("TOPLEFT", self, "TOPLEFT", leftPadding, 0)
+ fontString:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -rightPadding, 0)
+ --~ fs:SetPoint("TOPRIGHT", self, "TOPRIGHT", -r_pad, 0)
- self._paddingL = leftPadding
- self._paddingR = rightPadding
+ self._paddingL = leftPadding
+ self._paddingR = rightPadding
- return width, height
+ return width, height
end
function labelPrototype:getContentHeight()
- local fontString = self.fontString
- fontString:SetWidth(self:GetWidth() - (self._paddingL + self._paddingR))
+ local fontString = self.fontString
+ fontString:SetWidth(self:GetWidth() - (self._paddingL + self._paddingR))
- local height = self.fontString:GetHeight()
- fontString:SetWidth(0)
+ local height = self.fontString:GetHeight()
+ fontString:SetWidth(0)
- return height
+ return height
end
function labelPrototype:GetPosition()
- return self._line, self._column
+ return self._line, self._column
end
------------------------------------------------------------------------------
@@ -384,93 +380,102 @@ local tooltipHeap = lib.tooltipHeap
-- Returns a tooltip
function AcquireTooltip()
- local tooltip = tremove(tooltipHeap)
+ local tooltip = tremove(tooltipHeap)
- if not tooltip then
- tooltip = CreateFrame("Frame", nil, UIParent)
+ if not tooltip then
+ local template = (TooltipBackdropTemplateMixin and "TooltipBackdropTemplate") or (BackdropTemplateMixin and "BackdropTemplate")
+ tooltip = CreateFrame("Frame", nil, UIParent, template)
- local scrollFrame = CreateFrame("ScrollFrame", nil, tooltip)
- scrollFrame:SetPoint("TOP", tooltip, "TOP", 0, -TOOLTIP_PADDING)
- scrollFrame:SetPoint("BOTTOM", tooltip, "BOTTOM", 0, TOOLTIP_PADDING)
- scrollFrame:SetPoint("LEFT", tooltip, "LEFT", TOOLTIP_PADDING, 0)
- scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0)
- tooltip.scrollFrame = scrollFrame
+ local scrollFrame = CreateFrame("ScrollFrame", nil, tooltip)
+ scrollFrame:SetPoint("TOP", tooltip, "TOP", 0, -TOOLTIP_PADDING)
+ scrollFrame:SetPoint("BOTTOM", tooltip, "BOTTOM", 0, TOOLTIP_PADDING)
+ scrollFrame:SetPoint("LEFT", tooltip, "LEFT", TOOLTIP_PADDING, 0)
+ scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0)
+ tooltip.scrollFrame = scrollFrame
- local scrollChild = CreateFrame("Frame", nil, tooltip.scrollFrame)
- scrollFrame:SetScrollChild(scrollChild)
- tooltip.scrollChild = scrollChild
+ local scrollChild = CreateFrame("Frame", nil, tooltip.scrollFrame)
+ scrollFrame:SetScrollChild(scrollChild)
+ tooltip.scrollChild = scrollChild
- setmetatable(tooltip, tipMetatable)
- end
+ setmetatable(tooltip, tipMetatable)
+ end
- --[===[@debug@
- usedTooltips = usedTooltips + 1
- --@end-debug@]===]
- return tooltip
+ --[===[@debug@
+ usedTooltips = usedTooltips + 1
+ --@end-debug@]===]
+ return tooltip
end
-- Cleans the tooltip and stores it in the cache
function ReleaseTooltip(tooltip)
- if tooltip.releasing then
- return
- end
+ if tooltip.releasing then
+ return
+ end
+
+ tooltip.releasing = true
+ tooltip:Hide()
+
+ local releaseHandler = lib.onReleaseHandlers[tooltip]
- tooltip.releasing = true
- tooltip:Hide()
+ if releaseHandler then
+ lib.onReleaseHandlers[tooltip] = nil
- local releaseHandler = lib.onReleaseHandlers[tooltip]
+ local success, errorMessage = pcall(releaseHandler, tooltip)
- if releaseHandler then
- lib.onReleaseHandlers[tooltip] = nil
+ if not success then
+ geterrorhandler()(errorMessage)
+ end
+ elseif tooltip.OnRelease then
+ local success, errorMessage = pcall(tooltip.OnRelease, tooltip)
+ if not success then
+ geterrorhandler()(errorMessage)
+ end
- local success, errorMessage = pcall(releaseHandler, tooltip)
+ tooltip.OnRelease = nil
+ end
- if not success then
- geterrorhandler()(errorMessage)
- end
- elseif tooltip.OnRelease then
- local success, errorMessage = pcall(tooltip.OnRelease, tooltip)
- if not success then
- geterrorhandler()(errorMessage)
- end
+ tooltip.releasing = nil
+ tooltip.key = nil
+ tooltip.step = nil
- tooltip.OnRelease = nil
- end
+ ClearTooltipScripts(tooltip)
- tooltip.releasing = nil
- tooltip.key = nil
- tooltip.step = nil
+ tooltip:SetAutoHideDelay(nil)
+ tooltip:ClearAllPoints()
+ tooltip:Clear()
- ClearTooltipScripts(tooltip)
+ if tooltip.slider then
+ tooltip.slider:SetValue(0)
+ tooltip.slider:Hide()
+ tooltip.scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0)
+ tooltip:EnableMouseWheel(false)
+ end
- tooltip:SetAutoHideDelay(nil)
- tooltip:ClearAllPoints()
- tooltip:Clear()
+ for i, column in ipairs(tooltip.columns) do
+ tooltip.columns[i] = ReleaseFrame(column)
+ end
- if tooltip.slider then
- tooltip.slider:SetValue(0)
- tooltip.slider:Hide()
- tooltip.scrollFrame:SetPoint("RIGHT", tooltip, "RIGHT", -TOOLTIP_PADDING, 0)
- tooltip:EnableMouseWheel(false)
- end
+ tooltip.columns = ReleaseTable(tooltip.columns)
+ tooltip.lines = ReleaseTable(tooltip.lines)
+ tooltip.colspans = ReleaseTable(tooltip.colspans)
- for i, column in ipairs(tooltip.columns) do
- tooltip.columns[i] = ReleaseFrame(column)
- end
+ layoutCleaner.registry[tooltip] = nil
- tooltip.columns = ReleaseTable(tooltip.columns)
- tooltip.lines = ReleaseTable(tooltip.lines)
- tooltip.colspans = ReleaseTable(tooltip.colspans)
+ if TooltipBackdropTemplateMixin and not tooltip.NineSlice then
+ -- don't recycle outdated tooltips into heap
+ tooltip = nil
+ end
- layoutCleaner.registry[tooltip] = nil
- tinsert(tooltipHeap, tooltip)
+ if tooltip then
+ tinsert(tooltipHeap, tooltip)
+ end
- highlightTexture:SetTexture(DEFAULT_HIGHLIGHT_TEXTURE_PATH)
- highlightTexture:SetTexCoord(0, 1, 0, 1)
+ highlightTexture:SetTexture(DEFAULT_HIGHLIGHT_TEXTURE_PATH)
+ highlightTexture:SetTexCoord(0, 1, 0, 1)
- --[===[@debug@
- usedTooltips = usedTooltips - 1
- --@end-debug@]===]
+ --[===[@debug@
+ usedTooltips = usedTooltips - 1
+ --@end-debug@]===]
end
------------------------------------------------------------------------------
@@ -478,36 +483,36 @@ end
------------------------------------------------------------------------------
-- Returns a cell for the given tooltip from the given provider
function AcquireCell(tooltip, provider)
- local cell = provider:AcquireCell(tooltip)
+ local cell = provider:AcquireCell(tooltip)
- cell:SetParent(tooltip.scrollChild)
- cell:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 3)
- cell._provider = provider
+ cell:SetParent(tooltip.scrollChild)
+ cell:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 3)
+ cell._provider = provider
- return cell
+ return cell
end
-- Cleans the cell hands it to its provider for storing
function ReleaseCell(cell)
- if cell.fontString and cell.r then
- cell.fontString:SetTextColor(cell.r, cell.g, cell.b, cell.a)
- end
+ if cell.fontString and cell.r then
+ cell.fontString:SetTextColor(cell.r, cell.g, cell.b, cell.a)
+ end
- cell._font = nil
- cell._justification = nil
- cell._colSpan = nil
- cell._line = nil
- cell._column = nil
+ cell._font = nil
+ cell._justification = nil
+ cell._colSpan = nil
+ cell._line = nil
+ cell._column = nil
- cell:Hide()
- cell:ClearAllPoints()
- cell:SetParent(nil)
- cell:SetBackdrop(nil)
+ cell:Hide()
+ cell:ClearAllPoints()
+ cell:SetParent(nil)
+ cell:SetBackdrop(nil)
- ClearFrameScripts(cell)
+ ClearFrameScripts(cell)
- cell._provider:ReleaseCell(cell)
- cell._provider = nil
+ cell._provider:ReleaseCell(cell)
+ cell._provider = nil
end
------------------------------------------------------------------------------
@@ -517,144 +522,153 @@ local tableHeap = lib.tableHeap
-- Returns a table
function AcquireTable()
- local tbl = tremove(tableHeap) or {}
- --[===[@debug@
- usedTables = usedTables + 1
- --@end-debug@]===]
- return tbl
+ local tbl = tremove(tableHeap) or {}
+ --[===[@debug@
+ usedTables = usedTables + 1
+ --@end-debug@]===]
+ return tbl
end
-- Cleans the table and stores it in the cache
function ReleaseTable(tableInstance)
- wipe(tableInstance)
- tinsert(tableHeap, tableInstance)
- --[===[@debug@
- usedTables = usedTables - 1
- --@end-debug@]===]
+ wipe(tableInstance)
+ tinsert(tableHeap, tableInstance)
+ --[===[@debug@
+ usedTables = usedTables - 1
+ --@end-debug@]===]
end
------------------------------------------------------------------------------
-- Tooltip prototype
------------------------------------------------------------------------------
function InitializeTooltip(tooltip, key)
- ----------------------------------------------------------------------
- -- (Re)set frame settings
- ----------------------------------------------------------------------
- local backdrop = GameTooltip:GetBackdrop()
-
- tooltip:SetBackdrop(backdrop)
-
- if backdrop then
- tooltip:SetBackdropColor(GameTooltip:GetBackdropColor())
- tooltip:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
- end
-
- tooltip:SetScale(GameTooltip:GetScale())
- tooltip:SetAlpha(1)
- tooltip:SetFrameStrata("TOOLTIP")
- tooltip:SetClampedToScreen(false)
-
- ----------------------------------------------------------------------
- -- Internal data. Since it's possible to Acquire twice without calling
- -- release, check for pre-existence.
- ----------------------------------------------------------------------
- tooltip.key = key
- tooltip.columns = tooltip.columns or AcquireTable()
- tooltip.lines = tooltip.lines or AcquireTable()
- tooltip.colspans = tooltip.colspans or AcquireTable()
- tooltip.regularFont = _G.GameTooltipText
- tooltip.headerFont = _G.GameTooltipHeaderText
- tooltip.labelProvider = labelProvider
- tooltip.cell_margin_h = tooltip.cell_margin_h or CELL_MARGIN_H
- tooltip.cell_margin_v = tooltip.cell_margin_v or CELL_MARGIN_V
-
- ----------------------------------------------------------------------
- -- Finishing procedures
- ----------------------------------------------------------------------
- tooltip:SetAutoHideDelay(nil)
- tooltip:Hide()
- ResetTooltipSize(tooltip)
+ ----------------------------------------------------------------------
+ -- (Re)set frame settings
+ ----------------------------------------------------------------------
+ if TooltipBackdropTemplateMixin then
+ tooltip.layoutType = GameTooltip.layoutType
+ NineSlicePanelMixin.OnLoad(tooltip.NineSlice)
+ if GameTooltip.layoutType then
+ tooltip.NineSlice:SetCenterColor(GameTooltip.NineSlice:GetCenterColor())
+ tooltip.NineSlice:SetBorderColor(GameTooltip.NineSlice:GetBorderColor())
+ end
+ else
+ local backdrop = GameTooltip:GetBackdrop()
+
+ tooltip:SetBackdrop(backdrop)
+
+ if backdrop then
+ tooltip:SetBackdropColor(GameTooltip:GetBackdropColor())
+ tooltip:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor())
+ end
+ end
+
+ tooltip:SetScale(GameTooltip:GetScale())
+ tooltip:SetAlpha(1)
+ tooltip:SetFrameStrata("TOOLTIP")
+ tooltip:SetClampedToScreen(false)
+
+ ----------------------------------------------------------------------
+ -- Internal data. Since it's possible to Acquire twice without calling
+ -- release, check for pre-existence.
+ ----------------------------------------------------------------------
+ tooltip.key = key
+ tooltip.columns = tooltip.columns or AcquireTable()
+ tooltip.lines = tooltip.lines or AcquireTable()
+ tooltip.colspans = tooltip.colspans or AcquireTable()
+ tooltip.regularFont = _G.GameTooltipText
+ tooltip.headerFont = _G.GameTooltipHeaderText
+ tooltip.labelProvider = labelProvider
+ tooltip.cell_margin_h = tooltip.cell_margin_h or CELL_MARGIN_H
+ tooltip.cell_margin_v = tooltip.cell_margin_v or CELL_MARGIN_V
+
+ ----------------------------------------------------------------------
+ -- Finishing procedures
+ ----------------------------------------------------------------------
+ tooltip:SetAutoHideDelay(nil)
+ tooltip:Hide()
+ ResetTooltipSize(tooltip)
end
function tipPrototype:SetDefaultProvider(myProvider)
- if not myProvider then
- return
- end
+ if not myProvider then
+ return
+ end
- self.labelProvider = myProvider
+ self.labelProvider = myProvider
end
function tipPrototype:GetDefaultProvider()
- return self.labelProvider
+ return self.labelProvider
end
local function checkJustification(justification, level, silent)
- if justification ~= "LEFT" and justification ~= "CENTER" and justification ~= "RIGHT" then
- if silent then
- return false
- end
- error("invalid justification, must one of LEFT, CENTER or RIGHT, not: " .. tostring(justification), level + 1)
- end
+ if justification ~= "LEFT" and justification ~= "CENTER" and justification ~= "RIGHT" then
+ if silent then
+ return false
+ end
+ error("invalid justification, must one of LEFT, CENTER or RIGHT, not: " .. tostring(justification), level + 1)
+ end
- return true
+ return true
end
function tipPrototype:SetColumnLayout(numColumns, ...)
- if type(numColumns) ~= "number" or numColumns < 1 then
- error("number of columns must be a positive number, not: " .. tostring(numColumns), 2)
- end
+ if type(numColumns) ~= "number" or numColumns < 1 then
+ error("number of columns must be a positive number, not: " .. tostring(numColumns), 2)
+ end
- for i = 1, numColumns do
- local justification = select(i, ...) or "LEFT"
+ for i = 1, numColumns do
+ local justification = select(i, ...) or "LEFT"
- checkJustification(justification, 2)
+ checkJustification(justification, 2)
- if self.columns[i] then
- self.columns[i].justification = justification
- else
- self:AddColumn(justification)
- end
- end
+ if self.columns[i] then
+ self.columns[i].justification = justification
+ else
+ self:AddColumn(justification)
+ end
+ end
end
function tipPrototype:AddColumn(justification)
- justification = justification or "LEFT"
- checkJustification(justification, 2)
+ justification = justification or "LEFT"
+ checkJustification(justification, 2)
- local colNum = #self.columns + 1
- local column = self.columns[colNum] or AcquireFrame(self.scrollChild)
+ local colNum = #self.columns + 1
+ local column = self.columns[colNum] or AcquireFrame(self.scrollChild)
- column:SetFrameLevel(self.scrollChild:GetFrameLevel() + 1)
- column.justification = justification
- column.width = 0
- column:SetWidth(1)
- column:SetPoint("TOP", self.scrollChild)
- column:SetPoint("BOTTOM", self.scrollChild)
+ column:SetFrameLevel(self.scrollChild:GetFrameLevel() + 1)
+ column.justification = justification
+ column.width = 0
+ column:SetWidth(1)
+ column:SetPoint("TOP", self.scrollChild)
+ column:SetPoint("BOTTOM", self.scrollChild)
- if colNum > 1 then
- local h_margin = self.cell_margin_h or CELL_MARGIN_H
+ if colNum > 1 then
+ local h_margin = self.cell_margin_h or CELL_MARGIN_H
- column:SetPoint("LEFT", self.columns[colNum - 1], "RIGHT", h_margin, 0)
- SetTooltipSize(self, self.width + h_margin, self.height)
- else
- column:SetPoint("LEFT", self.scrollChild)
- end
+ column:SetPoint("LEFT", self.columns[colNum - 1], "RIGHT", h_margin, 0)
+ SetTooltipSize(self, self.width + h_margin, self.height)
+ else
+ column:SetPoint("LEFT", self.scrollChild)
+ end
- column:Show()
- self.columns[colNum] = column
+ column:Show()
+ self.columns[colNum] = column
- return colNum
+ return colNum
end
------------------------------------------------------------------------------
-- Convenient methods
------------------------------------------------------------------------------
function tipPrototype:Release()
- lib:Release(self)
+ lib:Release(self)
end
function tipPrototype:IsAcquiredBy(key)
- return key ~= nil and self.key == key
+ return key ~= nil and self.key == key
end
------------------------------------------------------------------------------
@@ -663,774 +677,774 @@ end
local RawSetScript = lib.frameMetatable.__index.SetScript
function ClearTooltipScripts(tooltip)
- if tooltip.scripts then
- for scriptType in pairs(tooltip.scripts) do
- RawSetScript(tooltip, scriptType, nil)
- end
+ if tooltip.scripts then
+ for scriptType in pairs(tooltip.scripts) do
+ RawSetScript(tooltip, scriptType, nil)
+ end
- tooltip.scripts = ReleaseTable(tooltip.scripts)
- end
+ tooltip.scripts = ReleaseTable(tooltip.scripts)
+ end
end
function tipPrototype:SetScript(scriptType, handler)
- RawSetScript(self, scriptType, handler)
+ RawSetScript(self, scriptType, handler)
- if handler then
- if not self.scripts then
- self.scripts = AcquireTable()
- end
+ if handler then
+ if not self.scripts then
+ self.scripts = AcquireTable()
+ end
- self.scripts[scriptType] = true
- elseif self.scripts then
- self.scripts[scriptType] = nil
- end
+ self.scripts[scriptType] = true
+ elseif self.scripts then
+ self.scripts[scriptType] = nil
+ end
end
-- That might break some addons ; those addons were breaking other
-- addons' tooltip though.
function tipPrototype:HookScript()
- geterrorhandler()(":HookScript is not allowed on LibQTip tooltips")
+ geterrorhandler()(":HookScript is not allowed on LibQTip tooltips")
end
------------------------------------------------------------------------------
-- Scrollbar data and functions
------------------------------------------------------------------------------
local BACKDROP_SLIDER_8_8 = BACKDROP_SLIDER_8_8 or {
- bgFile = "Interface\\Buttons\\UI-SliderBar-Background",
- edgeFile = "Interface\\Buttons\\UI-SliderBar-Border",
- tile = true,
- tileEdge = true,
- tileSize = 8,
- edgeSize = 8,
- insets = { left = 3, right = 3, top = 6, bottom = 6 },
+ bgFile = "Interface\\Buttons\\UI-SliderBar-Background",
+ edgeFile = "Interface\\Buttons\\UI-SliderBar-Border",
+ tile = true,
+ tileEdge = true,
+ tileSize = 8,
+ edgeSize = 8,
+ insets = { left = 3, right = 3, top = 6, bottom = 6 },
};
local function slider_OnValueChanged(self)
- self.scrollFrame:SetVerticalScroll(self:GetValue())
+ self.scrollFrame:SetVerticalScroll(self:GetValue())
end
local function tooltip_OnMouseWheel(self, delta)
- local slider = self.slider
- local currentValue = slider:GetValue()
- local minValue, maxValue = slider:GetMinMaxValues()
- local stepValue = self.step or 10
+ local slider = self.slider
+ local currentValue = slider:GetValue()
+ local minValue, maxValue = slider:GetMinMaxValues()
+ local stepValue = self.step or 10
- if delta < 0 and currentValue < maxValue then
- slider:SetValue(min(maxValue, currentValue + stepValue))
- elseif delta > 0 and currentValue > minValue then
- slider:SetValue(max(minValue, currentValue - stepValue))
- end
+ if delta < 0 and currentValue < maxValue then
+ slider:SetValue(min(maxValue, currentValue + stepValue))
+ elseif delta > 0 and currentValue > minValue then
+ slider:SetValue(max(minValue, currentValue - stepValue))
+ end
end
-- Set the step size for the scroll bar
function tipPrototype:SetScrollStep(step)
- self.step = step
+ self.step = step
end
-- will resize the tooltip to fit the screen and show a scrollbar if needed
function tipPrototype:UpdateScrolling(maxheight)
- self:SetClampedToScreen(false)
+ self:SetClampedToScreen(false)
- -- all data is in the tooltip; fix colspan width and prevent the layout cleaner from messing up the tooltip later
- FixCellSizes(self)
- layoutCleaner.registry[self] = nil
+ -- all data is in the tooltip; fix colspan width and prevent the layout cleaner from messing up the tooltip later
+ FixCellSizes(self)
+ layoutCleaner.registry[self] = nil
- local scale = self:GetScale()
- local topside = self:GetTop()
- local bottomside = self:GetBottom()
- local screensize = UIParent:GetHeight() / scale
- local tipsize = (topside - bottomside)
+ local scale = self:GetScale()
+ local topside = self:GetTop()
+ local bottomside = self:GetBottom()
+ local screensize = UIParent:GetHeight() / scale
+ local tipsize = (topside - bottomside)
- -- if the tooltip would be too high, limit its height and show the slider
- if bottomside < 0 or topside > screensize or (maxheight and tipsize > maxheight) then
- local shrink = (bottomside < 0 and (5 - bottomside) or 0) + (topside > screensize and (topside - screensize + 5) or 0)
+ -- if the tooltip would be too high, limit its height and show the slider
+ if bottomside < 0 or topside > screensize or (maxheight and tipsize > maxheight) then
+ local shrink = (bottomside < 0 and (5 - bottomside) or 0) + (topside > screensize and (topside - screensize + 5) or 0)
- if maxheight and tipsize - shrink > maxheight then
- shrink = tipsize - maxheight
- end
+ if maxheight and tipsize - shrink > maxheight then
+ shrink = tipsize - maxheight
+ end
- self:SetHeight(2 * TOOLTIP_PADDING + self.height - shrink)
- self:SetWidth(2 * TOOLTIP_PADDING + self.width + 20)
- self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -(TOOLTIP_PADDING + 20), 0)
+ self:SetHeight(2 * TOOLTIP_PADDING + self.height - shrink)
+ self:SetWidth(2 * TOOLTIP_PADDING + self.width + 20)
+ self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -(TOOLTIP_PADDING + 20), 0)
- if not self.slider then
- local slider = CreateFrame("Slider", nil, self, BackdropTemplateMixin and "BackdropTemplate")
- slider.scrollFrame = self.scrollFrame
+ if not self.slider then
+ local slider = CreateFrame("Slider", nil, self, BackdropTemplateMixin and "BackdropTemplate")
+ slider.scrollFrame = self.scrollFrame
- slider:SetOrientation("VERTICAL")
- slider:SetPoint("TOPRIGHT", self, "TOPRIGHT", -TOOLTIP_PADDING, -TOOLTIP_PADDING)
- slider:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -TOOLTIP_PADDING, TOOLTIP_PADDING)
- slider:SetBackdrop(BACKDROP_SLIDER_8_8)
- slider:SetThumbTexture([[Interface\Buttons\UI-SliderBar-Button-Vertical]])
- slider:SetMinMaxValues(0, 1)
- slider:SetValueStep(1)
- slider:SetWidth(12)
- slider:SetScript("OnValueChanged", slider_OnValueChanged)
- slider:SetValue(0)
+ slider:SetOrientation("VERTICAL")
+ slider:SetPoint("TOPRIGHT", self, "TOPRIGHT", -TOOLTIP_PADDING, -TOOLTIP_PADDING)
+ slider:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -TOOLTIP_PADDING, TOOLTIP_PADDING)
+ slider:SetBackdrop(BACKDROP_SLIDER_8_8)
+ slider:SetThumbTexture([[Interface\Buttons\UI-SliderBar-Button-Vertical]])
+ slider:SetMinMaxValues(0, 1)
+ slider:SetValueStep(1)
+ slider:SetWidth(12)
+ slider:SetScript("OnValueChanged", slider_OnValueChanged)
+ slider:SetValue(0)
- self.slider = slider
- end
+ self.slider = slider
+ end
- self.slider:SetMinMaxValues(0, shrink)
- self.slider:Show()
+ self.slider:SetMinMaxValues(0, shrink)
+ self.slider:Show()
- self:EnableMouseWheel(true)
- self:SetScript("OnMouseWheel", tooltip_OnMouseWheel)
- else
- self:SetHeight(2 * TOOLTIP_PADDING + self.height)
- self:SetWidth(2 * TOOLTIP_PADDING + self.width)
+ self:EnableMouseWheel(true)
+ self:SetScript("OnMouseWheel", tooltip_OnMouseWheel)
+ else
+ self:SetHeight(2 * TOOLTIP_PADDING + self.height)
+ self:SetWidth(2 * TOOLTIP_PADDING + self.width)
- self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -TOOLTIP_PADDING, 0)
+ self.scrollFrame:SetPoint("RIGHT", self, "RIGHT", -TOOLTIP_PADDING, 0)
- if self.slider then
- self.slider:SetValue(0)
- self.slider:Hide()
+ if self.slider then
+ self.slider:SetValue(0)
+ self.slider:Hide()
- self:EnableMouseWheel(false)
- self:SetScript("OnMouseWheel", nil)
- end
- end
+ self:EnableMouseWheel(false)
+ self:SetScript("OnMouseWheel", nil)
+ end
+ end
end
------------------------------------------------------------------------------
-- Tooltip methods for changing its contents.
------------------------------------------------------------------------------
function tipPrototype:Clear()
- for i, line in ipairs(self.lines) do
- for _, cell in pairs(line.cells) do
- if cell then
- ReleaseCell(cell)
- end
- end
+ for i, line in ipairs(self.lines) do
+ for _, cell in pairs(line.cells) do
+ if cell then
+ ReleaseCell(cell)
+ end
+ end
- ReleaseTable(line.cells)
+ ReleaseTable(line.cells)
- line.cells = nil
- line.is_header = nil
+ line.cells = nil
+ line.is_header = nil
- ReleaseFrame(line)
+ ReleaseFrame(line)
- self.lines[i] = nil
- end
+ self.lines[i] = nil
+ end
- for _, column in ipairs(self.columns) do
- column.width = 0
- column:SetWidth(1)
- end
+ for _, column in ipairs(self.columns) do
+ column.width = 0
+ column:SetWidth(1)
+ end
- wipe(self.colspans)
+ wipe(self.colspans)
- self.cell_margin_h = nil
- self.cell_margin_v = nil
+ self.cell_margin_h = nil
+ self.cell_margin_v = nil
- ResetTooltipSize(self)
+ ResetTooltipSize(self)
end
function tipPrototype:SetCellMarginH(size)
- if #self.lines > 0 then
- error("Unable to set horizontal margin while the tooltip has lines.", 2)
- end
+ if #self.lines > 0 then
+ error("Unable to set horizontal margin while the tooltip has lines.", 2)
+ end
- if not size or type(size) ~= "number" or size < 0 then
- error("Margin size must be a positive number or zero.", 2)
- end
+ if not size or type(size) ~= "number" or size < 0 then
+ error("Margin size must be a positive number or zero.", 2)
+ end
- self.cell_margin_h = size
+ self.cell_margin_h = size
end
function tipPrototype:SetCellMarginV(size)
- if #self.lines > 0 then
- error("Unable to set vertical margin while the tooltip has lines.", 2)
- end
+ if #self.lines > 0 then
+ error("Unable to set vertical margin while the tooltip has lines.", 2)
+ end
- if not size or type(size) ~= "number" or size < 0 then
- error("Margin size must be a positive number or zero.", 2)
- end
+ if not size or type(size) ~= "number" or size < 0 then
+ error("Margin size must be a positive number or zero.", 2)
+ end
- self.cell_margin_v = size
+ self.cell_margin_v = size
end
function SetTooltipSize(tooltip, width, height)
- tooltip.height = height
- tooltip.width = width
+ tooltip.height = height
+ tooltip.width = width
- tooltip:SetHeight(2 * TOOLTIP_PADDING + height)
- tooltip:SetWidth(2 * TOOLTIP_PADDING + width)
+ tooltip:SetHeight(2 * TOOLTIP_PADDING + height)
+ tooltip:SetWidth(2 * TOOLTIP_PADDING + width)
- tooltip.scrollChild:SetHeight(height)
- tooltip.scrollChild:SetWidth(width)
+ tooltip.scrollChild:SetHeight(height)
+ tooltip.scrollChild:SetWidth(width)
end
-- Add 2 pixels to height so dangling letters (g, y, p, j, etc) are not clipped.
function ResetTooltipSize(tooltip)
- local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H
+ local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H
- SetTooltipSize(tooltip, max(0, (h_margin * (#tooltip.columns - 1)) + (h_margin / 2)), 2)
+ SetTooltipSize(tooltip, max(0, (h_margin * (#tooltip.columns - 1)) + (h_margin / 2)), 2)
end
local function EnlargeColumn(tooltip, column, width)
- if width > column.width then
- SetTooltipSize(tooltip, tooltip.width + width - column.width, tooltip.height)
+ if width > column.width then
+ SetTooltipSize(tooltip, tooltip.width + width - column.width, tooltip.height)
- column.width = width
- column:SetWidth(width)
- end
+ column.width = width
+ column:SetWidth(width)
+ end
end
local function ResizeLine(tooltip, line, height)
- SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height)
+ SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height)
- line.height = height
- line:SetHeight(height)
+ line.height = height
+ line:SetHeight(height)
end
function FixCellSizes(tooltip)
- local columns = tooltip.columns
- local colspans = tooltip.colspans
- local lines = tooltip.lines
- local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H
-
- -- resize columns to make room for the colspans
- while next(colspans) do
- local maxNeedCols
- local maxNeedWidthPerCol = 0
-
- -- calculate the colspan with the highest additional width need per column
- for colRange, width in pairs(colspans) do
- local left, right = colRange:match("^(%d+)%-(%d+)$")
-
- left, right = tonumber(left), tonumber(right)
-
- for col = left, right - 1 do
- width = width - columns[col].width - h_margin
- end
-
- width = width - columns[right].width
-
- if width <= 0 then
- colspans[colRange] = nil
- else
- width = width / (right - left + 1)
-
- if width > maxNeedWidthPerCol then
- maxNeedCols = colRange
- maxNeedWidthPerCol = width
- end
- end
- end
-
- -- resize all columns for that colspan
- if maxNeedCols then
- local left, right = maxNeedCols:match("^(%d+)%-(%d+)$")
-
- for col = left, right do
- EnlargeColumn(tooltip, columns[col], columns[col].width + maxNeedWidthPerCol)
- end
-
- colspans[maxNeedCols] = nil
- end
- end
-
- --now that the cell width is set, recalculate the rows' height
- for _, line in ipairs(lines) do
- if #(line.cells) > 0 then
- local lineheight = 0
-
- for _, cell in pairs(line.cells) do
- if cell then
- lineheight = max(lineheight, cell:getContentHeight())
- end
- end
-
- if lineheight > 0 then
- ResizeLine(tooltip, line, lineheight)
- end
- end
- end
+ local columns = tooltip.columns
+ local colspans = tooltip.colspans
+ local lines = tooltip.lines
+ local h_margin = tooltip.cell_margin_h or CELL_MARGIN_H
+
+ -- resize columns to make room for the colspans
+ while next(colspans) do
+ local maxNeedCols
+ local maxNeedWidthPerCol = 0
+
+ -- calculate the colspan with the highest additional width need per column
+ for colRange, width in pairs(colspans) do
+ local left, right = colRange:match("^(%d+)%-(%d+)$")
+
+ left, right = tonumber(left), tonumber(right)
+
+ for col = left, right - 1 do
+ width = width - columns[col].width - h_margin
+ end
+
+ width = width - columns[right].width
+
+ if width <= 0 then
+ colspans[colRange] = nil
+ else
+ width = width / (right - left + 1)
+
+ if width > maxNeedWidthPerCol then
+ maxNeedCols = colRange
+ maxNeedWidthPerCol = width
+ end
+ end
+ end
+
+ -- resize all columns for that colspan
+ if maxNeedCols then
+ local left, right = maxNeedCols:match("^(%d+)%-(%d+)$")
+
+ for col = left, right do
+ EnlargeColumn(tooltip, columns[col], columns[col].width + maxNeedWidthPerCol)
+ end
+
+ colspans[maxNeedCols] = nil
+ end
+ end
+
+ --now that the cell width is set, recalculate the rows' height
+ for _, line in ipairs(lines) do
+ if #(line.cells) > 0 then
+ local lineheight = 0
+
+ for _, cell in pairs(line.cells) do
+ if cell then
+ lineheight = max(lineheight, cell:getContentHeight())
+ end
+ end
+
+ if lineheight > 0 then
+ ResizeLine(tooltip, line, lineheight)
+ end
+ end
+ end
end
local function _SetCell(tooltip, lineNum, colNum, value, font, justification, colSpan, provider, ...)
- local line = tooltip.lines[lineNum]
- local cells = line.cells
-
- -- Unset: be quick
- if value == nil then
- local cell = cells[colNum]
-
- if cell then
- for i = colNum, colNum + cell._colSpan - 1 do
- cells[i] = nil
- end
-
- ReleaseCell(cell)
- end
-
- return lineNum, colNum
- end
-
- font = font or (line.is_header and tooltip.headerFont or tooltip.regularFont)
-
- -- Check previous cell
- local cell
- local prevCell = cells[colNum]
-
- if prevCell then
- -- There is a cell here
- justification = justification or prevCell._justification
- colSpan = colSpan or prevCell._colSpan
-
- -- Clear the currently marked colspan
- for i = colNum + 1, colNum + prevCell._colSpan - 1 do
- cells[i] = nil
- end
-
- if provider == nil or prevCell._provider == provider then
- -- Reuse existing cell
- cell = prevCell
- provider = cell._provider
- else
- -- A new cell is required
- cells[colNum] = ReleaseCell(prevCell)
- end
- elseif prevCell == nil then
- -- Creating a new cell, using meaningful defaults.
- provider = provider or tooltip.labelProvider
- justification = justification or tooltip.columns[colNum].justification or "LEFT"
- colSpan = colSpan or 1
- else
- error("overlapping cells at column " .. colNum, 3)
- end
-
- local tooltipWidth = #tooltip.columns
- local rightColNum
-
- if colSpan > 0 then
- rightColNum = colNum + colSpan - 1
-
- if rightColNum > tooltipWidth then
- error("ColSpan too big, cell extends beyond right-most column", 3)
- end
- else
- -- Zero or negative: count back from right-most columns
- rightColNum = max(colNum, tooltipWidth + colSpan)
- -- Update colspan to its effective value
- colSpan = 1 + rightColNum - colNum
- end
-
- -- Cleanup colspans
- for i = colNum + 1, rightColNum do
- local columnCell = cells[i]
-
- if columnCell then
- ReleaseCell(columnCell)
- elseif columnCell == false then
- error("overlapping cells at column " .. i, 3)
- end
-
- cells[i] = false
- end
-
- -- Create the cell
- if not cell then
- cell = AcquireCell(tooltip, provider)
- cells[colNum] = cell
- end
-
- -- Anchor the cell
- cell:SetPoint("LEFT", tooltip.columns[colNum])
- cell:SetPoint("RIGHT", tooltip.columns[rightColNum])
- cell:SetPoint("TOP", line)
- cell:SetPoint("BOTTOM", line)
-
- -- Store the cell settings directly into the cell
- -- That's a bit risky but is really cheap compared to other ways to do it
- cell._font, cell._justification, cell._colSpan, cell._line, cell._column = font, justification, colSpan, lineNum, colNum
-
- -- Setup the cell content
- local width, height = cell:SetupCell(tooltip, value, justification, font, ...)
- cell:Show()
-
- if colSpan > 1 then
- -- Postpone width changes until the tooltip is shown
- local colRange = colNum .. "-" .. rightColNum
-
- tooltip.colspans[colRange] = max(tooltip.colspans[colRange] or 0, width)
- layoutCleaner:RegisterForCleanup(tooltip)
- else
- -- Enlarge the column and tooltip if need be
- EnlargeColumn(tooltip, tooltip.columns[colNum], width)
- end
-
- -- Enlarge the line and tooltip if need be
- if height > line.height then
- SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height)
-
- line.height = height
- line:SetHeight(height)
- end
-
- if rightColNum < tooltipWidth then
- return lineNum, rightColNum + 1
- else
- return lineNum, nil
- end
+ local line = tooltip.lines[lineNum]
+ local cells = line.cells
+
+ -- Unset: be quick
+ if value == nil then
+ local cell = cells[colNum]
+
+ if cell then
+ for i = colNum, colNum + cell._colSpan - 1 do
+ cells[i] = nil
+ end
+
+ ReleaseCell(cell)
+ end
+
+ return lineNum, colNum
+ end
+
+ font = font or (line.is_header and tooltip.headerFont or tooltip.regularFont)
+
+ -- Check previous cell
+ local cell
+ local prevCell = cells[colNum]
+
+ if prevCell then
+ -- There is a cell here
+ justification = justification or prevCell._justification
+ colSpan = colSpan or prevCell._colSpan
+
+ -- Clear the currently marked colspan
+ for i = colNum + 1, colNum + prevCell._colSpan - 1 do
+ cells[i] = nil
+ end
+
+ if provider == nil or prevCell._provider == provider then
+ -- Reuse existing cell
+ cell = prevCell
+ provider = cell._provider
+ else
+ -- A new cell is required
+ cells[colNum] = ReleaseCell(prevCell)
+ end
+ elseif prevCell == nil then
+ -- Creating a new cell, using meaningful defaults.
+ provider = provider or tooltip.labelProvider
+ justification = justification or tooltip.columns[colNum].justification or "LEFT"
+ colSpan = colSpan or 1
+ else
+ error("overlapping cells at column " .. colNum, 3)
+ end
+
+ local tooltipWidth = #tooltip.columns
+ local rightColNum
+
+ if colSpan > 0 then
+ rightColNum = colNum + colSpan - 1
+
+ if rightColNum > tooltipWidth then
+ error("ColSpan too big, cell extends beyond right-most column", 3)
+ end
+ else
+ -- Zero or negative: count back from right-most columns
+ rightColNum = max(colNum, tooltipWidth + colSpan)
+ -- Update colspan to its effective value
+ colSpan = 1 + rightColNum - colNum
+ end
+
+ -- Cleanup colspans
+ for i = colNum + 1, rightColNum do
+ local columnCell = cells[i]
+
+ if columnCell then
+ ReleaseCell(columnCell)
+ elseif columnCell == false then
+ error("overlapping cells at column " .. i, 3)
+ end
+
+ cells[i] = false
+ end
+
+ -- Create the cell
+ if not cell then
+ cell = AcquireCell(tooltip, provider)
+ cells[colNum] = cell
+ end
+
+ -- Anchor the cell
+ cell:SetPoint("LEFT", tooltip.columns[colNum])
+ cell:SetPoint("RIGHT", tooltip.columns[rightColNum])
+ cell:SetPoint("TOP", line)
+ cell:SetPoint("BOTTOM", line)
+
+ -- Store the cell settings directly into the cell
+ -- That's a bit risky but is really cheap compared to other ways to do it
+ cell._font, cell._justification, cell._colSpan, cell._line, cell._column = font, justification, colSpan, lineNum, colNum
+
+ -- Setup the cell content
+ local width, height = cell:SetupCell(tooltip, value, justification, font, ...)
+ cell:Show()
+
+ if colSpan > 1 then
+ -- Postpone width changes until the tooltip is shown
+ local colRange = colNum .. "-" .. rightColNum
+
+ tooltip.colspans[colRange] = max(tooltip.colspans[colRange] or 0, width)
+ layoutCleaner:RegisterForCleanup(tooltip)
+ else
+ -- Enlarge the column and tooltip if need be
+ EnlargeColumn(tooltip, tooltip.columns[colNum], width)
+ end
+
+ -- Enlarge the line and tooltip if need be
+ if height > line.height then
+ SetTooltipSize(tooltip, tooltip.width, tooltip.height + height - line.height)
+
+ line.height = height
+ line:SetHeight(height)
+ end
+
+ if rightColNum < tooltipWidth then
+ return lineNum, rightColNum + 1
+ else
+ return lineNum, nil
+ end
end
do
- local function CreateLine(tooltip, font, ...)
- if #tooltip.columns == 0 then
- error("column layout should be defined before adding line", 3)
- end
+ local function CreateLine(tooltip, font, ...)
+ if #tooltip.columns == 0 then
+ error("column layout should be defined before adding line", 3)
+ end
- local lineNum = #tooltip.lines + 1
- local line = tooltip.lines[lineNum] or AcquireFrame(tooltip.scrollChild)
+ local lineNum = #tooltip.lines + 1
+ local line = tooltip.lines[lineNum] or AcquireFrame(tooltip.scrollChild)
- line:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 2)
- line:SetPoint("LEFT", tooltip.scrollChild)
- line:SetPoint("RIGHT", tooltip.scrollChild)
+ line:SetFrameLevel(tooltip.scrollChild:GetFrameLevel() + 2)
+ line:SetPoint("LEFT", tooltip.scrollChild)
+ line:SetPoint("RIGHT", tooltip.scrollChild)
- if lineNum > 1 then
- local v_margin = tooltip.cell_margin_v or CELL_MARGIN_V
+ if lineNum > 1 then
+ local v_margin = tooltip.cell_margin_v or CELL_MARGIN_V
- line:SetPoint("TOP", tooltip.lines[lineNum - 1], "BOTTOM", 0, -v_margin)
- SetTooltipSize(tooltip, tooltip.width, tooltip.height + v_margin)
- else
- line:SetPoint("TOP", tooltip.scrollChild)
- end
+ line:SetPoint("TOP", tooltip.lines[lineNum - 1], "BOTTOM", 0, -v_margin)
+ SetTooltipSize(tooltip, tooltip.width, tooltip.height + v_margin)
+ else
+ line:SetPoint("TOP", tooltip.scrollChild)
+ end
- tooltip.lines[lineNum] = line
+ tooltip.lines[lineNum] = line
- line.cells = line.cells or AcquireTable()
- line.height = 0
- line:SetHeight(1)
- line:Show()
+ line.cells = line.cells or AcquireTable()
+ line.height = 0
+ line:SetHeight(1)
+ line:Show()
- local colNum = 1
+ local colNum = 1
- for i = 1, #tooltip.columns do
- local value = select(i, ...)
+ for i = 1, #tooltip.columns do
+ local value = select(i, ...)
- if value ~= nil then
- lineNum, colNum = _SetCell(tooltip, lineNum, i, value, font, nil, 1, tooltip.labelProvider)
- end
- end
+ if value ~= nil then
+ lineNum, colNum = _SetCell(tooltip, lineNum, i, value, font, nil, 1, tooltip.labelProvider)
+ end
+ end
- return lineNum, colNum
- end
+ return lineNum, colNum
+ end
- function tipPrototype:AddLine(...)
- return CreateLine(self, self.regularFont, ...)
- end
+ function tipPrototype:AddLine(...)
+ return CreateLine(self, self.regularFont, ...)
+ end
- function tipPrototype:AddHeader(...)
- local line, col = CreateLine(self, self.headerFont, ...)
+ function tipPrototype:AddHeader(...)
+ local line, col = CreateLine(self, self.headerFont, ...)
- self.lines[line].is_header = true
+ self.lines[line].is_header = true
- return line, col
- end
+ return line, col
+ end
end -- do-block
local GenericBackdrop = {
- bgFile = "Interface\\Tooltips\\UI-Tooltip-Background"
+ bgFile = "Interface\\Tooltips\\UI-Tooltip-Background"
}
function tipPrototype:AddSeparator(height, r, g, b, a)
- local lineNum, colNum = self:AddLine()
- local line = self.lines[lineNum]
- local color = _G.NORMAL_FONT_COLOR
+ local lineNum, colNum = self:AddLine()
+ local line = self.lines[lineNum]
+ local color = _G.NORMAL_FONT_COLOR
- height = height or 1
+ height = height or 1
- SetTooltipSize(self, self.width, self.height + height)
+ SetTooltipSize(self, self.width, self.height + height)
- line.height = height
- line:SetHeight(height)
- line:SetBackdrop(GenericBackdrop)
- line:SetBackdropColor(r or color.r, g or color.g, b or color.b, a or 1)
+ line.height = height
+ line:SetHeight(height)
+ line:SetBackdrop(GenericBackdrop)
+ line:SetBackdropColor(r or color.r, g or color.g, b or color.b, a or 1)
- return lineNum, colNum
+ return lineNum, colNum
end
function tipPrototype:SetCellColor(lineNum, colNum, r, g, b, a)
- local cell = self.lines[lineNum].cells[colNum]
+ local cell = self.lines[lineNum].cells[colNum]
- if cell then
- local sr, sg, sb, sa = self:GetBackdropColor()
+ if cell then
+ local sr, sg, sb, sa = self:GetBackdropColor()
- cell:SetBackdrop(GenericBackdrop)
- cell:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
- end
+ cell:SetBackdrop(GenericBackdrop)
+ cell:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
+ end
end
function tipPrototype:SetColumnColor(colNum, r, g, b, a)
- local column = self.columns[colNum]
+ local column = self.columns[colNum]
- if column then
- local sr, sg, sb, sa = self:GetBackdropColor()
- column:SetBackdrop(GenericBackdrop)
- column:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
- end
+ if column then
+ local sr, sg, sb, sa = self:GetBackdropColor()
+ column:SetBackdrop(GenericBackdrop)
+ column:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
+ end
end
function tipPrototype:SetLineColor(lineNum, r, g, b, a)
- local line = self.lines[lineNum]
+ local line = self.lines[lineNum]
- if line then
- local sr, sg, sb, sa = self:GetBackdropColor()
+ if line then
+ local sr, sg, sb, sa = self:GetBackdropColor()
- line:SetBackdrop(GenericBackdrop)
- line:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
- end
+ line:SetBackdrop(GenericBackdrop)
+ line:SetBackdropColor(r or sr, g or sg, b or sb, a or sa)
+ end
end
function tipPrototype:SetCellTextColor(lineNum, colNum, r, g, b, a)
- local line = self.lines[lineNum]
- local column = self.columns[colNum]
+ local line = self.lines[lineNum]
+ local column = self.columns[colNum]
- if not line or not column then
- return
- end
+ if not line or not column then
+ return
+ end
- local cell = self.lines[lineNum].cells[colNum]
+ local cell = self.lines[lineNum].cells[colNum]
- if cell then
- if not cell.fontString then
- error("cell's label provider did not assign a fontString field", 2)
- end
+ if cell then
+ if not cell.fontString then
+ error("cell's label provider did not assign a fontString field", 2)
+ end
- if not cell.r then
- cell.r, cell.g, cell.b, cell.a = cell.fontString:GetTextColor()
- end
+ if not cell.r then
+ cell.r, cell.g, cell.b, cell.a = cell.fontString:GetTextColor()
+ end
- cell.fontString:SetTextColor(r or cell.r, g or cell.g, b or cell.b, a or cell.a)
- end
+ cell.fontString:SetTextColor(r or cell.r, g or cell.g, b or cell.b, a or cell.a)
+ end
end
function tipPrototype:SetColumnTextColor(colNum, r, g, b, a)
- if not self.columns[colNum] then
- return
- end
+ if not self.columns[colNum] then
+ return
+ end
- for lineIndex = 1, #self.lines do
- self:SetCellTextColor(lineIndex, colNum, r, g, b, a)
- end
+ for lineIndex = 1, #self.lines do
+ self:SetCellTextColor(lineIndex, colNum, r, g, b, a)
+ end
end
function tipPrototype:SetLineTextColor(lineNum, r, g, b, a)
- local line = self.lines[lineNum]
+ local line = self.lines[lineNum]
- if not line then
- return
- end
+ if not line then
+ return
+ end
- for cellIndex = 1, #line.cells do
- self:SetCellTextColor(lineNum, line.cells[cellIndex]._column, r, g, b, a)
- end
+ for cellIndex = 1, #line.cells do
+ self:SetCellTextColor(lineNum, line.cells[cellIndex]._column, r, g, b, a)
+ end
end
function tipPrototype:SetHighlightTexture(...)
- return highlightTexture:SetTexture(...)
+ return highlightTexture:SetTexture(...)
end
function tipPrototype:SetHighlightTexCoord(...)
- highlightTexture:SetTexCoord(...)
+ highlightTexture:SetTexCoord(...)
end
do
- local function checkFont(font, level, silent)
- local bad = false
-
- if not font then
- bad = true
- elseif type(font) == "string" then
- local ref = _G[font]
-
- if not ref or type(ref) ~= "table" or type(ref.IsObjectType) ~= "function" or not ref:IsObjectType("Font") then
- bad = true
- end
- elseif type(font) ~= "table" or type(font.IsObjectType) ~= "function" or not font:IsObjectType("Font") then
- bad = true
- end
-
- if bad then
- if silent then
- return false
- end
-
- error("font must be a Font instance or a string matching the name of a global Font instance, not: " .. tostring(font), level + 1)
- end
- return true
- end
-
- function tipPrototype:SetFont(font)
- local is_string = type(font) == "string"
-
- checkFont(font, 2)
- self.regularFont = is_string and _G[font] or font
- end
-
- function tipPrototype:SetHeaderFont(font)
- local is_string = type(font) == "string"
-
- checkFont(font, 2)
- self.headerFont = is_string and _G[font] or font
- end
-
- -- TODO: fixed argument positions / remove checks for performance?
- function tipPrototype:SetCell(lineNum, colNum, value, ...)
- -- Mandatory argument checking
- if type(lineNum) ~= "number" then
- error("line number must be a number, not: " .. tostring(lineNum), 2)
- elseif lineNum < 1 or lineNum > #self.lines then
- error("line number out of range: " .. tostring(lineNum), 2)
- elseif type(colNum) ~= "number" then
- error("column number must be a number, not: " .. tostring(colNum), 2)
- elseif colNum < 1 or colNum > #self.columns then
- error("column number out of range: " .. tostring(colNum), 2)
- end
-
- -- Variable argument checking
- local font, justification, colSpan, provider
- local i, arg = 1, ...
-
- if arg == nil or checkFont(arg, 2, true) then
- i, font, arg = 2, ...
- end
-
- if arg == nil or checkJustification(arg, 2, true) then
- i, justification, arg = i + 1, select(i, ...)
- end
-
- if arg == nil or type(arg) == "number" then
- i, colSpan, arg = i + 1, select(i, ...)
- end
-
- if arg == nil or type(arg) == "table" and type(arg.AcquireCell) == "function" then
- i, provider = i + 1, arg
- end
-
- return _SetCell(self, lineNum, colNum, value, font, justification, colSpan, provider, select(i, ...))
- end
+ local function checkFont(font, level, silent)
+ local bad = false
+
+ if not font then
+ bad = true
+ elseif type(font) == "string" then
+ local ref = _G[font]
+
+ if not ref or type(ref) ~= "table" or type(ref.IsObjectType) ~= "function" or not ref:IsObjectType("Font") then
+ bad = true
+ end
+ elseif type(font) ~= "table" or type(font.IsObjectType) ~= "function" or not font:IsObjectType("Font") then
+ bad = true
+ end
+
+ if bad then
+ if silent then
+ return false
+ end
+
+ error("font must be a Font instance or a string matching the name of a global Font instance, not: " .. tostring(font), level + 1)
+ end
+ return true
+ end
+
+ function tipPrototype:SetFont(font)
+ local is_string = type(font) == "string"
+
+ checkFont(font, 2)
+ self.regularFont = is_string and _G[font] or font
+ end
+
+ function tipPrototype:SetHeaderFont(font)
+ local is_string = type(font) == "string"
+
+ checkFont(font, 2)
+ self.headerFont = is_string and _G[font] or font
+ end
+
+ -- TODO: fixed argument positions / remove checks for performance?
+ function tipPrototype:SetCell(lineNum, colNum, value, ...)
+ -- Mandatory argument checking
+ if type(lineNum) ~= "number" then
+ error("line number must be a number, not: " .. tostring(lineNum), 2)
+ elseif lineNum < 1 or lineNum > #self.lines then
+ error("line number out of range: " .. tostring(lineNum), 2)
+ elseif type(colNum) ~= "number" then
+ error("column number must be a number, not: " .. tostring(colNum), 2)
+ elseif colNum < 1 or colNum > #self.columns then
+ error("column number out of range: " .. tostring(colNum), 2)
+ end
+
+ -- Variable argument checking
+ local font, justification, colSpan, provider
+ local i, arg = 1, ...
+
+ if arg == nil or checkFont(arg, 2, true) then
+ i, font, arg = 2, ...
+ end
+
+ if arg == nil or checkJustification(arg, 2, true) then
+ i, justification, arg = i + 1, select(i, ...)
+ end
+
+ if arg == nil or type(arg) == "number" then
+ i, colSpan, arg = i + 1, select(i, ...)
+ end
+
+ if arg == nil or type(arg) == "table" and type(arg.AcquireCell) == "function" then
+ i, provider = i + 1, arg
+ end
+
+ return _SetCell(self, lineNum, colNum, value, font, justification, colSpan, provider, select(i, ...))
+ end
end -- do-block
function tipPrototype:GetFont()
- return self.regularFont
+ return self.regularFont
end
function tipPrototype:GetHeaderFont()
- return self.headerFont
+ return self.headerFont
end
function tipPrototype:GetLineCount()
- return #self.lines
+ return #self.lines
end
function tipPrototype:GetColumnCount()
- return #self.columns
+ return #self.columns
end
------------------------------------------------------------------------------
-- Frame Scripts
------------------------------------------------------------------------------
local scripts = {
- OnEnter = function(frame, ...)
- highlightFrame:SetParent(frame)
- highlightFrame:SetAllPoints(frame)
- highlightFrame:Show()
-
- if frame._OnEnter_func then
- frame:_OnEnter_func(frame._OnEnter_arg, ...)
- end
- end,
- OnLeave = function(frame, ...)
- highlightFrame:Hide()
- highlightFrame:ClearAllPoints()
- highlightFrame:SetParent(nil)
-
- if frame._OnLeave_func then
- frame:_OnLeave_func(frame._OnLeave_arg, ...)
- end
- end,
- OnMouseDown = function(frame, ...)
- frame:_OnMouseDown_func(frame._OnMouseDown_arg, ...)
- end,
- OnMouseUp = function(frame, ...)
- frame:_OnMouseUp_func(frame._OnMouseUp_arg, ...)
- end,
- OnReceiveDrag = function(frame, ...)
- frame:_OnReceiveDrag_func(frame._OnReceiveDrag_arg, ...)
- end
+ OnEnter = function(frame, ...)
+ highlightFrame:SetParent(frame)
+ highlightFrame:SetAllPoints(frame)
+ highlightFrame:Show()
+
+ if frame._OnEnter_func then
+ frame:_OnEnter_func(frame._OnEnter_arg, ...)
+ end
+ end,
+ OnLeave = function(frame, ...)
+ highlightFrame:Hide()
+ highlightFrame:ClearAllPoints()
+ highlightFrame:SetParent(nil)
+
+ if frame._OnLeave_func then
+ frame:_OnLeave_func(frame._OnLeave_arg, ...)
+ end
+ end,
+ OnMouseDown = function(frame, ...)
+ frame:_OnMouseDown_func(frame._OnMouseDown_arg, ...)
+ end,
+ OnMouseUp = function(frame, ...)
+ frame:_OnMouseUp_func(frame._OnMouseUp_arg, ...)
+ end,
+ OnReceiveDrag = function(frame, ...)
+ frame:_OnReceiveDrag_func(frame._OnReceiveDrag_arg, ...)
+ end
}
function SetFrameScript(frame, script, func, arg)
- if not scripts[script] then
- return
- end
-
- frame["_" .. script .. "_func"] = func
- frame["_" .. script .. "_arg"] = arg
-
- if script == "OnMouseDown" or script == "OnMouseUp" or script == "OnReceiveDrag" then
- if func then
- frame:SetScript(script, scripts[script])
- else
- frame:SetScript(script, nil)
- end
- end
-
- -- if at least one script is set, set the OnEnter/OnLeave scripts for the highlight
- if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then
- frame:EnableMouse(true)
- frame:SetScript("OnEnter", scripts.OnEnter)
- frame:SetScript("OnLeave", scripts.OnLeave)
- else
- frame:EnableMouse(false)
- frame:SetScript("OnEnter", nil)
- frame:SetScript("OnLeave", nil)
- end
+ if not scripts[script] then
+ return
+ end
+
+ frame["_" .. script .. "_func"] = func
+ frame["_" .. script .. "_arg"] = arg
+
+ if script == "OnMouseDown" or script == "OnMouseUp" or script == "OnReceiveDrag" then
+ if func then
+ frame:SetScript(script, scripts[script])
+ else
+ frame:SetScript(script, nil)
+ end
+ end
+
+ -- if at least one script is set, set the OnEnter/OnLeave scripts for the highlight
+ if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then
+ frame:EnableMouse(true)
+ frame:SetScript("OnEnter", scripts.OnEnter)
+ frame:SetScript("OnLeave", scripts.OnLeave)
+ else
+ frame:EnableMouse(false)
+ frame:SetScript("OnEnter", nil)
+ frame:SetScript("OnLeave", nil)
+ end
end
function ClearFrameScripts(frame)
- if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then
- frame:EnableMouse(false)
+ if frame._OnEnter_func or frame._OnLeave_func or frame._OnMouseDown_func or frame._OnMouseUp_func or frame._OnReceiveDrag_func then
+ frame:EnableMouse(false)
- frame:SetScript("OnEnter", nil)
- frame._OnEnter_func = nil
- frame._OnEnter_arg = nil
+ frame:SetScript("OnEnter", nil)
+ frame._OnEnter_func = nil
+ frame._OnEnter_arg = nil
- frame:SetScript("OnLeave", nil)
- frame._OnLeave_func = nil
- frame._OnLeave_arg = nil
+ frame:SetScript("OnLeave", nil)
+ frame._OnLeave_func = nil
+ frame._OnLeave_arg = nil
- frame:SetScript("OnReceiveDrag", nil)
- frame._OnReceiveDrag_func = nil
- frame._OnReceiveDrag_arg = nil
+ frame:SetScript("OnReceiveDrag", nil)
+ frame._OnReceiveDrag_func = nil
+ frame._OnReceiveDrag_arg = nil
- frame:SetScript("OnMouseDown", nil)
- frame._OnMouseDown_func = nil
- frame._OnMouseDown_arg = nil
+ frame:SetScript("OnMouseDown", nil)
+ frame._OnMouseDown_func = nil
+ frame._OnMouseDown_arg = nil
- frame:SetScript("OnMouseUp", nil)
- frame._OnMouseUp_func = nil
- frame._OnMouseUp_arg = nil
- end
+ frame:SetScript("OnMouseUp", nil)
+ frame._OnMouseUp_func = nil
+ frame._OnMouseUp_arg = nil
+ end
end
function tipPrototype:SetLineScript(lineNum, script, func, arg)
- SetFrameScript(self.lines[lineNum], script, func, arg)
+ SetFrameScript(self.lines[lineNum], script, func, arg)
end
function tipPrototype:SetColumnScript(colNum, script, func, arg)
- SetFrameScript(self.columns[colNum], script, func, arg)
+ SetFrameScript(self.columns[colNum], script, func, arg)
end
function tipPrototype:SetCellScript(lineNum, colNum, script, func, arg)
- local cell = self.lines[lineNum].cells[colNum]
+ local cell = self.lines[lineNum].cells[colNum]
- if cell then
- SetFrameScript(cell, script, func, arg)
- end
+ if cell then
+ SetFrameScript(cell, script, func, arg)
+ end
end
------------------------------------------------------------------------------
@@ -1439,21 +1453,21 @@ end
-- Script of the auto-hiding child frame
local function AutoHideTimerFrame_OnUpdate(self, elapsed)
- self.checkElapsed = self.checkElapsed + elapsed
+ self.checkElapsed = self.checkElapsed + elapsed
- if self.checkElapsed > 0.1 then
- if self.parent:IsMouseOver() or (self.alternateFrame and self.alternateFrame:IsMouseOver()) then
- self.elapsed = 0
- else
- self.elapsed = self.elapsed + self.checkElapsed
+ if self.checkElapsed > 0.1 then
+ if self.parent:IsMouseOver() or (self.alternateFrame and self.alternateFrame:IsMouseOver()) then
+ self.elapsed = 0
+ else
+ self.elapsed = self.elapsed + self.checkElapsed
- if self.elapsed >= self.delay then
- lib:Release(self.parent)
- end
- end
+ if self.elapsed >= self.delay then
+ lib:Release(self.parent)
+ end
+ end
- self.checkElapsed = 0
- end
+ self.checkElapsed = 0
+ end
end
-- Usage:
@@ -1461,65 +1475,65 @@ end
-- :SetAutoHideDelay(0.25, someFrame) => hides after 0.25sec outside of both the tooltip and someFrame
-- :SetAutoHideDelay() => disable auto-hiding (default)
function tipPrototype:SetAutoHideDelay(delay, alternateFrame, releaseHandler)
- local timerFrame = self.autoHideTimerFrame
- delay = tonumber(delay) or 0
+ local timerFrame = self.autoHideTimerFrame
+ delay = tonumber(delay) or 0
- if releaseHandler then
- if type(releaseHandler) ~= "function" then
- error("releaseHandler must be a function", 2)
- end
+ if releaseHandler then
+ if type(releaseHandler) ~= "function" then
+ error("releaseHandler must be a function", 2)
+ end
- lib.onReleaseHandlers[self] = releaseHandler
- end
+ lib.onReleaseHandlers[self] = releaseHandler
+ end
- if delay > 0 then
- if not timerFrame then
- timerFrame = AcquireTimer(self)
- timerFrame:SetScript("OnUpdate", AutoHideTimerFrame_OnUpdate)
+ if delay > 0 then
+ if not timerFrame then
+ timerFrame = AcquireTimer(self)
+ timerFrame:SetScript("OnUpdate", AutoHideTimerFrame_OnUpdate)
- self.autoHideTimerFrame = timerFrame
- end
+ self.autoHideTimerFrame = timerFrame
+ end
- timerFrame.parent = self
- timerFrame.checkElapsed = 0
- timerFrame.elapsed = 0
- timerFrame.delay = delay
- timerFrame.alternateFrame = alternateFrame
- timerFrame:Show()
- elseif timerFrame then
- self.autoHideTimerFrame = nil
+ timerFrame.parent = self
+ timerFrame.checkElapsed = 0
+ timerFrame.elapsed = 0
+ timerFrame.delay = delay
+ timerFrame.alternateFrame = alternateFrame
+ timerFrame:Show()
+ elseif timerFrame then
+ self.autoHideTimerFrame = nil
- timerFrame.alternateFrame = nil
- timerFrame:SetScript("OnUpdate", nil)
+ timerFrame.alternateFrame = nil
+ timerFrame:SetScript("OnUpdate", nil)
- ReleaseTimer(timerFrame)
- end
+ ReleaseTimer(timerFrame)
+ end
end
------------------------------------------------------------------------------
-- "Smart" Anchoring
------------------------------------------------------------------------------
local function GetTipAnchor(frame)
- local x, y = frame:GetCenter()
+ local x, y = frame:GetCenter()
- if not x or not y then
- return "TOPLEFT", "BOTTOMLEFT"
- end
+ if not x or not y then
+ return "TOPLEFT", "BOTTOMLEFT"
+ end
- local hhalf = (x > UIParent:GetWidth() * 2 / 3) and "RIGHT" or (x < UIParent:GetWidth() / 3) and "LEFT" or ""
- local vhalf = (y > UIParent:GetHeight() / 2) and "TOP" or "BOTTOM"
+ local hhalf = (x > UIParent:GetWidth() * 2 / 3) and "RIGHT" or (x < UIParent:GetWidth() / 3) and "LEFT" or ""
+ local vhalf = (y > UIParent:GetHeight() / 2) and "TOP" or "BOTTOM"
- return vhalf .. hhalf, frame, (vhalf == "TOP" and "BOTTOM" or "TOP") .. hhalf
+ return vhalf .. hhalf, frame, (vhalf == "TOP" and "BOTTOM" or "TOP") .. hhalf
end
function tipPrototype:SmartAnchorTo(frame)
- if not frame then
- error("Invalid frame provided.", 2)
- end
+ if not frame then
+ error("Invalid frame provided.", 2)
+ end
- self:ClearAllPoints()
- self:SetClampedToScreen(true)
- self:SetPoint(GetTipAnchor(frame))
+ self:ClearAllPoints()
+ self:SetClampedToScreen(true)
+ self:SetPoint(GetTipAnchor(frame))
end
------------------------------------------------------------------------------
@@ -1528,22 +1542,22 @@ end
-- @debug @
local print = print
local function PrintStats()
- local tipCache = tostring(#tooltipHeap)
- local frameCache = tostring(#frameHeap)
- local tableCache = tostring(#tableHeap)
- local header = false
-
- print("Tooltips used: " .. usedTooltips .. ", Cached: " .. tipCache .. ", Total: " .. tipCache + usedTooltips)
- print("Frames used: " .. usedFrames .. ", Cached: " .. frameCache .. ", Total: " .. frameCache + usedFrames)
- print("Tables used: " .. usedTables .. ", Cached: " .. tableCache .. ", Total: " .. tableCache + usedTables)
-
- for k in pairs(activeTooltips) do
- if not header then
- print("Active tooltips:")
- header = true
- end
- print("- " .. k)
- end
+ local tipCache = tostring(#tooltipHeap)
+ local frameCache = tostring(#frameHeap)
+ local tableCache = tostring(#tableHeap)
+ local header = false
+
+ print("Tooltips used: " .. usedTooltips .. ", Cached: " .. tipCache .. ", Total: " .. tipCache + usedTooltips)
+ print("Frames used: " .. usedFrames .. ", Cached: " .. frameCache .. ", Total: " .. frameCache + usedFrames)
+ print("Tables used: " .. usedTables .. ", Cached: " .. tableCache .. ", Total: " .. tableCache + usedTables)
+
+ for k in pairs(activeTooltips) do
+ if not header then
+ print("Active tooltips:")
+ header = true
+ end
+ print("- " .. k)
+ end
end
SLASH_LibQTip1 = "/qtip"
diff --git a/Libs/LibQTip-1.0/LibQTip-1.0.toc b/Libs/LibQTip-1.0/LibQTip-1.0.toc
index 765ab9d..b3f3152 100755
--- a/Libs/LibQTip-1.0/LibQTip-1.0.toc
+++ b/Libs/LibQTip-1.0/LibQTip-1.0.toc
@@ -1,10 +1,10 @@
-## Interface: 90000
+## Interface: 90105
## Title: Lib: QTip-1.0
## Notes: Library providing multi-column tooltips.
## Author: Torhal, Adirelle, Elkano, Tristanian
-## Version: 442326b
+## Version: 9.0.1.2-1-g4c6a3d8
## LoadOnDemand: 1
-## X-Date: 2020-10-15T15:12:00Z
+## X-Date: 2021-11-03T18:49:57Z
## X-Credits: Kaelten (input on initial design)
## X-Category: Library, Tooltip
## X-License: Ace3 BSD-like license
diff --git a/Libs/LibStub/LibStub.lua b/Libs/LibStub/LibStub.lua
index ae1900e..0a41ac0 100755
--- a/Libs/LibStub/LibStub.lua
+++ b/Libs/LibStub/LibStub.lua
@@ -1,22 +1,13 @@
--- $Id: LibStub.lua 76 2007-09-03 01:50:17Z mikk $
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
--- LibStub is hereby placed in the Public Domain
--- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
+-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
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]
--- Check to see is this version of the stub is obsolete
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
LibStub = LibStub or {libs = {}, minors = {} }
_G[LIBSTUB_MAJOR] = LibStub
LibStub.minor = LIBSTUB_MINOR
- -- LibStub:NewLibrary(major, minor)
- -- major (string) - the major version of the library
- -- minor (string or number ) - the minor version of the library
- --
- -- returns nil if a newer or same version of the lib is already present
- -- returns empty library object or old library object if upgrade is needed
function LibStub:NewLibrary(major, minor)
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
@@ -27,12 +18,6 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
return self.libs[major], oldminor
end
- -- LibStub:GetLibrary(major, [silent])
- -- major (string) - the major version of the library
- -- silent (boolean) - if true, library is optional, silently return nil if its not found
- --
- -- throws an error if the library can not be found (except silent is set)
- -- returns the library object if found
function LibStub:GetLibrary(major, silent)
if not self.libs[major] and not silent then
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
@@ -40,12 +25,6 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
return self.libs[major], self.minors[major]
end
- -- LibStub:IterateLibraries()
- --
- -- Returns an iterator for the currently registered libraries
- function LibStub:IterateLibraries()
- return pairs(self.libs)
- end
-
+ function LibStub:IterateLibraries() return pairs(self.libs) end
setmetatable(LibStub, { __call = LibStub.GetLibrary })
end
diff --git a/Libs/changelog.txt b/Libs/changelog.txt
new file mode 100644
index 0000000..690299d
--- /dev/null
+++ b/Libs/changelog.txt
@@ -0,0 +1,446 @@
+Ace3 Release - Revision r1259 (May 17th, 2021)
+--------------------------------------------------
+- AceGUI-3.0: Dropdown: Fix double click sound on toggling the dropdown (Issue #575)
+- AceConfigDialog-3.0: Fix width number multiplier on multiselects (Issue #584)
+
+Ace3 Release - Revision r1252 (May 17th, 2021)
+--------------------------------------------------
+- AceConfigDialog-3.0: Increased the frame level of dialogs to allow other addons to draw below them.
+- AceConfigDialog-3.0: The validation/confirmation popup is now opaque and not click-through, to avoid accidentally activating options below it.
+- AceHook-3.0: Allow UnhookAll to be used without embedding (Fixes #558)
+
+Ace3 Release - Revision r1241 (October 13th, 2020)
+--------------------------------------------------
+- AceAddon-3.0: Suppress more Blizzard addon load events from activating Ace3 addons "too early", causing loading issues.
+- AceGUI-3.0: Updated for Backdrop changes in WoW 9.0
+- AceGUI-3.0: Re-structured widget releasing to avoid recursive release in some circumstances
+- AceGUI-3.0: Label: Anchors are being refreshed when the font is changed (Ticket #540)
+- AceGUI-3.0: Dropdown: Initialize the widget with an empty list so that AddItem can be used on a fresh dropdown (Ticket #542)
+
+Ace3 Release - Revision r1227 (August 12th, 2019)
+-------------------------------------------------
+- AceConfigDialog-3.0: Fixed an issue with a missing template on WoW Classic (Ticket #517)
+
+Ace3 Release - Revision r1224 (August 1st, 2019)
+------------------------------------------------
+- AceConfigDialog-3.0: Replace use of StaticPopup with a custom frame to minimize taint
+- AceGUI-3.0: Ensure the OnLeave callback on various widgets still fires when its being released while visible (Ticket #505)
+- AceGUI-3.0: Various fixes for anchoring problems in WoW 8.2 (Ticket #512, and other reports)
+
+Ace3 Release - Revision r1214 (June 26th, 2019)
+-----------------------------------------------
+- AceConfigDialog-3.0: Exposed "select" type sorting control through a new "sorting" config table member
+- AceConfigDialog-3.0: Clear existing anchors on the GameTooltip before re-anchoring it for 8.2 compatibility
+- AceConfigDialog-3.0: Improved options table sorting algorithm to produce a stable result in certain edge cases (Ticket #501)
+- AceConfigRegistry-3.0: Added missing custom controls entries for all types added in the last release (Ticket #494)
+- AceGUI-3.0: ColorPicker: Removed usage of Show/HideUIPanel for WoW 8.2 compatibiliy
+- AceGUI-3.0: DropDown: Improved dropdown sorting algorithm to support tables with mixed string and numeric keys
+
+Ace3 Release - Revision r1200 (January 24th, 2019)
+--------------------------------------------------
+- Cleanup for WoW 8.0 improvements
+- AceGUI-3.0: Worked around various quirks in the WoW 8.0/8.1 API
+- AceGUI-3.0: ColorPicker: Store references to the background/checkers textures (Ticket #473)
+- AceConfigDialog-3.0: Allow custom controls for almost all option types (Ticket #475)
+
+Ace3 Release - Revision r1182 (July 17th, 2018)
+-----------------------------------------------
+- AceComm-3.0: Support numeric targets for custom channels (Ticket #419)
+- AceComm-3.0/ChatThrottleLib: Updated for WoW 8.0 API changes
+- AceConfig-3.0: Allow number values for the "width" parameter, which acts as a multiplier of the default width
+- AceConfigDialog-3.0: Enable iconCoords for the main level of a tree group (Ticket #417)
+- AceGUI-3.0: Implement a Table Layout (#442)
+- AceGUI-3.0: EditBox: Only try to handle dragging if a valid object is being dragged into the text box
+- AceGUI-3.0: Various fixes and work-arounds for WoW 8.0 changes
+
+Ace3 Release - Revision r1166 (August 29th, 2017)
+-------------------------------------------------
+- Updated any use of PlaySound to the new numeric constants (Fix for WoW 7.3)
+- AceConfigDialog-3.0: implement fallback validation feedback in a StaticPopup (Ticket #2)
+
+Ace3 Release - Revision r1158 (March 28th, 2017)
+------------------------------------------------
+- AceGUI-3.0: Fire OnShow events from Frame and Windows containers (Ticket #396)
+- AceGUI-3.0: Add SetJustifyV/H API to the Label/InteractiveLabel widgets (Ticket #397)
+
+Ace3 Release - Revision r1151 (July 18th, 2016)
+-----------------------------------------------
+- AceConfig-3.0: Allow specifying images using the numeric fileID (Ticket #389)
+- AceGUI-3.0: Use SetColorTexture in WoW 7.0
+- AceGUI-3.0: Expose the HighlightText API for EditBox and MultiLineEditBox Widgets (Ticket #378)
+- AceGUI-3.0: Keybinding: Support MouseWheel Up/Down bindings (Ticket #372)
+- AceGUI-3.0: TreeGroup: Refresh the tree in an OnUpdate once after Acquire, not only after creation (Fixes missing tree in WoW 7.0)
+- AceSerializer-3.0: Create consistent tokens for infinity, independent of the clients platform
+
+Ace3 Release - Revision r1134 (June 23rd, 2015)
+-----------------------------------------------
+- AceGUI-3.0: TreeGroup: Prevent Word Wrap in tree elements
+
+Ace3 Release - Revision r1128 (February 24th, 2015)
+---------------------------------------------------
+- AceGUI-3.0: Fixed an error in GameTooltip handling causing wrong formatting in some cases
+
+Ace3 Release - Revision r1122 (October 14th, 2014)
+--------------------------------------------------
+- AceDB-3.0: Now using the GetCurrentRegion() API to determine region-based profile keys (fix for WoW 6.0)
+- AceComm-3.0: Update ChatThrottleLib to v23
+- AceConfigDialog-3.0: Show a more meaningful title on Blizzard Options Groups (Ticket #353)
+- AceGUI-3.0: ColorPicker: Frame Level is automatically increased to ensure the color picker frame is above the option panel
+- AceGUI-3.0: DropDown: Properly disable all clickable areas when the dropdown is disabled (Ticket #360)
+- AceHook-3.0: Always use HookScript when hooking scripts in a secure fashion (Ticket #338)
+- AceTimer-3.0: New timer implementation based on C_Timer.After
+
+Ace3 Release - Revision r1109 (February 19th, 2014)
+---------------------------------------------------
+- AceComm-3.0: Ambiguate addon comm messages to restore behavior to be identical to pre-5.4.7
+- AceConfigRegistry-3.0: Added an option to skip options table validation on registering
+
+Ace3 Release - Revision r1104 (October 31st, 2013)
+--------------------------------------------------
+- AceGUI-3.0: Flow Layout: Added a safeguard to prevent an infinite loop in the layout engine
+- AceGUI-3.0: DropDown: Adjust its style slightly to closer resemble the Blizzard DropDown Widget
+- AceGUI-3.0: DropDown: API enhancements to specify the width of the pullout and be notified when its opened
+
+Ace3 Release - Revision r1098 (September 13th, 2013)
+----------------------------------------------------
+- AceDB-3.0: Switch characters to the default profile if their active profile is deleted (Ticket #324)
+- AceConfigDialog-3.0: Try to prevent static popup taint (Ticket #322)
+- AceGUI-3.0: Button: Add a new "Auto Width" option (Ticket #310)
+- AceGUI-3.0: DropDown: Make the entire DropDown widget clickable (Ticket #339)
+- AceGUI-3.0: EditBox: Allow dragging macros to the editbox (which will then contain the macros name) (Ticket #337)
+- AceGUI-3.0: Slider: Add a workaround for the broken slider steps in WoW 5.4 (Ticket #346)
+- AceGUI-3.0: TreeGroup: Fix an issue introduced by 5.4 broken scrollbars (Ticket #345)
+- AceHook-3.0: Allow hooking of AnimationGroup scripts (Ticket #314)
+
+Ace3 Release - Revision r1086 (May 21st, 2013)
+----------------------------------------------
+- AceAddon-3.0: Improved behavior when loading modules during game startup, ensures proper loading order
+
+Ace3 Release - Revision r1083 (March 4th, 2013)
+-----------------------------------------------
+- AceTimer-3.0: Fixed an issue that caused the parameter list passed to the callback to be cut off at nil values
+- AceGUI-3.0: InlineGroup: The title attribute is properly reset for recycled objects
+
+Ace3 Release - Revision r1078 (February 10th, 2013)
+---------------------------------------------------
+- AceTimer-3.0: Re-write based on AnimationTimers
+- AceHook-3.0: Improved checks/error messages when trying to hook a script on a "nil" frame
+- AceDBOptions-3.0: Added Italian locale
+- AceGUI-3.0: BlizOptionsGroup: Fixed the "default" button callback
+- AceGUI-3.0: Colorpicker: The colorpicker is now clamped to the screen
+
+Ace3 Release - Revision r1061 (August 27th, 2012)
+-------------------------------------------------
+- AceConfigDialog-3.0: Try to avoid potential taints in static popup dialogs
+- AceConfigDialog-3.0: Sort multiselects with "radio" style
+- AceGUI-3.0: Support for WoW 5.0
+- AceGUI-3.0: MultiLineEditBox: Support shift-click'ing items/spells/etc. into the editbox
+- AceGUI-3.0: Label: Fix text alignment (Ticket #301)
+- AceGUI-3.0: Checkbox: Description text on a disable checkbox should look disabled (Ticket #304)
+- AceGUI-3.0: Keybinding: Ensure the Keybinding popup is on the top level (Ticket #305)
+
+Ace3 Release - Revision r1041 (November 29th, 2011)
+---------------------------------------------------
+- AceDB-3.0: Added locale and factionrealmregion profile keys
+- AceSerializer-3.0: Removed support for NaN, as WoW 4.3 does no longer allow it.
+- AceGUI-3.0: Frame: Add :EnableResize (Ticket #214)
+
+Ace3 Release - Revision r1032 (June 29th, 2011)
+-----------------------------------------------
+- AceTab-3.0: Improvements to Match handling (Ticket #255 and #256)
+- AceGUI-3.0: DropDown layout fix with hidden labels (Ticket #234)
+
+Ace3 Release - Revision r1025 (April 27th, 2011)
+------------------------------------------------
+- AceComm-3.0: Updated for 4.1 changes - now handles RegisterAddonMessagePrefix internally for you.
+- AceGUI-3.0: TabGroup: Fixed width of tabs in 4.1(Ticket #243)
+
+Ace3 Release - Revision r1009 (February 9th, 2011)
+--------------------------------------------------
+- AceLocale-3.0: Fix erronous assumption that the default locale is always the first to be registered for the :NewLocale() "silent" flag. The flag must now be set on the FIRST locale to be registered.
+- AceLocale-3.0: The :NewLocale() "silent" flag may now be set to the string "raw", meaning nils are returned for unknown translations.
+- AceGUI-3.0: Fix the disabled state of Icon widgets
+- AceGUI-3.0: The header of the Frame widget now dynamically changes size to fit the text (Ticket #171)
+- AceGUI-3.0: Its now possible to define a custom order the elements in a dropdown widget
+- AceGUI-3.0: Improved widget focus behaviour across the board (Ticket #192, #193)
+- AceGUI-3.0: Fixed a bug that made it impossible to block the tree widget from being user resizable (Ticket #163)
+- AceGUI-3.0: Fixed a bug that caused TreeGroups to become unresponsive under certain conditions (Ticket #189, #202)
+- AceGUI-3.0: Enhanced the DropDown widget to allow it to be reused more easily.
+- AceConfigDialog-3.0: Select Groups now have the proper order in the dropdown (Ticket #184)
+- AceConfigDialog-3.0: Implemented "radio" style select boxes (Ticket #149)
+
+Ace3 Release - Revision r981 (October 27th, 2010)
+-------------------------------------------------
+- AceAddon-3.0: Fixed a library upgrading issue
+- AceAddon-3.0: Modules are now enabled in loading order
+- AceGUI-3.0: Keybinding: The widget will no longer steal keybindings even when inactive (Ticket #169)
+- AceGUI-3.0: EditBox: Fixed spell drag'n'drop
+
+
+Ace3 Release - Revision r971 (October 12th, 2010)
+-------------------------------------------------
+- Small fixes and adjustments for the 4.0 Content Patch.
+- AceGUI-3.0: ScrollFrame: Allow for a small margin of error when determining if the scroll bar should be shown.
+- AceGUI-3.0: Added new widget APIs: GetText for EditBox and DisableButton for MultiLineEditBox
+
+Ace3 Release - Revision r960 (July 20th, 2010)
+----------------------------------------------
+- AceGUI-3.0: Label: Reset Image Size and TexCoords on Acquire (Ticket #110)
+- AceGUI-3.0: CheckBox: Re-apply the disabled state after setting a value, so the visuals are correct in either case. (Ticket #107)
+- AceGUI-3.0: Icon: Fix the vertical size. It'll now properly scale with the image size, and not be fixed to about 110px. (Ticket #104)
+- AceGUI-3.0: External Containers (Frame, Window) should always start in a visible state. (Ticket #121)
+- AceGUI-3.0: Added Blizzard sounds to widgets (Ticket #120)
+- AceGUI-3.0: CheckBox: check for self.desc:GetText() being nil as well as "" to prevent setting the wrong height on the checkbox causing bouncing checkboxes.
+- AceGUI-3.0: Rewrite of the MultiLineEditBox (Ticket #68)
+- AceGUI-3.0: CheckBox: Fix alignment of the text in OnMouseDown when an image is set. (Ticket #142)
+- AceGUI-3.0: Add SetMaxLetters APIs to EB and MLEB (Ticket #135)
+- AceGUI-3.0: Frame: Add events for OnEnter/OnLeave of the statusbar (Ticket #139)
+- AceGUI-3.0: Major cleanups and refactoring in nearly all widgets and containers.
+- AceConfigDialog-3.0: Always obey the min/max values on range-type widgets (Ticket #114)
+- AceConfigDialog-3.0: Pass iconCoords set on groups in the options table to the tree widget (Ticket #111)
+- AceConfigDialog-3.0: Implement "softMin" and "softMax", allowing for a UI-specific minimum/maximum for range controls, while allowing manual input of values in the old min/max range. (Ticket #123)
+- AceConfigDialog-3.0: Don't close frames in CloseAll that are being opened after the CloseAll event was dispatched. (Ticket #132).
+- AceSerializer-3.0: Fix encoding & decoding of \030. (Ticket #115)
+- AceDB-3.0: Remove empty sections on logout, keeping the SV clean of more useless informations.
+- AceDBOptions-3.0.lua: Fix a string typo (Ticket #141)
+
+Ace3 Release - Revision r907 (December 16th, 2009)
+---------------------------------------------------
+- AceGUI-3.0: Frame: Properly save the width in the status table.
+- AceConfigCmd-3.0: Properly handle help output of inline groups with a different handler. (Ticket #101)
+- AceConfigDialog-3.0: Don't bail out and error when a dialogControl was invalid, instead show the error and fallback to the default control for that type.
+- AceConfigDialog-3.0: Fix a hickup with the OnUpdate script not getting upgraded properly in some situations.
+
+Ace3 Release - Revision r900 (December 8th, 2009)
+--------------------------------------------------
+- AceGUI-3.0: Alot of visual fixes regarding margins and general widget styles.
+- AceGUI-3.0: Ability to accept links for EditBox Widget (Ticket #21)
+- AceGUI-3.0: ScrollFrame: Hide the scrollbar when there is no overflowing content, and allow the Layout functions to use that space for widgets.
+- AceGUI-3.0: DropDown: Added a GetValue() API to the Widget (Ticket #69)
+- AceGUI-3.0: Button: Pass the arguments of the OnClick handler to the OnClick callback (Ticket #57)
+- AceGUI-3.0: add a Window container, basically a plain window with close button
+- AceGUI-3.0: Add support for inline descriptions to the checkbox widget.
+- AceGUI-3.0: Added an API to the Window container to disable the user-resizing of the same. (Ticket #80)
+- AceGUI-3.0: TreeGroup: Allow iconCoords to be passed for the tree elements. (Ticket #59)
+- AceGUI-3.0: Slider: Add a more visible backdrop/border around the manual input area (Ticket #98, #46)
+- AceGUI-3.0: Allow displaying a image in front of the checkbox label. (Ticket #82)
+- AceConfig-3.0: Added an experimental "descStyle" member to all option table nodes that allows you to control the way the description is presented.
+ Supported values are "tooltip" for the old behaviour, and "inline" for a inline display of the description, pending support in AceGUI-3.0 widgets.
+- AceConfigCmd-3.0: Properly parse functions and methods supplied for the "hidden" option table member. (Ticket #96)
+- AceConfigDialog-3.0: Fix the unpacking of the basepath arguments when internally calling :Open (Ticket #90)
+- AceConfigDialog-3.0: Properly refresh BlizOptions Windows which are registered with a path on NotifyChange. (Ticket #93)
+- AceConfigDialog-3.0: Allow image/imageCoords on toogle elements (Note that the width/height of the image on the toggle cannot be changed) (Ticket #82)
+- AceConfigDialog-3.0: Pass the groups "name" tag to DropDownGroups as the title. (Ticket #79)
+- AceDB-3.0: Remove the metatable from the DB before removing defaults, so we don't accidentally invoke it in the process. (Ticket #66)
+- AceDB-3.0: Don't save the profileKeys for namespaces, since we use the profile of the parent DB anyway. This will cut down on SV complexity when using alot of namespaces.
+- AceDB-3.0: Don't fire the OnProfileReset callback when copying a profile.
+- AceDBOptions-3.0: Show the current profile on the dialog. (Ticket #56)
+- AceComm-3.0: Add callbacks for message chunks going out the wire (via CTL). Useful for displaying progress for very large messages.
+- AceConsole-3.0: Add :Printf() so you don't have to do Print(format())
+
+Ace3 Beta - Revision 820 (August 7th, 2009)
+--------------------------------------------
+- AceComm-3.0: Updated ChatThrottleLib to v21
+- AceGUI-3.0: Fixed a glitch in the TabGroup code that caused tabs to be unresponsive under rare conditions. (Ticket #38)
+- AceGUI-3.0: Consistent "disabled" behaviour of all widgets. (Ticket #47)
+- AceGUI-3.0: Changed the way widgets are handled on release to avoid a crash in the game client. (Ticket #49)
+- AceGUI-3.0: Fixed a glitch in the button graphics. (Ticket #58)
+- AceGUI-3.0: Localized the "Close" Text on the Frame widget.
+
+Ace3 Beta - Revision 803 (April 14th, 2009)
+--------------------------------------------
+- AceConfig-3.0: Allow spaces in the keys of config tables. Spaces will be changed on the fly to underscores in AceConfigCmd-3.0 - there is no collision check in place, yet.
+- AceConfig-3.0: Support a "fontSize" attribute to the description type. Possible values are "small" (default), "medium" and "large".
+- AceConfigDialog-3.0: Fixed an error that would occur when calling InterfaceOptionsFrame_OpenToCategory from within an event handler in a Blizzard Options integrated frame. (Ticket #33)
+- AceConfigDialog-3.0: The "execute" type does now recognize the "image" attributes, and will display a clickable icon instead of the button when an image is supplied. (Ticket #35)
+- AceConfigDialog-3.0: Pass icons defined in the option table to the TreeGroup widget (Ticket #20)
+- AceConfigDialog-3.0: Fixed a bug that caused an empty group widget to be drawn if all groups were hidden.
+- AceConfigCmd-3.0: Improved the behaviour of select and multiselect elements. (Ticket #26)
+- AceDB-3.0: Add a GetNamespace function to the DB Objects which returns an existing namespace from the DB object.
+- AceGUI-3.0 Slider Widget: Properly show percentage values as min/max if isPercent is true. (Ticket #32)
+- AceGUI-3.0: Fixed an error in the TreeGroup Widget that caused execution to stop if no name was provided.
+- AceGUI-3.0: Fixed the behaviour of the MultiLineEditbox Widget (Accept button not clickable). (Ticket #28)
+- AceGUI-3.0: TabGroup: Set a maximum width for tabs based on the size of the widget. (Ticket #34)
+- AceGUI-3.0: Added a new InteractiveLabel with OnEnter/OnLeave/OnClick callbacks and a highlight texture
+- AceGUI-3.0: Add SetFont and SetFontObject functions to the Label widget (and the new InteractiveLabel)
+- AceGUI-3.0: Support icons in the TreeGroup display. (Ticket #20)
+- AceGUI-3.0: Added a new :SetRelativeWidth Widget-API that allows you to set the width of widgets relative to their container.
+- AceGUI-3.0: Alot of fixes, tweaks and consistency changes.
+
+Ace3 Beta - Revision 741 (Feb 15th, 2009)
+--------------------------------------------
+- AceDBOptions-3.0: Disable the "Copy From" and "Delete" dropdowns if there are no profiles to choose from. (Ticket #19)
+- AceGUI-3.0: Improve TabGroup visual style - only stretch them to the full width if they would use more then 75% of the exisiting space.
+- AceGUI-3.0: Added a third optional argument to :AddChild() to specify the position for the new widget. (Ticket #22)
+- AceConfigCmd-3.0: Improve help output when viewing groups.
+- AceConfigDialog-3.0: Refresh the Options Panel after a confirmation is canceled to reset the value to its previous value. (Ticket #23)
+- AceDB-3.0: Fix a data inconsistency when using false as a table key. (Ticket #25)
+
+Ace3 Beta - Revision 722 (Jan 4th, 2009)
+--------------------------------------------
+- AceHook-3.0: Fix :SecureHookScript to not fail on previously empty scripts since frame:HookScript does nothing at all in that case. (Ticket #16)
+- AceLocale-3.0: Implement 'silent' option for :NewLocale to disable the warnings on unknown entrys (Ticket #18)
+- AceTimer-3.0: Implement :TimeLeft(handle) function (Ticket #10)
+- AceGUI-3.0: Fix TabGroup tab resizing to be consistent
+- AceGUI-3.0: Fixed EditBox alignment when the label is disabled (Ticket #13)
+- AceDB-3.0: Implement OnProfileShutdown callback (Ticket #7)
+- AceDBOptions-3.0: Updated esES and ruRU locale
+
+Ace3 Beta - Revision 706 (Oct 18th, 2008)
+--------------------------------------------
+- First Beta release after WoWAce move
+- Removed WoW 2.4.x compat layer
+- AceGUI-3.0: Fix disabling of the Multiline Editbox
+- AceGUI-3.0: Improvements to the Keybinding Widget
+
+Ace3 Beta - Revision 81437 (Sept 6th, 2008)
+--------------------------------------------
+- AceConfigDialog-3.0: the confirm callback will now receive the new value that is being set (same signature as the validate callback)
+- AceConfigDialog-3.0: :Close and :CloseAll are now safe to call from within callbacks.
+- AceGUI-3.0: Added new methods to the widget base table, see ACE-205 for full reference
+- AceGUI-3.0: Various fixes to Widgets and recycling process
+- Now compatible with WoW 3.0 (compat layer is to be removed upon 3.0 release)
+
+
+Ace3 Beta - Revision 76325 (June 9th, 2008)
+--------------------------------------------
+- AceGUI-3.0: Finish Multiselect support for the Dropdown widget (nargiddley)
+- AceGUI-3.0: Re-write TabGroup layouting (nargiddley)
+- AceGUI-3.0: TreeGroup: Add :EnableButtonTooltips(enable) to make the default tooltips on the tree optional, enabled by default. (nargiddley)
+- AceGUI-3.0: TabGroup: Add OnTabEnter and OnTabLeave Callbacks (nargiddley)
+- AceConfigDialog-3.0: Add :SelectGroup(appName, ...) - Selects the group given by the path specified then refreshes open windows. (nargiddley)
+- AceConfigDialog-3.0: :Open now accepts an optional path, when given will open the window with only the given group and its children visible (nargiddley)
+- AceConfigDialog-3.0: :AddToBlizOptions now accepts an optional path, this will add the config page to display the specified group and its children only. (nargiddley)
+- AceConfigDialog-3.0: ACE-189: allow multiselect to be shown as a dropdown by setting dialogControl = "Dropdown" (nargiddley)
+- AceConfigDialog-3.0: Add Custom tooltips to the TreeGroup and TabGroup, shows both name and desc for the group. (nargiddley)
+- AceConfigCmd-3.0: ACE-195: Remove unneeded references to .confirm, will no longer error when .confirm is a boolean (nargiddley)
+- AceAddon-3.0: Allow for an optional first argument to NewAddon to be a table to be used as the base for the addon. (ammo)
+
+Ace3 Beta - Revision 74633 (May 19th, 2008)
+--------------------------------------------
+- AceTimer-3.0: ACE-173: don't error on nil handle for CancelTimer(), just bail out early. (ammo)
+- AceGUI-3.0: ACE-161, ACE-180, ACE-181: New and improved DropDown widget (originally coded by Borlox) (nargiddley,nevcairiel)
+- AceGUI-3.0: AceGUI will call OnWidthSet and OnHeightSet as frames resize (nargiddley)
+- AceGUI-3.0: TabGroup: Use OptionsFrameTabButtonTemplate for tabs (nargiddley)
+- AceGUI-3.0: TabGroup: Tabs now span multiple lines when there are too many to fit in the width of the frame (nargiddley)
+- AceGUI-3.0: TreeGroup: Tree is now sizable by dragging, orig patch by yssaril (nargiddley)
+- AceGUI-3.0: Flow layout will now reduce widgets width to fit rather than leaving them sticking out the side of container widgets (nargiddley)
+- AceGUI-3.0: Dropdowns will no longer be left open in the background when the frame is clicked or other widgets are activated (nargiddley)
+- AceGUI-3.0: ACE-159: Rename Release to OnRelease and Acquire to OnAcquire for widgets. (nargiddley)
+- AceGUI-3.0: ACE-171: add IsVisible and IsShown methods to the widget metatable (nargiddley)
+- AceGUI-3.0: ACE-164: add tooltips to tree to show full text of childs that got clipped (ammo)
+- AceGUI-3.0: ACE-174: make buttons in AceGUI-3.0 locale independant (ammo)
+- AceGUI-3.0: ACE-166: fix treegroup visual bug (ammo)
+- AceGUI-3.0: ACE-184: make numeric entry for slider more intuitive (ammo)
+- AceConfigCmd-3.0: ACE-172 - ignore description in cmd (ammo)
+- AceConsole-3.0: nolonger check for existance of slashcommands, overwrite where needed. Last one wins, this enables AddonLoader to X-LoadOn-Slash and override the slashcommand from AddonLoader slashcommand with an Ace3 one. (Ammo)
+
+Ace3 Beta - Revision 69509 (April 13th, 2008)
+---------------------------------------------
+- AceComm-3.0: turn off error messages when receiving invalid multi-part messages (its happening on login etc) (nevcairiel)
+- AceDBOptions-3.0: shorten info text at top to prevent scrollbars. (nevcairiel)
+- AceHook-3.0: ACE-162: fix unhooking of objects that were not actually hooked (nevcairiel)
+- AceDB-3.0: fire the DB callbacks after the namespaces changed their profile as well (nevcairiel)
+- AceDB-3.0: namespaces can now be individually reset using :ResetProfile() on the namespace directly (nevcairiel)
+- AceDB-3.0: added a optional argument to :ResetProfile to not populate the reset to all namespaces (so the main profile can reset individually without reseting all namespaces too) (nevcairiel)
+
+Ace3 Beta - Revision 66329 (March 27th, 2008)
+---------------------------------------------
+- Overall 2.4 clean ups - removing 2.4 checks and work arounds (nevcairiel)
+- AceBucket-3.0: clear the timer reference when unregistering a bucket to prevent a error when unregistering a bucket that was never fired (nevcairiel)
+- AceAddon-3.0: Bugfix when enabling/disabling modules from the parents OnEnable after disabling / enabling the parent addon. (ammo)
+- AceGUI-3.0: Don't parent the BlizOptionsGroup widget to UIParent and Hide it by default. Fixes stray controls on the screen. (nargiddley)
+- AceConfigDialog-3.0: Config windows without a default size won't incorrectly get a default size from a previously open window. (nargiddley)
+- AceDBOptions-3.0: added zhCN and zhTW locale (nevcairiel)
+
+Ace3 Beta - Revision 65665 (March 25th, 2008)
+---------------------------------------------
+- AceGUI-3.0: ACE-139: Changed all Widgets to resemble the Blizzard 2.4 Options Style (nevcairiel)
+- AceGUI-3.0: Fixed "List"-Layout not reporting new width to "fill"-mode widgets (mikk)
+- AceGUI-3.0: added :SetColor to the Label widget (nevcairiel)
+- AceGUI-3.0: ACE-132: ColorPicker: added checkers texture for better alpha channel display, and fixed "white"-texture bug (nevcairiel,nargiddley,ammo)
+- AceConfig-3.0: ACE-113: Added uiName, uiType, handler, option, type to the info table (nevcairiel,nargiddley)
+- AceConfigDialog-3.0: ACE-139: Adjusted for 2.4 options panels (nevcairiel)
+- AceConfigDialog-3.0: Use "width" parameter for the description widget (if present) (nevcairiel)
+- AceConfigDialog-3.0: ACE-135: Add support for specifying a rowcount for multiline editboxes (nargiddley)
+- AceConfigDialog-3.0: :AddToBlizOptions will return the frame registered so you can use it in InterfaceOptionsFrame_OpenToFrame (nevcairiel)
+- AceConfigCmd-3.0: handle "hidden" in help-output (nevcairiel)
+- AceHook-3.0: fix unhooking of secure hooks (nevcairiel)
+- AceDBOptions-3.0: add optional argument to GetOptionsTable(db[, noDefaultProfiles]) - if set to true will not show the default profiles in the profile selection (nevcairiel)
+- AceDBOptions-3.0: added koKR locale (nevcairiel)
+- Ace3 Standalone: Removed the "Ace3" Category from the 2.4 options panel (nevcairiel)
+
+Ace3 Beta - Revision 64176 (March 10th, 2008)
+---------------------------------------------
+- AceGUI-3.0: Improve Alpha handling for the ColorPicker widget, ColorPicker widget closes the ColorPickerFrame before opening to prevent values getting carried over (nargiddley)
+- AceGUI-3.0: The Slider widget will only react to the mousewheel after it has been clicked (anywhere including the label) to prevent accidental changes to the value when trying to scroll the container it is in (nargiddley)
+- AceGUI-3.0: The TreeGroup widget is scrollable with the mousewheel (nargiddley)
+- AceGUI-3.0: ACE-154: Fix frame levels in more cases to prevent widgets ending up behind their containers (nargiddley)
+- AceConfigDialog: Color picker obeys hasAlpha on the color type (nargiddley)
+- AceConfigDialog-3.0: ACE-155: Make sure that the selected group is type='group' when checking if it exists (nargiddley)
+- AceDBOptions-3.0: added frFR locale (nevcairiel)
+
+Ace3 Beta - Revision 63886 (March 8th, 2008)
+---------------------------------------------
+- AceDBOptions-3.0: new library to provide a Ace3Options table to control the AceDB-3.0 profiles (nevcairiel)
+- AceDB-3.0: add "silent" option to DeleteProfile and CopyProfile when we deal with namespaces (nevcairiel)
+- AceDB-3.0: implement library upgrade path (nevcairiel)
+- AceDB-3.0: ACE-146: fix problem with non-table values overruling ['*']-type defaults (nevcairiel)
+- AceConsole-3.0: treat |T|t texture links similar to |H|h|h links. (ammo)
+- AceGUI-3.0: Use Blizzard Templates for the EditBox and DropDown widget (nevcairiel)
+- AceBucket-3.0: ACE-150: callback is now optional, if not supplied will use the eventname as method name (only possible if one event is supplied, and not a event table) (nevcairiel)
+- tests: adjust tests for AceGUI and AceConsole changes (nevcairiel)
+
+Ace3 Beta - Revision 63220 (Feb 29th, 2008)
+---------------------------------------------
+- AceTimer-3.0: CancelAllTimers() now cancels silent (elkano)
+- AceConfigDialog: Add :SetDefaultSize(appName, width, height), sets the size the dialog will open to. Does not effect already open windows. (nargiddley)
+- AceConfigDialog: Fix typo in type check for range values (nargiddley)
+- AceGUI: ColorPicker widget will correctly fire OnValueChanged for the cancel event of the colorpicker popup. Reset ColorPicker's color on Acquire. (nargiddley)
+- AceGUI: Fix Spelling of Aquire -> Acquire for widgets, all custom widgets will need to be updated. A warning will be printed for widgets not upgraded yet. (nargiddley)
+- AceConfigCmd-3.0: add simple coloring to slashcommand output. (ammo)
+- AceConsole-3.0: add some color to :Print (ammo)
+- AceAddon-3.0: set error level on library embedding to point to the :NewAddon call (nevcairiel)
+
+Ace3 Beta - Revision 62182 (Feb 20th, 2008)
+---------------------------------------------
+- Ace3 StandAlone: Add a page to the Blizzard 2.4 Interface Options with icons to open dialogs for configs registered when installed standalone (nargiddley)
+- AceConfigDialog: type = 'description' now uses the fields image and imageCoords instead of icon and iconCoords, add imageWidth and imageHeight (nargiddley)
+- AceConfigDialog: Add :AddToBlizzardOptions(appName, name), this will add the specified config to the Blizzard Options pane new in 2.4. This will only be available if running on the 2.4 PTR (nargiddley)
+- AceDB: fix GetProfiles() when setting the same profile twice (nevcairiel)
+- AceDB: bail out of :SetProfile early when trying to set to the same profile (nevcairiel)
+- AceDB: add nil checks to metatable handling (nevcairiel)
+- AceDB: clear tables that are empty after defaults removal (nevcairiel)
+- AceGUI: Fix a couple of layout bugs causing the width of groups to be wrong (nargiddley)
+- AceGUI: Add Icon widget (nargiddley)
+- AceGUI: Allow room for the border in the BlizOptionsGroup widget (nargiddley)
+- AceGUI: Button and Keybinding use UIPanelButtonTemplate2 (nargiddley)
+- AceConsole-3.0: Fix bug where no table for [self] was created when registering weak commands (ammo)
+- AceTimer-3.0: add missing :OnEmbedDisable (ammo)
+- AceAddon-3.0: added :GetName() that will always return the "real" name of a addon or module object without any prefixes (nevcairiel)
+
+Ace3 Beta - Revision 60697 (Feb 9th, 2008)
+---------------------------------------------
+- CallbackHandler-1.0: remove unnecessary table creation if a event is fired thats not registered (nevcairiel)
+- AceAddon-3.0: fixed a bug with recursive addon loading (nevcairiel)
+- AceGUI: Update TabGroup's tablist format, tabs are selected by value not index (nargiddley)
+- AceGUI: Add MultiLineEditBox widget (nargiddley, originally by bam)
+- AceGUI: Small fix to the flow layout preventing controls overlapping in some cases (nargiddley)
+- AceConfigDialog: Implement control and dialogControl for types 'input' and 'select' (nargiddley)
+- AceConfigDialog: Add support for multiline = true on type = 'input' (nargiddley)
+- AceConfigDialog: Fix an error when all groups are hidden in a group with childGroups = 'select' (nargiddley)
+- AceConfigDialog: type = 'description' will now show .icon as an image with its text (nargiddley)
+- AceConfigDialog: multiline inputs are no longer forced to width = "full" (nargiddley)
+- AceConfigDialog: bug fix when loading without AceConsole present (nevcairiel)
+
+Ace3 Beta - Revision 60545 (Feb 7th, 2008)
+---------------------------------------------
+- AceGUI: SetToplevel(true) for the Frame widget, multiple open windows should play nice together now (nargiddley)
+- AceGUI: Move Frames to the FULLSCREEN_DIALOG strata (nargiddley)
+- AceGUI: Dropdown, Editbox and Keybinding labels grey out when disabled (nargiddley)
+- AceGUI: Add OnClick callback to the TreeGroup widget (nargiddley)
+- AceConfigDialog: Confirm popups will be above the config window (nargiddley)
+
+Ace3 Beta - Revision 60163 (Feb 3rd, 2008)
+---------------------------------------------
+- Initial Beta release
diff --git a/WorldBossStatus.toc b/WorldBossStatus.toc
index 617e765..6df5799 100755
--- a/WorldBossStatus.toc
+++ b/WorldBossStatus.toc
@@ -1,4 +1,4 @@
-## Interface: 90005
+## Interface: 90200
## Title: World Boss Status
## Version: @project-version@
## Author: Ludius of Caelestrasz-US
diff --git a/embeds.xml b/embeds.xml
index 5efd888..c101530 100755
--- a/embeds.xml
+++ b/embeds.xml
@@ -6,11 +6,11 @@
+
-