/trunk
local llmodel = CreateFrame("PlayerModel", nil, LootFrame) |
local LSM = LibStub("LibSharedMedia-3.0") |
local widgetLists = AceGUIWidgetLSMlists |
local frames = {LootFrame} |
local frames = {LootFrame, GroupLootFrame1, GroupLootFrame2, GroupLootFrame3, GroupLootFrame4, |
BonusRollLootWonFrame, BonusRollMoneyWonFrame} |
local LootFrame = LootFrame |
local SkinFrames, db, colorR, colorG, colorB |
local GLC = GroupLootContainer |
local SkinFrames, db, colorR, colorG, colorB, MoveGroupLootFrames, GLCmover |
local showMover = false |
local defaultValues = { |
lfUnlocked = true, |
glfUnlocked = true, |
rollAnchor = { |
anch1 = "BOTTOM", |
anch2 = "BOTTOM", |
xpos = 0, ypos = 60}, |
bg = "Blizzard Dialog Background", |
border = "Blizzard Dialog", |
borderWidth = 22, |
borderColor = {r = 1, g = 1, b = 1, a = 1}, |
sbar = "Blizzard", |
sbarColor = {r = 1, g = 1, b = 0}, |
hideDragon = false, |
rollAnchor = { |
anch1 = "BOTTOM", |
anch2 = "BOTTOM", |
xpos = 0, ypos = 60}, |
} |
local options = { |
LootFrame:EnableMouse(db.lfUnlocked) |
LootFrame:SetUserPlaced(true) |
end, |
order = .4, |
order = 1, |
}, |
GLCmover = { |
name = "Move GroupLoot Frames", |
desc = "If checked, an anchor is shown and you can drag it on your screen. The loot frames 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 showMover end, |
set = function() |
showMover = not showMover |
MoveGroupLootFrames(showMover) |
end, |
order = 2, |
}, |
spacer1 = { |
name = " ", |
type = "description", |
width = "full", |
order = .6, |
order = 3, |
}, |
divider1 = { |
name = "Appearance", |
type = "header", |
order = .7, |
order = 4, |
}, |
bg = { |
name = "Background", |
SkinFrames(v) |
end |
end, |
order = 1, |
order = 5, |
}, |
bgColor = { |
name = "Background Color/Alpha", |
SkinFrames(v) |
end |
end, |
order = 2, |
order = 6, |
}, |
border = { |
name = "Border", |
SkinFrames(v) |
end |
end, |
order = 3, |
order = 7, |
}, |
borderColor = { |
name = "Border Color/Alpha", |
SkinFrames(v) |
end |
end, |
order = 4, |
order = 8, |
}, |
borderWidth = { |
name = "Border Width", |
SkinFrames(v) |
end |
end, |
order = 5, |
order = 9, |
}, |
inset = { |
name = "Inset", |
SkinFrames(v) |
end |
end, |
order = 6, |
order = 10, |
}, |
spacer4 = { |
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) |
end |
end, |
order = 11, |
}, |
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) |
end |
end, |
order = 12, |
}, |
spacer2 = { |
name = " ", |
type = "description", |
width = "full", |
order = 9, |
order = 13, |
}, |
divider = { |
divider2 = { |
name = "Profile Management", |
type = "header", |
order = 10, |
order = 14, |
}, |
charSpec = { |
name = "Character specific settings", |
LovelyLootPCDB.charSpec = not LovelyLootPCDB.charSpec |
ReloadUI() |
end, |
order = 11, |
order = 15, |
}, |
copyProfile = { |
name = "Copy from Default", |
confirm = true, |
disabled = function() return not LovelyLootPCDB.charSpec end, |
func = function() |
LovelyLootPCDB = WFWWDB |
LovelyLootPCDB = LovelyLootDB |
LovelyLootPCDB.charSpec = true |
ReloadUI() |
end, |
order = 12, |
order = 16, |
}, |
resetProfile = { |
name = "Profile Reset", |
end |
ReloadUI() |
end, |
order = 13, |
order = 17, |
}, |
} |
} |
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 strfind(frame:GetName(), "GroupLootFrame") then |
frame.Timer:SetStatusBarTexture(LSM:Fetch("statusbar", db.sbar)) |
frame.Timer:SetStatusBarColor(db.sbarColor.r, db.sbarColor.g, db.sbarColor.b, db.sbarColor.a) |
end |
end |
--The regular loot frame-- |
LootFrame:EnableMouse(db.lfUnlocked) |
LootFrame:SetUserPlaced(true) |
LootFrame:RegisterForDrag("LeftButton") |
LootFrame:SetScript("OnDragStart", function() LootFrame:StartMoving() end) |
LootFrame:SetScript("OnDragStop", function() LootFrame:StopMovingOrSizing() end) |
LootFrame:SetScript("OnDragStart", function(self) self:StartMoving() end) |
LootFrame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end) |
--keep it from being moved by frames in the UI |
UIPanelWindows["LootFrame"] = nil |
if not LootFrame:GetPoint() then |
LootFrame:SetPoint("TOPLEFT", 30, -200) |
end |
--setup model |
llmodel:SetPoint("TOPLEFT", 15, -30) |
llmodel:SetHeight(40) |
llmodel:SetBackdrop({ |
bgFile = "Interface\\Buttons\\WHITE8x8", |
--edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Gold-Border", |
tile = true, |
tileSize = 8, |
--edgeSize = 16, |
}) |
llmodel:SetBackdropColor(.2,.2,.2,.5) |
--skin icons with rABS |
if IsAddOnLoaded("rActionButtonStyler") then |
colorR,colorG,colorB = ActionButton1NormalTexture:GetVertexColor() |
end |
end |
--Group Loot frames-- |
local function GroupLootFrames() |
--place our frames |
GLC:ClearAllPoints() |
GLC:SetPoint(db.rollAnchor.anch1, UIParent, db.rollAnchor.anch2, db.rollAnchor.xpos, db.rollAnchor.ypos) |
for i=1,4 do |
local frame = _G["GroupLootFrame"..i] |
frame:SetWidth(335) |
frame:SetHeight(67) |
frame.Border:Hide() |
frame.Background:Hide() |
frame.IconFrame:ClearAllPoints() |
frame.IconFrame:SetPoint("LEFT", frame, 15, 0) |
frame.IconFrame.Icon:ClearAllPoints() |
frame.IconFrame.Icon:SetPoint("CENTER") |
frame.IconFrame.Icon:SetSize(40,40) |
frame.IconFrame.Icon:SetTexCoord(.07,.93,.07,.93) |
frame.IconFrame.Border:SetTexture("Interface\\AddOns\\LovelyLoot\\ButtonHilight-Square") |
frame.IconFrame.Border:SetTexCoord(0,1,0,1) |
frame.IconFrame.Border.SetTexCoord = function() end |
frame.Name:ClearAllPoints() |
frame.Name:SetPoint("LEFT", frame.IconFrame, "RIGHT", 10, 0) |
frame.Name:SetWidth(115) |
frame.PassButton:ClearAllPoints() |
frame.PassButton:SetPoint("TOPRIGHT", -25, -14) |
frame.PassButton:SetHeight(25) |
frame.PassButton:SetWidth(25) |
frame.DisenchantButton:ClearAllPoints() |
frame.DisenchantButton:SetPoint("TOPRIGHT", -55, -14) |
frame.DisenchantButton:SetHeight(26) |
frame.DisenchantButton:SetWidth(26) |
frame.GreedButton:ClearAllPoints() |
frame.GreedButton:SetPoint("RIGHT", frame.DisenchantButton, "LEFT", -7, -3) |
frame.GreedButton:SetHeight(26) |
frame.GreedButton:SetWidth(26) |
frame.NeedButton:ClearAllPoints() |
frame.NeedButton:SetPoint("RIGHT", frame.GreedButton, "LEFT", -7, 1) |
frame.NeedButton:SetHeight(26) |
frame.NeedButton:SetWidth(26) |
frame.Timer:ClearAllPoints() |
frame.Timer:SetPoint("BOTTOMRIGHT", -15, 15) |
frame.Timer:SetWidth(147) |
end |
end |
function MoveGroupLootFrames(showMover) |
if not GLCmover then |
GLCmover = GLC:CreateTexture() |
GLCmover:SetAllPoints(GLC) |
GLC:SetSize(335, 20) --make wider for new GroupLoot frames and taller for dragging |
GLC:EnableMouse(true) |
GLC:SetMovable(true) |
GLC:RegisterForDrag("LeftButton") |
GLC:SetScript("OnDragStart", function(self) self:StartMoving() end) |
GLC:SetScript("OnDragStop", function(self) |
self:StopMovingOrSizing() |
db.rollAnchor.anch1, _, db.rollAnchor.anch2, db.rollAnchor.xpos, db.rollAnchor.ypos = self:GetPoint() |
end) |
end |
if showMover then |
GLCmover:SetTexture(1,1,1,1) |
GLC:Show() |
else |
GLCmover:SetTexture(0,0,0,0) |
GLC:Hide() |
end |
end |
--LootWon & MoneyWon frames-- |
local function BonusRollFrames() |
BonusRollLootWonFrame.IconBorder:SetTexture("Interface\\AddOns\\LovelyLoot\\ButtonHilight-Square") |
BonusRollLootWonFrame.IconBorder:SetTexCoord(0,1,0,1) |
BonusRollLootWonFrame.IconBorder.SetTexCoord = function() end |
BonusRollLootWonFrame.Icon:SetTexCoord(.07,.93,.07,.93) |
BonusRollLootWonFrame.Background:Hide() |
BonusRollMoneyWonFrame.IconBorder:SetTexture("Interface\\AddOns\\LovelyLoot\\ButtonHilight-Square") |
BonusRollMoneyWonFrame.IconBorder:SetTexCoord(0,1,0,1) |
BonusRollMoneyWonFrame.IconBorder.SetTexCoord = function() end |
BonusRollMoneyWonFrame.Icon:SetTexCoord(.07,.93,.07,.93) |
BonusRollMoneyWonFrame.Background:Hide() |
end |
local function SetUpDB() |
if LovelyLootPCDB.charSpec then |
--set defaults if new charSpec DB |
SLASH_LOVELYLOOT2 = "/ll" |
LootFrameEdits() |
SkinFrames(LootFrame) |
GroupLootFrames() |
BonusRollFrames() |
for k,v in pairs(frames) do |
SkinFrames(v) |
end |
--clean up after myself |
LL:UnregisterEvent("PLAYER_ENTERING_WORLD") |
Initialize = nil |
LootFrameEdits = nil |
GroupLootFrames = nil |
BonusRollFrames = nil |
end |
LL:RegisterEvent("PLAYER_ENTERING_WORLD") |
if event == "LOOT_OPENED" then |
if UnitExists("target") then |
llmodel:SetUnit("target") |
llmodel:SetCamera(0) |
--llmodel:SetCamera(0) |
else |
llmodel:ClearModel() |
llmodel:SetModel("PARTICLES\\Lootfx.m2") |
llmodel:SetModel("PARTICLES\\Lootfx_green.m2") |
end |
else |
Initialize() |
## Interface: 50001 |
## Title: LovelyLoot |
## Author: Seerah |
## Version: 2.0a |
## Version: 2.0b |
## 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 |