/
## Interface: 40300 |
## Interface: 50001 |
## Title: LovelyLoot |
## Author: Seerah |
## Version: 1.1.1 |
## Version: 2.0a |
## Notes: Making the loot frames more lovely to look at and work with. |
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, rActionButtonStyler, ButtonFacade |
## SavedVariables: LovelyLootDB |
ScrollFrame Container |
Plain container that scrolls its content and doesn't grow in height. |
-------------------------------------------------------------------------------]] |
local Type, Version = "ScrollFrame", 21 |
local Type, Version = "ScrollFrame", 23 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local methods = { |
["OnAcquire"] = function(self) |
self:SetScroll(0) |
self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate) |
end, |
["OnRelease"] = function(self) |
Button Widget |
Graphical Button. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Button", 21 |
local Type, Version = "Button", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local _G = _G |
local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent |
local wowMoP |
do |
local _, _, _, interface = GetBuildInfo() |
wowMoP = (interface >= 50000) |
end |
--[[----------------------------------------------------------------------------- |
Scripts |
-------------------------------------------------------------------------------]] |
-------------------------------------------------------------------------------]] |
local function Constructor() |
local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type) |
local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate2") |
local frame = CreateFrame("Button", name, UIParent, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") |
frame:Hide() |
frame:EnableMouse(true) |
Label Widget |
Displays text and optionally an icon. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Label", 21 |
local Type, Version = "Label", 23 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
else |
-- image on the left |
image:SetPoint("TOPLEFT") |
label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0) |
if image:GetHeight() > label:GetHeight() then |
label:SetPoint("LEFT", image, "RIGHT", 4, 0) |
else |
label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0) |
end |
label:SetWidth(width - imagewidth - 4) |
height = max(image:GetHeight(), label:GetHeight()) |
end |
local Type, Version = "MultiLineEditBox", 25 |
local Type, Version = "MultiLineEditBox", 27 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- List them here for Mikk's FindGlobals script |
-- GLOBALS: ACCEPT, ChatFontNormal |
local wowMoP |
do |
local _, _, _, interface = GetBuildInfo() |
wowMoP = (interface >= 50000) |
end |
--[[----------------------------------------------------------------------------- |
Support functions |
-------------------------------------------------------------------------------]] |
if not AceGUIMultiLineEditBoxInsertLink then |
-- upgradeable hook |
hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIMultiLineEditBoxInsertLink(...) end) |
end |
function _G.AceGUIMultiLineEditBoxInsertLink(text) |
for i = 1, AceGUI:GetWidgetCount(Type) do |
local editbox = _G[("MultiLineEditBox%uEdit"):format(i)] |
if editbox and editbox:IsVisible() and editbox:HasFocus() then |
editbox:Insert(text) |
return true |
end |
end |
end |
local function Layout(self) |
self:SetHeight(self.numlines * 14 + (self.disablebutton and 19 or 41) + self.labelHeight) |
label:SetText(ACCEPT) |
label:SetHeight(10) |
local button = CreateFrame("Button", ("%s%dButton"):format(Type, widgetNum), frame, "UIPanelButtonTemplate2") |
local button = CreateFrame("Button", ("%s%dButton"):format(Type, widgetNum), frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") |
button:SetPoint("BOTTOMLEFT", 0, 4) |
button:SetHeight(22) |
button:SetWidth(label:GetStringWidth() + 24) |
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged) |
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll) |
local editBox = CreateFrame("EditBox", nil, scrollFrame) |
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame) |
editBox:SetAllPoints() |
editBox:SetFontObject(ChatFontNormal) |
editBox:SetMultiLine(true) |
TabGroup Container |
Container that uses tabs on top to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TabGroup", 34 |
local Type, Version = "TabGroup", 35 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local rowwidths = {} |
local rowends = {} |
-- Determine if we're on WoW 4.0.6 or not. |
local wow_406 |
do |
local _,wow_build = GetBuildInfo() |
wow_406 = tonumber(wow_build) >= 13596 |
end |
--[[----------------------------------------------------------------------------- |
Support functions |
-------------------------------------------------------------------------------]] |
local function Tab_SetText(frame, text) |
frame:_SetText(text) |
local width = frame.obj.frame.width or frame.obj.frame:GetWidth() or 0 |
if wow_406 then |
PanelTemplates_TabResize(frame, 0, nil, nil, width, frame:GetFontString():GetStringWidth()) |
else |
PanelTemplates_TabResize(frame, 0, nil, width) |
end |
PanelTemplates_TabResize(frame, 0, nil, nil, width, frame:GetFontString():GetStringWidth()) |
end |
local function Tab_SetSelected(frame, selected) |
end |
for i = starttab, endtab do |
if wow_406 then |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, nil, width, tabs[i]:GetFontString():GetStringWidth()) |
else |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, width) |
end |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, nil, width, tabs[i]:GetFontString():GetStringWidth()) |
end |
starttab = endtab + 1 |
end |
Keybinding Widget |
Set Keybindings in the Config UI. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Keybinding", 22 |
local Type, Version = "Keybinding", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- List them here for Mikk's FindGlobals script |
-- GLOBALS: NOT_BOUND |
local wowMoP |
do |
local _, _, _, interface = GetBuildInfo() |
wowMoP = (interface >= 50000) |
end |
--[[----------------------------------------------------------------------------- |
Scripts |
-------------------------------------------------------------------------------]] |
local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type) |
local frame = CreateFrame("Frame", nil, UIParent) |
local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate2") |
local button = CreateFrame("Button", name, frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") |
button:EnableMouse(true) |
button:RegisterForClicks("AnyDown") |
msgframe:SetBackdropColor(0,0,0) |
msgframe:SetFrameStrata("FULLSCREEN_DIALOG") |
msgframe:SetFrameLevel(1000) |
msgframe:SetToplevel(true) |
local msg = msgframe:CreateFontString(nil, "OVERLAY", "GameFontNormal") |
msg:SetText("Press a key to bind, ESC to clear the binding or click the button again to cancel.") |
--[[----------------------------------------------------------------------------- |
Checkbox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "CheckBox", 21 |
local Type, Version = "CheckBox", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
self.frame:Disable() |
self.text:SetTextColor(0.5, 0.5, 0.5) |
SetDesaturation(self.check, true) |
if self.desc then |
self.desc:SetTextColor(0.5, 0.5, 0.5) |
end |
else |
self.frame:Enable() |
self.text:SetTextColor(1, 1, 1) |
else |
SetDesaturation(self.check, false) |
end |
if self.desc then |
self.desc:SetTextColor(1, 1, 1) |
end |
end |
end, |
--[[----------------------------------------------------------------------------- |
Frame Container |
-------------------------------------------------------------------------------]] |
local Type, Version = "Frame", 23 |
local Type, Version = "Frame", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
self:SetStatusText() |
self:ApplyStatus() |
self:Show() |
self:EnableResize(true) |
end, |
["OnRelease"] = function(self) |
--[[ |
--[[ |
Name: LibSharedMedia-3.0 |
Revision: $Revision: 62 $ |
Revision: $Revision: 74 $ |
Author: Elkano (elkano@gmx.de) |
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) |
Website: http://www.wowace.com/projects/libsharedmedia-3-0/ |
License: LGPL v2.1 |
]] |
local MAJOR, MINOR = "LibSharedMedia-3.0", 100001 -- increase manualy on changes |
local MAJOR, MINOR = "LibSharedMedia-3.0", 5000402 -- 5.0.4 v2 / increase manually on changes |
local lib = LibStub:NewLibrary(MAJOR, MINOR) |
if not lib then return end |
-- populate lib with default Blizzard data |
-- BACKGROUND |
if not lib.MediaTable.background then lib.MediaTable.background = {} end |
lib.MediaTable.background["None"] = [[]] |
lib.MediaTable.background["Blizzard Dialog Background"] = [[Interface\DialogFrame\UI-DialogBox-Background]] |
lib.MediaTable.background["Blizzard Dialog Background Dark"] = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]] |
lib.MediaTable.background["Blizzard Dialog Background Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Background]] |
lib.MediaTable.background["Blizzard Tabard Background"] = [[Interface\TabardFrame\TabardFrameBackground]] |
lib.MediaTable.background["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Background]] |
lib.MediaTable.background["Solid"] = [[Interface\Buttons\WHITE8X8]] |
lib.DefaultMedia.background = "None" |
-- BORDER |
if not lib.MediaTable.border then lib.MediaTable.border = {} end |
lib.MediaTable.border["None"] = [[Interface\None]] |
lib.MediaTable.border["None"] = [[]] |
lib.MediaTable.border["Blizzard Achievement Wood"] = [[Interface\AchievementFrame\UI-Achievement-WoodBorder]] |
lib.MediaTable.border["Blizzard Chat Bubble"] = [[Interface\Tooltips\ChatBubble-Backdrop]] |
lib.MediaTable.border["Blizzard Dialog"] = [[Interface\DialogFrame\UI-DialogBox-Border]] |
lib.MediaTable.border["Blizzard Dialog Gold"] = [[Interface\DialogFrame\UI-DialogBox-Gold-Border]] |
lib.MediaTable.border["Blizzard Party"] = [[Interface\CHARACTERFRAME\UI-Party-Border]] |
lib.MediaTable.border["Blizzard Tooltip"] = [[Interface\Tooltips\UI-Tooltip-Border]] |
lib.DefaultMedia.border = "None" |
-- FONT |
if not lib.MediaTable.font then lib.MediaTable.font = {} end |
local SML_MT_font = lib.MediaTable.font |
--[[ |
file name latin koKR ruRU zhCN zhTW |
2002.ttf 2002 X X X - - |
2002B.ttf 2002 Bold X X X - - |
ARHei.ttf AR CrystalzcuheiGBK Demibold X - X X X |
ARIALN.TTF Arial Narrow X - X - - |
ARKai_C.ttf AR ZhongkaiGBK Medium (Combat) X - X X X |
ARKai_T.ttf AR ZhongkaiGBK Medium X - X X X |
bHEI00M.ttf AR Heiti2 Medium B5 - - - - X |
bHEI01B.ttf AR Heiti2 Bold B5 - - - - X |
bKAI00M.ttf AR Kaiti Medium B5 - - - - X |
bLEI00D.ttf AR Leisu Demi B5 - - - - X |
FRIZQT__.TTF Friz Quadrata TT X - - - - |
FRIZQT___CYR.TTF FrizQuadrataCTT - - X - - |
K_Damage.TTF YDIWingsM - X X - - |
K_Pagetext.TTF MoK X X X - - |
MORPHEUS.TTF Morpheus X - - - - |
MORPHEUS_CYR.TTF Morpheus X - X - - |
NIM_____.ttf Nimrod MT X - X - - |
SKURRI.TTF Skurri X - - - - |
SKURRI_CYR.TTF Skurri X - X - - |
]] |
if locale == "koKR" then |
LOCALE_MASK = lib.LOCALE_BIT_koKR |
-- |
elseif locale == "zhCN" then |
LOCALE_MASK = lib.LOCALE_BIT_zhCN |
-- |
SML_MT_font["伤害æ°å"] = [[Fonts\ZYKai_C.ttf]] |
SML_MT_font["é»è®¤"] = [[Fonts\ZYKai_T.ttf]] |
SML_MT_font["è天"] = [[Fonts\ZYHei.ttf]] |
SML_MT_font["伤害æ°å"] = [[Fonts\ARKai_C.ttf]] |
SML_MT_font["é»è®¤"] = [[Fonts\ARKai_T.ttf]] |
SML_MT_font["è天"] = [[Fonts\ARHei.ttf]] |
-- |
lib.DefaultMedia["font"] = "é»è®¤" -- someone from zhCN please adjust if needed |
-- |
elseif locale == "ruRU" then |
LOCALE_MASK = lib.LOCALE_BIT_ruRU |
-- |
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] |
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] |
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS.TTF]] |
SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] |
SML_MT_font["Skurri"] = [[Fonts\SKURRI.TTF]] |
SML_MT_font["2002"] = [[Fonts\2002.TTF]] |
SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]] |
SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]] |
SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]] |
SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]] |
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] |
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT___CYR.TTF]] |
SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]] |
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]] |
SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] |
SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]] |
-- |
lib.DefaultMedia.font = "Friz Quadrata TT" |
-- |
LOCALE_MASK = lib.LOCALE_BIT_western |
locale_is_western = true |
-- |
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] |
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] |
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS.TTF]] |
SML_MT_font["Skurri"] = [[Fonts\SKURRI.TTF]] |
SML_MT_font["2002"] = [[Fonts\2002.TTF]] |
SML_MT_font["2002 Bold"] = [[Fonts\2002B.TTF]] |
SML_MT_font["AR CrystalzcuheiGBK Demibold"] = [[Fonts\ARHei.TTF]] |
SML_MT_font["AR ZhongkaiGBK Medium (Combat)"] = [[Fonts\ARKai_C.TTF]] |
SML_MT_font["AR ZhongkaiGBK Medium"] = [[Fonts\ARKai_T.TTF]] |
SML_MT_font["Arial Narrow"] = [[Fonts\ARIALN.TTF]] |
SML_MT_font["Friz Quadrata TT"] = [[Fonts\FRIZQT__.TTF]] |
SML_MT_font["MoK"] = [[Fonts\K_Pagetext.TTF]] |
SML_MT_font["Morpheus"] = [[Fonts\MORPHEUS_CYR.TTF]] |
SML_MT_font["Nimrod MT"] = [[Fonts\NIM_____.ttf]] |
SML_MT_font["Skurri"] = [[Fonts\SKURRI_CYR.TTF]] |
-- |
lib.DefaultMedia.font = "Friz Quadrata TT" |
-- |
if not lib.MediaTable.statusbar then lib.MediaTable.statusbar = {} end |
lib.MediaTable.statusbar["Blizzard"] = [[Interface\TargetingFrame\UI-StatusBar]] |
lib.MediaTable.statusbar["Blizzard Character Skills Bar"] = [[Interface\PaperDollInfoFrame\UI-Character-Skills-Bar]] |
lib.MediaTable.statusbar["Blizzard Raid Bar"] = [[Interface\RaidFrame\Raid-Bar-Hp-Fill]] |
lib.DefaultMedia.statusbar = "Blizzard" |
-- SOUND |
local mtt = mediaTable[mediatype] |
local overridekey = overrideMedia[mediatype] |
local result = mtt and ((overridekey and mtt[overridekey] or mtt[key]) or (not noDefault and defaultMedia[mediatype] and mtt[defaultMedia[mediatype]])) or nil |
return result |
return result ~= "" and result or nil |
end |
function lib:IsValid(mediatype, key) |
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames. |
-- @class file |
-- @name AceConfigCmd-3.0 |
-- @release $Id: AceConfigCmd-3.0.lua 904 2009-12-13 11:56:37Z nevcairiel $ |
-- @release $Id: AceConfigCmd-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $ |
--[[ |
AceConfigCmd-3.0 |
-- TODO: plugin args |
local MAJOR, MINOR = "AceConfigCmd-3.0", 12 |
local MAJOR, MINOR = "AceConfigCmd-3.0", 13 |
local AceConfigCmd = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigCmd then return end |
local r, g, b, a |
if tab.hasAlpha then |
local hasAlpha = tab.hasAlpha |
if type(hasAlpha) == "function" or type(hasAlpha) == "string" then |
info.hasAlpha = hasAlpha |
hasAlpha = callmethod(info, inputpos, tab, 'hasAlpha') |
info.hasAlpha = nil |
end |
if hasAlpha then |
if str:len() == 8 and str:find("^%x*$") then |
--parse a hex string |
r,g,b,a = tonumber(str:sub(1, 2), 16) / 255, tonumber(str:sub(3, 4), 16) / 255, tonumber(str:sub(5, 6), 16) / 255, tonumber(str:sub(7, 8), 16) / 255 |
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". |
-- @class file |
-- @name AceConfigRegistry-3.0 |
-- @release $Id: AceConfigRegistry-3.0.lua 998 2010-12-01 18:39:53Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 13 |
-- @release $Id: AceConfigRegistry-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 14 |
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigRegistry then return end |
dropdownControl=optstring, |
}, |
color={ |
hasAlpha=optbool, |
hasAlpha=optmethodbool, |
}, |
keybinding={ |
-- TODO |
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. |
-- @class file |
-- @name AceConfigDialog-3.0 |
-- @release $Id: AceConfigDialog-3.0.lua 998 2010-12-01 18:39:53Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1049 2012-04-02 13:22:10Z mikk $ |
local LibStub = LibStub |
local MAJOR, MINOR = "AceConfigDialog-3.0", 54 |
local MAJOR, MINOR = "AceConfigDialog-3.0", 57 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
local reg = LibStub("AceConfigRegistry-3.0") |
-- Lua APIs |
local tconcat, tinsert, tsort, tremove = table.concat, table.insert, table.sort, table.remove |
local tconcat, tinsert, tsort, tremove, tsort = table.concat, table.insert, table.sort, table.remove, table.sort |
local strmatch, format = string.match, string.format |
local assert, loadstring, error = assert, loadstring, error |
local pairs, next, select, type, unpack, wipe = pairs, next, select, type, unpack, wipe |
local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs |
local rawset, tostring, tonumber = rawset, tostring, tonumber |
local math_min, math_max, math_floor = math.min, math.max, math.floor |
t.text = message |
t.button1 = ACCEPT |
t.button2 = CANCEL |
t.preferredIndex = 3 |
local dialog, oldstrata |
t.OnAccept = function() |
safecall(func, unpack(t)) |
control.width = "fill" |
control:PauseLayout() |
local optionValue = GetOptionsMemberValue("get",v, options, path, appName, value) |
local optionValue = GetOptionsMemberValue("get",v, options, path, appName) |
local t = {} |
for value, text in pairs(values) do |
t[#t+1]=value |
end |
tsort(t) |
for k, value in ipairs(t) do |
local text = values[value] |
local radio = gui:Create("CheckBox") |
radio:SetLabel(text) |
radio:SetUserData("value", value) |
elseif v.type == "color" then |
control = gui:Create("ColorPicker") |
control:SetLabel(name) |
control:SetHasAlpha(v.hasAlpha) |
control:SetHasAlpha(GetOptionsMemberValue("hasAlpha",v, options, path, appName)) |
control:SetColor(GetOptionsMemberValue("get",v, options, path, appName)) |
control:SetCallback("OnValueChanged",ActivateControl) |
control:SetCallback("OnValueConfirmed",ActivateControl) |
--starting over from scratch! LL 2.0 |
local LL = CreateFrame("Frame") |
local llmodel = CreateFrame("PlayerModel", nil, LootFrame) |
local LootFrame = LootFrame |
local emptyFunc = function() end |
local LSM = LibStub("LibSharedMedia-3.0") |
local widgetLists = AceGUIWidgetLSMlists |
local frames = {LootFrame, GroupLootFrame1, GroupLootFrame2, GroupLootFrame3, GroupLootFrame4} |
local frames = {LootFrame} |
local LootFrame = LootFrame |
local SkinFrames, db, colorR, colorG, colorB |
local defaultValues = { |
end, |
order = .4, |
}, |
glfUnlocked = { |
name = "Unlock GroupLootFrames", |
desc = "If checked, the first (bottom) GroupLootFrame is unlocked and you can drag it on your screen. The rest will follow suit. (NOTE: The unless using another addon to move them, the achievement popups are anchored to the group loot frames as well.)", |
type = "toggle", |
get = function() return db.glfUnlocked end, |
set = function() |
db.glfUnlocked = not db.glfUnlocked |
GroupLootFrame1:SetMovable(db.glfUnlocked) |
GroupLootFrame1:EnableMouse(db.glfUnlocked) |
GroupLootFrame1:SetUserPlaced(db.glfUnlocked) |
end, |
order = .5, |
}, |
spacer1 = { |
name = " ", |
type = "description", |
db.bgColor.b = b |
db.bgColor.a = a |
for k,v in pairs(frames) do |
SkinFrames(v, true) |
SkinFrames(v) |
end |
end, |
order = 2, |
db.borderColor.b = b |
db.borderColor.a = a |
for k,v in pairs(frames) do |
SkinFrames(v, true) |
SkinFrames(v) |
end |
end, |
order = 4, |
end, |
order = 6, |
}, |
sbar = { |
name = "Timer bar texture", |
desc = "Texture to use for the timer bar on the group loot frames.", |
type = "select", |
dialogControl = "LSM30_Statusbar", |
values = widgetLists.statusbar, |
get = function() |
return db.sbar |
end, |
set = function(self, sbar) |
db.sbar = sbar |
for k,v in pairs(frames) do |
SkinFrames(v, true) |
end |
end, |
order = 7, |
}, |
sbarcolor = { |
name = "Timer bar color", |
desc = "The color of the timer bar for the group loot frames.", |
type = "color", |
hasAlpha = false, |
get = function() return db.sbarColor.r, db.sbarColor.g, db.sbarColor.b end, |
set = function(_,r,g,b) |
db.sbarColor.r = r |
db.sbarColor.g = g |
db.sbarColor.b = b |
for k,v in pairs(frames) do |
SkinFrames(v, true) |
end |
end, |
order = 8, |
}, |
hideDragon = { |
name = "Hide Elite Dragon", |
desc = "Hides the dragon on group loot frames when looting from an elite npc.", |
type = "toggle", |
get = function() return db.hideDragon end, |
set = function() |
db.hideDragon = not db.hideDragon |
for k,v in pairs(frames) do |
SkinFrames(v, true) |
end |
end, |
order = 8.5, |
}, |
spacer4 = { |
name = " ", |
type = "description", |
} |
--generic bg/border changing |
function SkinFrames(frame, config) |
--print("skinned: "..frame:GetName()) |
--frame:SetBackdrop({ |
frame.OLDSetBackdrop(frame, { |
function SkinFrames(frame) |
frame:SetBackdrop({ |
bgFile = LSM:Fetch("background", db.bg), |
edgeFile = LSM:Fetch("border", db.border), |
--tile = true, |
--tileSize = 8, |
edgeSize = db.borderWidth, |
insets = {left=db.inset,right=db.inset,top=db.inset,bottom=db.inset} |
}) |
--if config then --this code only needs run if called by the options window or at startup |
frame:SetBackdropColor(db.bgColor.r, db.bgColor.g, db.bgColor.b, db.bgColor.a) |
frame:SetBackdropBorderColor(db.borderColor.r, db.borderColor.g, db.borderColor.b, db.borderColor.a) |
if frame ~= LootFrame then |
_G[frame:GetName().."Timer"]:SetStatusBarTexture(LSM:Fetch("statusbar", db.sbar)) |
_G[frame:GetName().."Timer"]:SetStatusBarColor(db.sbarColor.r, db.sbarColor.g, db.sbarColor.b, db.sbarColor.a) |
if db.hideDragon then |
_G[frame:GetName().."Decoration"]:SetTexture() |
else |
_G[frame:GetName().."Decoration"]:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon") |
end |
end |
--end |
frame:SetBackdropColor(db.bgColor.r, db.bgColor.g, db.bgColor.b, db.bgColor.a) |
frame:SetBackdropBorderColor(db.borderColor.r, db.borderColor.g, db.borderColor.b, db.borderColor.a) |
end |
--The regular loot frame-- |
local function LootFrameEdits() |
local portrait, bg, title, prevtext, nextext = LootFrame:GetRegions() |
local bg, titlebg, portrait, portraitframe, trcorner, tlcorner, top, |
unknowntitle, topstreak, blcorner, brcorner, bottom, left, right, btncornerL, |
btncornerR, btnbottom, portraitoverlay, title, prevtext, nextext = LootFrame:GetRegions() |
--hide extras |
bg:Hide() |
titlebg:Hide() |
portrait:Hide() |
portraitframe:Hide() |
trcorner:Hide() |
tlcorner:Hide() |
top:Hide() |
topstreak:Hide() |
blcorner:Hide() |
brcorner:Hide() |
bottom:Hide() |
left:Hide() |
right:Hide() |
portraitoverlay:Hide() |
btncornerL:Hide() |
btncornerR:Hide() |
btnbottom:Hide() |
LootFrameInset:Hide() |
--rearrange stuff |
LootFrameUpButton:ClearAllPoints() |
LootFrameUpButton:SetPoint("BOTTOMLEFT", 15, 16) |
LootFrameUpButton:SetPoint("BOTTOMLEFT", 12, 12) |
LootFrameDownButton:ClearAllPoints() |
LootFrameDownButton:SetPoint("BOTTOMLEFT", 133, 16) |
LootFrameDownButton:SetPoint("BOTTOMRIGHT", -12, 12) |
prevtext:ClearAllPoints() |
prevtext:SetPoint("BOTTOMLEFT", 47, 27) |
prevtext:SetPoint("LEFT", LootFrameUpButton, "RIGHT", 3, 0) |
nextext:ClearAllPoints() |
nextext:SetPoint("BOTTOMRIGHT", LootFrame, "BOTTOMLEFT", 132, 27) |
LootCloseButton:ClearAllPoints() |
LootCloseButton:SetPoint("TOPRIGHT", -2, 0) |
nextext:SetPoint("RIGHT", LootFrameDownButton, "LEFT", -3, 0) |
LootFrameCloseButton:ClearAllPoints() |
LootFrameCloseButton:SetPoint("TOPRIGHT", -2, 0) |
title:ClearAllPoints() |
title:SetPoint("TOP", 0, -10) |
LootButton1:ClearAllPoints() |
end |
--resize actual loot frame |
LootFrame:SetWidth(179) |
LootFrame:SetSize(179,250) |
LootFrame:SetHitRectInsets(0,0,0,0) |
--keep it from being moved by the UI |
--we can still drag it, but now it'll stay put |
--it even gets saved in layout-local.txt for us! |
UIPanelWindows["LootFrame"] = nil |
--LootFrame.ClearAllPoints = emptyFunc |
--LootFrame.SetPoint = emptyFunc |
--lock/unlock it |
--make it movable |
LootFrame:EnableMouse(db.lfUnlocked) |
LootFrame:SetUserPlaced(true) |
LootFrame:RegisterForDrag("LeftButton") |
LootFrame:SetScript("OnDragStart", function() LootFrame:StartMoving() end) |
LootFrame:SetScript("OnDragStop", function() LootFrame:StopMovingOrSizing() end) |
--keep it from being moved by frames in the UI |
UIPanelWindows["LootFrame"] = nil |
--give loot frame a backdrop instead of using the bg texture |
--SkinFrames(LootFrame, true) |
--setup model |
llmodel:SetPoint("TOPLEFT", 15, -30) |
llmodel:SetPoint("TOPRIGHT", -15, -30) |
}) |
llmodel:SetBackdropColor(.2,.2,.2,.5) |
--skin icons |
--skin icons with rABS |
if IsAddOnLoaded("rActionButtonStyler") then |
colorR,colorG,colorB = ActionButton1NormalTexture:GetVertexColor() |
for i = 1, 4 do |
end |
end |
--group loot frames |
local function GroupLootFrames() |
--move frames |
local GroupLootFrame1 = GroupLootFrame1 |
GroupLootFrame1:SetScript("OnMouseDown", function(self) |
self:StartMoving() |
end) |
GroupLootFrame1:SetScript("OnMouseUp", function(self) |
self:StopMovingOrSizing() |
db.rollAnchor.anch1, _, db.rollAnchor.anch2, db.rollAnchor.xpos, db.rollAnchor.ypos = self:GetPoint() |
end) |
GroupLootFrame1:ClearAllPoints() |
GroupLootFrame1:SetPoint(db.rollAnchor.anch1, UIParent, db.rollAnchor.anch2, db.rollAnchor.xpos, db.rollAnchor.ypos) |
--lock/unlock |
GroupLootFrame1:SetMovable(db.glfUnlocked) |
GroupLootFrame1:EnableMouse(db.glfUnlocked) |
GroupLootFrame1:SetUserPlaced(db.glfUnlocked) |
--skinning frames needs to be done on each show to override |
--default UI's changing the bg/border |
--using the event is too early |
--hooksecurefunc("GroupLootFrame_OnShow", function(frame) print("frame: "..frame:GetName()) SkinFrames(frame) end) |
--local OLDGroupLootFrame_OnShow = GroupLootFrame_OnShow |
--GroupLootFrame_OnShow = function(self) |
--OLDGroupLootFrame_OnShow(self) |
--SkinFrames(self) |
--end |
--rearrange stuff |
local frame |
for i = 1,4 do |
frame = _G["GroupLootFrame"..i] |
frame:SetWidth(335) |
frame:SetHeight(67) |
frame = frame:GetName() |
_G[frame.."Corner"]:Hide() |
_G[frame.."PassButton"]:ClearAllPoints() |
_G[frame.."PassButton"]:SetPoint("TOPRIGHT", -20, -10) |
_G[frame.."DisenchantButton"]:ClearAllPoints() |
_G[frame.."DisenchantButton"]:SetPoint("TOPRIGHT", -55, -14) |
_G[frame.."DisenchantButton"]:SetHeight(26) |
_G[frame.."DisenchantButton"]:SetWidth(26) |
_G[frame.."GreedButton"]:ClearAllPoints() |
_G[frame.."GreedButton"]:SetPoint("RIGHT", _G[frame.."DisenchantButton"], "LEFT", -7, -3) |
_G[frame.."GreedButton"]:SetHeight(26) |
_G[frame.."GreedButton"]:SetWidth(26) |
_G[frame.."RollButton"]:ClearAllPoints() |
_G[frame.."RollButton"]:SetPoint("RIGHT", _G[frame.."GreedButton"], "LEFT", -7, 1) |
_G[frame.."RollButton"]:SetHeight(26) |
_G[frame.."RollButton"]:SetWidth(26) |
--local sbarborder, sbar = GroupLootFrame1Timer:GetRegions() |
_G[frame.."Timer"]:ClearAllPoints() |
_G[frame.."Timer"]:SetPoint("BOTTOMRIGHT", -15, 15) |
_G[frame.."Timer"]:SetWidth(147) |
_G[frame.."SlotTexture"]:Hide() |
_G[frame.."Decoration"]:SetHeight(96) |
_G[frame.."Decoration"]:SetWidth(96) |
_G[frame.."Decoration"]:ClearAllPoints() |
_G[frame.."Decoration"]:SetPoint("TOPLEFT", -25, 13) |
--skin icons |
if IsAddOnLoaded("rActionButtonStyler") then |
_G[frame.."IconFrame"]:SetNormalTexture("Interface\\AddOns\\rActionButtonStyler\\media\\gloss") |
local iconborder = _G[frame.."IconFrame"]:GetNormalTexture() |
iconborder:SetVertexColor(colorR,colorG,colorB) |
iconborder.SetVertexColor = emptyFunc |
_G[frame.."IconFrame"]:SetPushedTexture("Interface\\AddOns\\rActionButtonStyler\\media\\pushed") |
_G[frame.."IconFrame"]:SetHighlightTexture("Interface\\AddOns\\rActionButtonStyler\\media\\hover") |
else |
_G[frame.."IconFrame"]:SetNormalTexture("") |
--_G[frame.."IconFrame"]:SetPushedTexture("") |
_G[frame.."IconFrameIcon"]:SetTexCoord(.1,.9,.1,.9) |
end |
end |
end |
local function SetUpDB() |
if LovelyLootPCDB.charSpec then |
--set defaults if new charSpec DB |
SLASH_LOVELYLOOT2 = "/ll" |
LootFrameEdits() |
GroupLootFrames() |
for k,v in pairs(frames) do |
v.OLDSetBackdrop = v.SetBackdrop |
v.SetBackdrop = emptyFunc |
SkinFrames(v, true) |
end |
SkinFrames(LootFrame) |
--cleanup |
LL:UnregisterEvent("PLAYER_ENTERING_WORLD") |
Initialize = nil |
LootFrameEdits = nil |
GroupLootFrames = nil |
end |
LL:RegisterEvent("PLAYER_ENTERING_WORLD") |
else |
llmodel:ClearModel() |
llmodel:SetModel("PARTICLES\\Lootfx.m2") |
--llmodel:SetCamera(1) |
end |
else |
Initialize() |
end |
end) |