/trunk/sStats/libs/AceGUI-3.0-SharedMediaWidgets
do |
local widgetType = "LSM30_Font" |
local widgetVersion = 7 |
local widgetVersion = 9 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function SetText(self, text) -- Set the text displayed in the box. |
self.frame.text:SetText(text or "") |
local font = self.list[text] or Media:Fetch('font',text) |
local font = self.list[text] ~= text and self.list[text] or Media:Fetch('font',text) |
local _, size, outline= self.frame.text:GetFont() |
self.frame.text:SetFont(font,size,outline) |
end |
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown) |
AceGUI:ClearFocus() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
for k, v in pairs(self.list) do |
for i, k in ipairs(sortedlist) do |
local f = GetContentLine() |
local _, size, outline= f.text:GetFont() |
f.text:SetFont(self.list[k],size,outline) |
local font = self.list[k] ~= k and self.list[k] or Media:Fetch('font',k) |
f.text:SetFont(font,size,outline) |
f.text:SetText(k) |
if k == self.value then |
f.check:Show() |
f.obj = self |
self.dropdown:AddFrame(f) |
end |
AceGUI:SetFocus(self) |
wipe(sortedlist) |
end |
end |
do |
local widgetType = "LSM30_Sound" |
local widgetVersion = 7 |
local widgetVersion = 9 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function ContentSpeakerOnClick(this, button) |
local self = this.frame.obj |
local sound = this.frame.text:GetText() |
PlaySoundFile(self.list[sound] or Media:Fetch('sound',sound)) |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound)) |
end |
local function GetContentLine() |
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown) |
AceGUI:ClearFocus() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
for k, v in pairs(self.list) do |
f.obj = self |
self.dropdown:AddFrame(f) |
end |
AceGUI:SetFocus(self) |
wipe(sortedlist) |
end |
end |
local function WidgetPlaySound(this) |
local self = this.obj |
local sound = self.frame.text:GetText() |
PlaySoundFile(self.list[sound] or Media:Fetch('sound',sound)) |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound)) |
end |
local function Constructor() |
do |
local widgetType = "LSM30_Statusbar" |
local widgetVersion = 7 |
local widgetVersion = 9 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function SetText(self, text) -- Set the text displayed in the box. |
self.frame.text:SetText(text or "") |
local statusbar = self.list[k] or Media:Fetch('statusbar',text) |
local statusbar = self.list[text] ~= text and self.list[text] or Media:Fetch('statusbar',text) |
self.bar:SetTexture(statusbar) |
end |
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown) |
AceGUI:ClearFocus() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
for k, v in pairs(self.list) do |
f.check:Show() |
end |
local statusbar = self.list[k] or Media:Fetch('statusbar',k) |
local statusbar = self.list[k] ~= k and self.list[k] or Media:Fetch('statusbar',k) |
f.bar:SetTexture(statusbar) |
f.obj = self |
f.dropdown = self.dropdown |
self.dropdown:AddFrame(f) |
end |
AceGUI:SetFocus(self) |
wipe(sortedlist) |
end |
end |
bar:SetPoint("BOTTOMRIGHT", frame,"BOTTOMRIGHT", -21, 5) |
self.bar = bar |
self.alignoffset = 31 |
self.OnRelease = OnRelease |
self.OnAcquire = OnAcquire |
self.ClearFocus = ClearFocus |
do |
local widgetType = "LSM30_Border" |
local widgetVersion = 7 |
local widgetVersion = 9 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function ContentOnEnter(this, button) |
local self = this.obj |
local text = this.text:GetText() |
local border = self.list[text] or Media:Fetch('border',text) |
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]], |
tile = true, tileSize = 16, edgeSize = 16, |
local function SetText(self, text) -- Set the text displayed in the box. |
self.frame.text:SetText(text or "") |
local border = self.list[text] or Media:Fetch('border',text) |
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]], |
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown) |
AceGUI:ClearFocus() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
for k, v in pairs(self.list) do |
f.dropdown = self.dropdown |
self.dropdown:AddFrame(f) |
end |
AceGUI:SetFocus(self) |
wipe(sortedlist) |
end |
end |
do |
local widgetType = "LSM30_Background" |
local widgetVersion = 7 |
local widgetVersion = 9 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function ContentOnEnter(this, button) |
local self = this.obj |
local text = this.text:GetText() |
local background = self.list[text] or Media:Fetch('background',text) |
local background = self.list[text] ~= text and self.list[text] or Media:Fetch('background',text) |
self.dropdown.bgTex:SetTexture(background) |
end |
local function SetText(self, text) -- Set the text displayed in the box. |
self.frame.text:SetText(text or "") |
local background = self.list[text] or Media:Fetch('background',text) |
local background = self.list[text] ~= text and self.list[text] or Media:Fetch('background',text) |
self.frame.displayButton:SetBackdrop({bgFile = background, |
edgeFile = "Interface/Tooltips/UI-Tooltip-Border", |
self.dropdown = AGSMW:ReturnDropDownFrame(self.dropdown) |
AceGUI:ClearFocus() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
for k, v in pairs(self.list) do |
f.dropdown = self.dropdown |
self.dropdown:AddFrame(f) |
end |
AceGUI:SetFocus(self) |
wipe(sortedlist) |
end |
end |
local DataVersion = 9001 -- dev version always overwrites everything else :) |
--@end-debug@]===] |
--@non-debug@ |
local DataVersion = 27 or 1 |
local DataVersion = 32 |
--@end-non-debug@ |
local AGSMW = LibStub:NewLibrary("AceGUISharedMediaWidgets-1.0", DataVersion) |