fix(libs): restore ElvUI-namespaced Ace3 stack clobbered by sweep
The coa-ace3 sweep (commits 0c130e0..5ea6e44, before coa-elvui was added to
EXCLUDED_FORKS in coa-ace3 tools/sweep.py) overwrote ElvUI's customized,
-ElvUI-namespaced Ace3 libs with plain canonical ones. ElvUI registers libs
as AceLocale-3.0-ElvUI and the AceConfig-3.0-ElvUI family (plus -ElvUI
widgets that don't exist in canonical), so the clobber left them
unregistered: ElvUI failed to init (16 locale 'L' errors) and /ec would not
open. Restores ElvUI/Libraries/Ace3/AceLocale-3.0 and the
ElvUI_OptionsUI/Libraries/Ace3 stack to their pre-sweep state (5021fd1).
coa-elvui is now in EXCLUDED_FORKS, so this won't be re-clobbered.
This commit is contained in:
@@ -4,13 +4,17 @@ local AceGUI = LibStub("AceGUI-3.0")
|
||||
-- Lua APIs
|
||||
local min, max, floor = math.min, math.max, math.floor
|
||||
local select, pairs, ipairs, type, tostring = select, pairs, ipairs, type, tostring
|
||||
local tsort = table.sort
|
||||
local tsort, tonumber = table.sort, tonumber
|
||||
|
||||
-- WoW APIs
|
||||
local PlaySound = PlaySound
|
||||
local UIParent, CreateFrame = UIParent, CreateFrame
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: CLOSE
|
||||
|
||||
local function fixlevels(parent,...)
|
||||
local i = 1
|
||||
local child = select(i, ...)
|
||||
@@ -35,7 +39,7 @@ end
|
||||
|
||||
do
|
||||
local widgetType = "Dropdown-Pullout"
|
||||
local widgetVersion = 5
|
||||
local widgetVersion = 3
|
||||
|
||||
--[[ Static data ]]--
|
||||
|
||||
@@ -189,7 +193,12 @@ do
|
||||
|
||||
local height = 8
|
||||
for i, item in pairs(items) do
|
||||
item:SetPoint("TOP", itemFrame, "TOP", 0, -2 + (i - 1) * -16)
|
||||
if i == 1 then
|
||||
item:SetPoint("TOP", itemFrame, "TOP", 0, -2)
|
||||
else
|
||||
item:SetPoint("TOP", items[i-1].frame, "BOTTOM", 0, 1)
|
||||
end
|
||||
|
||||
item:Show()
|
||||
|
||||
height = height + 16
|
||||
@@ -249,7 +258,7 @@ do
|
||||
|
||||
local function Constructor()
|
||||
local count = AceGUI:GetNextWidgetNum(widgetType)
|
||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, "BackdropTemplate")
|
||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent)
|
||||
local self = {}
|
||||
self.count = count
|
||||
self.type = widgetType
|
||||
@@ -300,7 +309,7 @@ do
|
||||
scrollFrame.obj = self
|
||||
itemFrame.obj = self
|
||||
|
||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, "BackdropTemplate")
|
||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame)
|
||||
slider:SetOrientation("VERTICAL")
|
||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||
slider:SetBackdrop(sliderBackdrop)
|
||||
@@ -347,7 +356,7 @@ end
|
||||
|
||||
do
|
||||
local widgetType = "Dropdown"
|
||||
local widgetVersion = 36
|
||||
local widgetVersion = 35
|
||||
|
||||
--[[ Static data ]]--
|
||||
|
||||
@@ -372,6 +381,7 @@ do
|
||||
|
||||
local function Dropdown_TogglePullout(this)
|
||||
local self = this.obj
|
||||
PlaySound("igMainMenuOptionCheckBoxOn") -- missleading name, but the Blizzard code uses this sound
|
||||
if self.open then
|
||||
self.open = nil
|
||||
self.pullout:Close()
|
||||
@@ -589,21 +599,47 @@ do
|
||||
return tostring(x) < tostring(y)
|
||||
end
|
||||
end
|
||||
local function SetList(self, list, order, itemType)
|
||||
|
||||
-- these were added by ElvUI
|
||||
local sortStr1, sortStr2 = "%((%d+)%)", "%[(%d+)]"
|
||||
local sortValue = function(a,b)
|
||||
if a and b and (a[2] and b[2]) then
|
||||
local a2 = tonumber(a[2]:match(sortStr1) or a[2]:match(sortStr2))
|
||||
local b2 = tonumber(b[2]:match(sortStr1) or b[2]:match(sortStr2))
|
||||
if a2 and b2 and (a2 ~= b2) then
|
||||
return a2 < b2 -- try to sort by the number inside of brackets if we can
|
||||
end
|
||||
return a[2] < b[2]
|
||||
end
|
||||
end
|
||||
|
||||
local function SetList(self, list, order, itemType, sortByValue)
|
||||
self.list = list or {}
|
||||
self.pullout:Clear()
|
||||
self.hasClose = nil
|
||||
if not list then return end
|
||||
|
||||
if type(order) ~= "table" then
|
||||
for v in pairs(list) do
|
||||
sortlist[#sortlist + 1] = v
|
||||
end
|
||||
tsort(sortlist, sortTbl)
|
||||
if sortByValue then -- added by ElvUI
|
||||
for k, v in pairs(list) do
|
||||
sortlist[#sortlist + 1] = {k,v}
|
||||
end
|
||||
tsort(sortlist, sortValue)
|
||||
|
||||
for i, key in ipairs(sortlist) do
|
||||
AddListItem(self, key, list[key], itemType)
|
||||
sortlist[i] = nil
|
||||
for i, sortedList in ipairs(sortlist) do
|
||||
AddListItem(self, sortedList[1], sortedList[2], itemType)
|
||||
sortlist[i] = nil
|
||||
end
|
||||
else -- this is the default way (unchanged by ElvUI)
|
||||
for v in pairs(list) do
|
||||
sortlist[#sortlist + 1] = v
|
||||
end
|
||||
tsort(sortlist, sortTbl)
|
||||
|
||||
for i, key in ipairs(sortlist) do
|
||||
AddListItem(self, key, list[key], itemType)
|
||||
sortlist[i] = nil
|
||||
end
|
||||
end
|
||||
else
|
||||
for i, key in ipairs(order) do
|
||||
|
||||
Reference in New Issue
Block a user