mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
test update AceGUI-3.0-SharedMediaWidgets
This commit is contained in:
@@ -6,6 +6,10 @@ local Media = LibStub("LibSharedMedia-3.0")
|
||||
|
||||
local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0")
|
||||
|
||||
local next, ipairs, pairs = next, ipairs, pairs
|
||||
local upper = string.upper
|
||||
local tinsert, sort, tremove = table.insert, table.sort, table.remove
|
||||
|
||||
do
|
||||
local widgetType = "LSM30_Background"
|
||||
local widgetVersion = 11
|
||||
@@ -15,7 +19,7 @@ do
|
||||
self:ClearAllPoints()
|
||||
self:Hide()
|
||||
self.check:Hide()
|
||||
table.insert(contentFrameCache, self)
|
||||
tinsert(contentFrameCache, self)
|
||||
end
|
||||
|
||||
local function ContentOnClick(this, button)
|
||||
@@ -36,7 +40,7 @@ do
|
||||
local function GetContentLine()
|
||||
local frame
|
||||
if next(contentFrameCache) then
|
||||
frame = table.remove(contentFrameCache)
|
||||
frame = tremove(contentFrameCache)
|
||||
else
|
||||
frame = CreateFrame("Button", nil, UIParent)
|
||||
--frame:SetWidth(200)
|
||||
@@ -140,7 +144,7 @@ do
|
||||
end
|
||||
|
||||
local function textSort(a,b)
|
||||
return string.upper(a) < string.upper(b)
|
||||
return upper(a) < upper(b)
|
||||
end
|
||||
|
||||
local sortedlist = {}
|
||||
@@ -156,13 +160,12 @@ do
|
||||
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT")
|
||||
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0)
|
||||
for k, v in pairs(self.list) do
|
||||
sortedlist[getn(sortedlist)+1] = k
|
||||
tinsert(sortedlist, k)
|
||||
end
|
||||
table.sort(sortedlist, textSort)
|
||||
sort(sortedlist, textSort)
|
||||
for i, k in ipairs(sortedlist) do
|
||||
local f = GetContentLine()
|
||||
f.text:SetText(k)
|
||||
--print(k)
|
||||
if k == self.value then
|
||||
f.check:Show()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user