/
local SkinFrames, db, colorR, colorG, colorB |
local defaultValues = { |
lfUnlocked = true, |
glfUnlocked = true, |
rollAnchor = { |
anch1 = "BOTTOM", |
anch2 = "BOTTOM", |
name = "Lovely Loot", |
type = "group", |
args = { |
lfUnlocked = { |
name = "Unlock LootFrame", |
desc = "If checked, the LootFrame is unlocked and you can drag it on your screen.", |
type = "toggle", |
get = function() return db.lfUnlocked end, |
set = function() |
db.lfUnlocked = not db.lfUnlocked |
LootFrame:EnableMouse(db.lfUnlocked) |
LootFrame:SetUserPlaced(true) |
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.", |
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, |
}, |
bg = { |
name = "Background", |
desc = "Texture to use as the background of the loot frames.", |
--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 |
--LootFrame.ClearAllPoints = emptyFunc |
--LootFrame.SetPoint = emptyFunc |
--lock/unlock it |
LootFrame:EnableMouse(db.lfUnlocked) |
LootFrame:SetUserPlaced(true) |
--give loot frame a backdrop instead of using the bg texture |
--SkinFrames(LootFrame, true) |
local function GroupLootFrames() |
--move frames |
local GroupLootFrame1 = GroupLootFrame1 |
GroupLootFrame1:EnableMouse(true) |
GroupLootFrame1:SetMovable(true) |
GroupLootFrame1:SetUserPlaced(true) |
GroupLootFrame1:SetScript("OnMouseDown", function(self) |
self:StartMoving() |
end) |
db.rollAnchor.anch1, _, db.rollAnchor.anch2, db.rollAnchor.xpos, db.rollAnchor.ypos = self:GetPoint() |
end) |
GroupLootFrame1:ClearAllPoints() |
--GroupLootFrame1:SetPoint(db.rollAnchor.anch1, db.rollAnchor.anch2 or UIParent, db.rollAnchor.relC, db.rollAnchor.xpos, db.rollAnchor.ypos) |
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 |
local function Initialize() |
LovelyLootDB = LovelyLootDB or {} |
LovelyLootDB = LovelyLootDB or {} |
LovelyLootPCDB = LovelyLootPCDB or {} |
if LovelyLootPCDB.charSpec == nil then |
LovelyLootPCDB.charSpec = false |
## Interface: 30300 |
## Title: LovelyLoot |
## Author: Seerah |
## Version: 1.0 Beta 1 |
## Version: 1.0 Beta 2 |
## Notes: Making the loot frames more lovely to look at and work with. |
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, rActionButtonStyler |
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, rActionButtonStyler, ButtonFacade |
## SavedVariables: LovelyLootDB |
## SavedVariablesPerCharacter: LovelyLootPCDB |