test update AceGUI-3.0-SharedMediaWidgets

This commit is contained in:
Bunny67
2018-06-07 21:10:09 +03:00
parent abe3e4cd83
commit d34a72dd33
6 changed files with 66 additions and 44 deletions
@@ -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_Statusbar"
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()
@@ -29,7 +33,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)
@@ -129,7 +133,7 @@ do
end
local function textSort(a,b)
return string.upper(a) < string.upper(b)
return upper(a) < upper(b)
end
local sortedlist = {}
@@ -145,13 +149,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