function XRS:SetupFrames()
-- Create Tooltip
if not self.tooltip then
self.tooltip = CreateFrame("GameTooltip", "XRSTooltip", UIParent, "GameTooltipTemplate")
end
-- Create XRS Frame
self.frame = CreateFrame("Frame", "XRSFrame", UIParent)
self.frame:EnableMouse(true)
self.frame:SetFrameStrata("MEDIUM")
self.frame:SetMovable(true)
self.frame:SetWidth(130)
self.frame:SetHeight(100)
-- Create Font String
self.xrsfs = self.frame:CreateFontString("$parentTitle","ARTWORK","GameFontNormal")
self.xrsfs:SetText("XRaidStatus")
self.xrsfs:SetPoint("TOP",0,-5)
local tc = self.db.profile.titlecolor
self.xrsfs:SetTextColor(tc.r,tc.g,tc.b,tc.a)
self.xrsfs:Show()
-- Backdrop options
self.frame:SetBackdrop( {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 5, right = 5, top = 5, bottom = 5 }
})
local boc = self.db.profile.bordercolor
self.frame:SetBackdropBorderColor(boc.r,boc.g,boc.b,boc.a)
local bc = self.db.profile.backgroundcolor
self.frame:SetBackdropColor(bc.r,bc.g,bc.b,bc.a)
-- Create color gradient
gradient = self.frame:CreateTexture(nil, "BORDER")
gradient:SetTexture("Interface\\ChatFrame\\ChatFrameBackground")
gradient:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 4, -4)
gradient:SetPoint("BOTTOMRIGHT", self.frame, "BOTTOMRIGHT", -4, 4)
gradient:SetBlendMode("ADD")
local cgstart = self.db.profile.colorgradientstart
local cgstop = self.db.profile.colorgradientstop
gradient:SetGradientAlpha("VERTICAL", cgstart.r, cgstart.g, cgstart.b, cgstart.a, cgstop.r, cgstop.g, cgstop.b, cgstop.a)
if not self.db.profile.colorgradient then
gradient:Hide()
end
self.framegradient = gradient
self.frame:ClearAllPoints()
self.frame:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
self.frame:SetScript("OnMouseDown",function()
if ( arg1 == "LeftButton" ) then
if not self.db.profile.Locked then
this:StartMoving()
end
end
end)
self.frame:SetScript("OnMouseUp",function()
if ( arg1 == "LeftButton" ) then
this:StopMovingOrSizing()
self:SavePosition()
end
end)
self.frame:SetScript("OnHide",function() this:StopMovingOrSizing() end)
self.frame:SetScript("OnShow",function()
for _,v in ipairs(bars) do
if v:GetType() ~= "blank" then
v:UpdateBar()
end
end
end)
-- Frame cannot be dragged off the screen
self.frame:SetClampedToScreen(true)
-- Loads the position of the frame
self:LoadPosition()
-- The scale from the db
self:UpdateScale()
self:Debug("XRS Frame created!")
-- Create a button for raid leader options
if (IsRaidLeader() or IsRaidOfficer()) then
self:CreateLeaderMenu()
end
-- Create all bars and buffs
self:SetupBars()
self:SetupBuffs()
self:SetWidth()
dewdrop:Register(self.frame,
'children', function()
dewdrop:FeedAceOptionsTable(options)
end)
end