mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
replace Ace3v with Ace3 ElvUI-TBC version
or easy tracking of code difference
This commit is contained in:
@@ -6,10 +6,6 @@ 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_Sound"
|
||||
local widgetVersion = 11
|
||||
@@ -19,18 +15,18 @@ do
|
||||
self:ClearAllPoints()
|
||||
self:Hide()
|
||||
self.check:Hide()
|
||||
tinsert(contentFrameCache, self)
|
||||
table.insert(contentFrameCache, self)
|
||||
end
|
||||
|
||||
local function ContentOnClick()
|
||||
local function ContentOnClick(this, button)
|
||||
local self = this.obj
|
||||
self:Fire("OnValueChanged", 1, this.text:GetText())
|
||||
self:Fire("OnValueChanged", this.text:GetText())
|
||||
if self.dropdown then
|
||||
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||
end
|
||||
end
|
||||
|
||||
local function ContentSpeakerOnClick()
|
||||
local function ContentSpeakerOnClick(this, button)
|
||||
local self = this.frame.obj
|
||||
local sound = this.frame.text:GetText()
|
||||
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound), "Master")
|
||||
@@ -39,12 +35,12 @@ do
|
||||
local function GetContentLine()
|
||||
local frame
|
||||
if next(contentFrameCache) then
|
||||
frame = tremove(contentFrameCache)
|
||||
frame = table.remove(contentFrameCache)
|
||||
else
|
||||
frame = CreateFrame("Button", nil, UIParent)
|
||||
--frame:SetWidth(200)
|
||||
frame:SetHeight(18)
|
||||
frame:SetHighlightTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight", "ADD")
|
||||
frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD")
|
||||
frame:SetScript("OnClick", ContentOnClick)
|
||||
local check = frame:CreateTexture("OVERLAY")
|
||||
check:SetWidth(16)
|
||||
@@ -149,11 +145,11 @@ do
|
||||
end
|
||||
|
||||
local function textSort(a,b)
|
||||
return upper(a) < upper(b)
|
||||
return string.upper(a) < string.upper(b)
|
||||
end
|
||||
|
||||
local sortedlist = {}
|
||||
local function ToggleDrop()
|
||||
local function ToggleDrop(this)
|
||||
local self = this.obj
|
||||
if self.dropdown then
|
||||
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||
@@ -165,9 +161,9 @@ 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
|
||||
tinsert(sortedlist, k)
|
||||
sortedlist[#sortedlist+1] = k
|
||||
end
|
||||
sort(sortedlist, textSort)
|
||||
table.sort(sortedlist, textSort)
|
||||
for i, k in ipairs(sortedlist) do
|
||||
local f = GetContentLine()
|
||||
f.text:SetText(k)
|
||||
@@ -175,7 +171,7 @@ do
|
||||
f.check:Show()
|
||||
end
|
||||
f.obj = self
|
||||
self.dropdown:AddFrame(f, i)
|
||||
self.dropdown:AddFrame(f)
|
||||
end
|
||||
wipe(sortedlist)
|
||||
end
|
||||
@@ -187,22 +183,22 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
local function OnHide()
|
||||
local function OnHide(this)
|
||||
local self = this.obj
|
||||
if self.dropdown then
|
||||
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown)
|
||||
end
|
||||
end
|
||||
|
||||
local function Drop_OnEnter()
|
||||
local function Drop_OnEnter(this)
|
||||
this.obj:Fire("OnEnter")
|
||||
end
|
||||
|
||||
local function Drop_OnLeave()
|
||||
local function Drop_OnLeave(this)
|
||||
this.obj:Fire("OnLeave")
|
||||
end
|
||||
|
||||
local function WidgetPlaySound()
|
||||
local function WidgetPlaySound(this)
|
||||
local self = this.obj
|
||||
local sound = self.frame.text:GetText()
|
||||
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound), "Master")
|
||||
|
||||
Reference in New Issue
Block a user