replace Ace3v with Ace3 ElvUI-TBC version

or easy tracking of code difference
This commit is contained in:
Pinya
2018-07-21 13:20:39 +03:00
parent bb867629d5
commit 332d53e7f6
59 changed files with 1975 additions and 2496 deletions
@@ -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_Background"
local widgetVersion = 11
@@ -19,12 +15,12 @@ do
self:ClearAllPoints()
self:Hide()
self.check:Hide()
tinsert(contentFrameCache, self)
table.insert(contentFrameCache, self)
end
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
@@ -40,12 +36,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)
frame:SetScript("OnEnter", ContentOnEnter)
@@ -144,7 +140,7 @@ do
end
local function textSort(a,b)
return upper(a) < upper(b)
return string.upper(a) < string.upper(b)
end
local sortedlist = {}
@@ -160,18 +156,19 @@ 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)
--print(k)
if k == self.value then
f.check:Show()
end
f.obj = self
f.dropdown = self.dropdown
self.dropdown:AddFrame(f, i)
self.dropdown:AddFrame(f)
end
wipe(sortedlist)
end
@@ -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_Border"
local widgetVersion = 11
@@ -19,12 +15,12 @@ do
self:ClearAllPoints()
self:Hide()
self.check:Hide()
tinsert(contentFrameCache, self)
table.insert(contentFrameCache, self)
end
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
@@ -35,7 +31,7 @@ do
local text = this.text:GetText()
local border = self.list[text] ~= text and self.list[text] or Media:Fetch('border',text)
this.dropdown:SetBackdrop({edgeFile = border,
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background-Dark",
bgFile=[[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }})
end
@@ -43,12 +39,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)
frame:SetScript("OnEnter", ContentOnEnter)
local check = frame:CreateTexture("OVERLAY")
@@ -110,7 +106,7 @@ do
local border = self.list[text] ~= text and self.list[text] or Media:Fetch('border',text)
self.frame.displayButton:SetBackdrop({edgeFile = border,
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background-Dark",
bgFile=[[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 4, right = 4, top = 4, bottom = 4 }})
end
@@ -139,7 +135,7 @@ do
end
local function textSort(a,b)
return upper(a) < upper(b)
return string.upper(a) < string.upper(b)
end
local sortedlist = {}
@@ -155,18 +151,19 @@ 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)
--print(k)
if k == self.value then
f.check:Show()
end
f.obj = self
f.dropdown = self.dropdown
self.dropdown:AddFrame(f, i)
self.dropdown:AddFrame(f)
end
wipe(sortedlist)
end
@@ -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_Font"
local widgetVersion = 11
@@ -19,12 +15,12 @@ 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
@@ -33,12 +29,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)
@@ -124,11 +120,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)
@@ -140,9 +136,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()
local _, size, outline= f.text:GetFont()
@@ -153,7 +149,7 @@ do
f.check:Show()
end
f.obj = self
self.dropdown:AddFrame(f, i)
self.dropdown:AddFrame(f)
end
wipe(sortedlist)
end
@@ -165,18 +161,18 @@ 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
@@ -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")
@@ -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_Statusbar"
local widgetVersion = 11
@@ -19,12 +15,12 @@ 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
@@ -33,12 +29,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)
@@ -133,11 +129,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)
@@ -149,12 +145,13 @@ 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)
--print(k)
if k == self.value then
f.check:Show()
end
@@ -163,7 +160,7 @@ do
f.bar:SetTexture(statusbar)
f.obj = self
f.dropdown = self.dropdown
self.dropdown:AddFrame(f, i)
self.dropdown:AddFrame(f)
end
wipe(sortedlist)
end
@@ -175,18 +172,18 @@ 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
@@ -16,9 +16,6 @@ local Media = LibStub("LibSharedMedia-3.0")
AGSMW = AGSMW or {}
local next, ipairs = next, ipairs
local tinsert, tremove = table.insert, table.remove
AceGUIWidgetLSMlists = {
['font'] = Media:HashTable("font"),
['sound'] = Media:HashTable("sound"),
@@ -140,8 +137,8 @@ end
do
local sliderBackdrop = {
["bgFile"] = "Interface\\Buttons\\UI-SliderBar-Background",
["edgeFile"] = "Interface\\Buttons\\UI-SliderBar-Border",
["bgFile"] = [[Interface\Buttons\UI-SliderBar-Background]],
["edgeFile"] = [[Interface\Buttons\UI-SliderBar-Border]],
["tile"] = true,
["edgeSize"] = 8,
["tileSize"] = 8,
@@ -153,8 +150,8 @@ do
},
}
local frameBackdrop = {
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background-Dark",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
bgFile=[[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
tile = true, tileSize = 32, edgeSize = 32,
insets = { left = 11, right = 12, top = 12, bottom = 9 },
}
@@ -163,36 +160,38 @@ do
self.slider:SetValue(self.slider:GetValue()+(15*dir*-1))
end
local function AddFrame(self, frame, i)
local function AddFrame(self, frame)
frame:SetParent(self.contentframe)
frame:SetFrameStrata(self:GetFrameStrata())
frame:SetFrameLevel(self:GetFrameLevel() + 100)
if next(self.contentRepo) then
frame:SetPoint("TOPLEFT", self.contentRepo[i-1], "BOTTOMLEFT", 0, 0)
frame:SetPoint("TOPLEFT", self.contentRepo[#self.contentRepo], "BOTTOMLEFT", 0, 0)
frame:SetPoint("RIGHT", self.contentframe, "RIGHT", 0, 0)
self.contentframe:SetHeight(self.contentframe:GetHeight() + frame:GetHeight())
self.contentRepo[#self.contentRepo+1] = frame
else
self.contentframe:SetHeight(frame:GetHeight())
frame:SetPoint("TOPLEFT", self.contentframe, 0, 0)
frame:SetPoint("TOPLEFT", self.contentframe, "TOPLEFT", 0, 0)
frame:SetPoint("RIGHT", self.contentframe, "RIGHT", 0, 0)
self.contentRepo[1] = frame
end
self.contentRepo[i] = frame
if self.contentframe:GetHeight() > GetScreenHeight()*2/5 - 20 then
self.scrollframe:SetWidth(128)
self:SetHeight(GetScreenHeight()*2/5)
if self.contentframe:GetHeight() > UIParent:GetHeight()*2/5 - 20 then
self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -28, 12)
self:SetHeight(UIParent:GetHeight()*2/5)
self.slider:Show()
self:SetScript("OnMouseWheel", function() OnMouseWheel(this, arg1) end)
self:SetScript("OnMouseWheel", OnMouseWheel)
self.scrollframe:UpdateScrollChildRect()
self.slider:SetMinMaxValues(0, self.contentframe:GetHeight()-self.scrollframe:GetHeight())
else
self.scrollframe:SetWidth(142)
self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -14, 12)
self:SetHeight(self.contentframe:GetHeight()+25)
self.slider:Hide()
self:SetScript("OnMouseWheel", nil)
self.scrollframe:UpdateScrollChildRect()
self.slider:SetMinMaxValues(0, 0)
end
frame:SetWidth(self.scrollframe:GetWidth())
self.contentframe:SetWidth(self.scrollframe:GetWidth())
end
@@ -203,15 +202,15 @@ do
end
end
local function slider_OnValueChanged()
this.frame.scrollframe:SetVerticalScroll(arg1)
local function slider_OnValueChanged(self, value)
self.frame.scrollframe:SetVerticalScroll(value)
end
local DropDownCache = {}
function AGSMW:GetDropDownFrame()
local frame
if next(DropDownCache) then
frame = tremove(DropDownCache)
frame = table.remove(DropDownCache)
else
frame = CreateFrame("Frame", nil, UIParent)
frame:SetClampedToScreen(true)
@@ -226,13 +225,14 @@ do
frame.contentframe = contentframe
local scrollframe = CreateFrame("ScrollFrame", nil, frame)
scrollframe:SetWidth(128)
scrollframe:SetHeight((GetScreenHeight()*2/5) - 24)
scrollframe:SetWidth(160)
scrollframe:SetPoint("TOPLEFT", frame, "TOPLEFT", 14, -13)
scrollframe:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -14, 12)
scrollframe:SetScrollChild(contentframe)
frame.scrollframe = scrollframe
contentframe:SetPoint("TOPLEFT", scrollframe)
contentframe:SetPoint("TOPRIGHT", scrollframe)
local bgTex = frame:CreateTexture(nil, "ARTWORK")
bgTex:SetAllPoints(scrollframe)
@@ -247,7 +247,7 @@ do
slider:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -14, -10)
slider:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -14, 10)
slider:SetBackdrop(sliderBackdrop)
slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Vertical")
slider:SetThumbTexture([[Interface\Buttons\UI-SliderBar-Button-Vertical]])
slider:SetMinMaxValues(0, 1)
--slider:SetValueStep(1)
slider:SetWidth(12)
@@ -255,7 +255,7 @@ do
slider:SetScript("OnValueChanged", slider_OnValueChanged)
frame.slider = slider
end
frame:SetHeight(GetScreenHeight()*2/5)
frame:SetHeight(UIParent:GetHeight()*2/5)
frame.slider:SetValue(0)
frame:Show()
return frame
@@ -267,7 +267,7 @@ do
frame:Hide()
frame:SetBackdrop(frameBackdrop)
frame.bgTex:SetTexture(nil)
tinsert(DropDownCache, frame)
table.insert(DropDownCache, frame)
return nil
end
end