/
## Interface: 30300 |
## Interface: 40000 |
## Title: CoolLine |
## Notes: Shows cooldowns on a single bar. |
## Author: TotalPackage |
## Version: 3.3.003 |
## Version: 4.0.001 |
## SavedVariables: CoolLineDB |
## SavedVariablesPerCharacter: CoolLineCharDB |
end) |
local smed = LibStub("LibSharedMedia-3.0") |
local is4 = GetSpellBookItemName and true or false |
local _G = getfenv(0) |
local pairs, ipairs = pairs, ipairs |
local tinsert, tremove = tinsert, tremove |
for k, v in pairs({ |
w = 360, h = 18, x = 0, y = -240, |
statusbar = "Blizzard", |
bgcolor = { r = 0, g = 0, b = 0, a = 0.6, }, |
bgcolor = { r = 0, g = 0, b = 0, a = 0.5, }, |
border = "Blizzard Dialog", |
bordercolor = { r = 1, g = 1, b = 1, a = 1, }, |
font = "Friz Quadrata TT", |
self.border:SetBackdropBorderColor(db.bordercolor.r, db.bordercolor.g, db.bordercolor.b, db.bordercolor.a) |
self.overlay = self.overlay or CreateFrame("Frame", nil, self.border) |
self.overlay:SetFrameLevel(11) |
self.overlay:SetFrameLevel(24) |
section = (db.vertical and db.h or db.w) / 6 |
iconsize = ((db.vertical and db.w) or db.h) + (db.iconplus or 0) |
frame:SetHeight(iconsize) |
end |
end |
CoolLine.updatelook = updatelook |
if IsLoggedIn() then |
CoolLine:PLAYER_LOGIN() |
throt = (throt < tthrot and throt) or tthrot |
isactive = active or isactive |
if fl then |
frame:SetFrameLevel(random(1,4) * 2 + 2) |
frame:SetFrameLevel(random(1,5) * 2 + 2) |
end |
SetValue(frame, position) |
end |
do -- cache spells that have a cooldown |
local CLTip = CreateFrame("GameTooltip", "CLTip", CoolLine, "GameTooltipTemplate") |
CLTip:SetOwner(CoolLine, "ANCHOR_NONE") |
local GetSpellName = GetSpellName |
local GetSpellName = is4 and GetSpellBookItemName or GetSpellName |
local cooldown1 = gsub(SPELL_RECAST_TIME_MIN, "%%%.%d[fg]", "(.+)") |
local cooldown2 = gsub(SPELL_RECAST_TIME_SEC, "%%%.%d[fg]", "(.+)") |
local function CheckRight(rtext) |
if sb[name] then |
sb[name] = i |
else |
CLTip:SetSpell(i, btype) |
CLTip[is4 and "SetSpellBookItem" or "SetSpell"](CLTip, i, btype) |
if CheckRight(CLTipTextRight2) or CheckRight(CLTipTextRight3) or CheckRight(CLTipTextRight4) then |
sb[name] = i |
end |