/
end, |
set = function(self, inp) CompactBars.db.profile.spells[info.spellid..info.typ].class = inp end, |
}, |
} |
if info.typ == "Dots" then |
-- add the ticker things |
CompactBarsConfig.args.spells.args[info.typ].args[tostring(info.spellid)].args.tickerenabled = { |
name = L["Enable Ticks"], |
type = "toggle", |
get = function(self) return CompactBars.db.profile.spells[info.spellid..info.typ].eticks end, |
set = function(self, val) CompactBars.db.profile.spells[info.spellid..info.typ].eticks = val end, |
order = -2, |
} |
CompactBarsConfig.args.spells.args[info.typ].args[tostring(info.spellid)].args.tickertime = { |
name = L["Tick time"], |
type = "range", |
min = 1, |
max = 10, |
step = 1, |
get = function(self) return CompactBars.db.profile.spells[info.spellid..info.typ].ticktimer end, |
set = function(self, val) CompactBars.db.profile.spells[info.spellid..info.typ].ticktimer = val end, |
order = -1, |
} |
end |
end |
function config:insertConfigSpell() |
if isSpell(tmp.spellid) and not isAV(tmp.spellid, tmp.typ) then |
sb:CreateBar(info, dur, 0, nil, select(3, GetSpellInfo(info.spellid)), getBarPos(info.dguid, info.typ), color, colorzero, CompactBars.db.profile.bartexture) |
CompactBars:updateBarPos() |
end |
CompactBars.sb:UpdateFrameLevel() |
end |
local function setBarColor(info, color, colorzero) |
-- internal cooldowns |
info = createSpellInfo(UnitGUID("player"), spellid, "InternalCooldowns", dname) |
dur, appl, color, colorzero = CompactBars:GetSpellInfo("InternalCooldowns", spellid) |
if not dur then return end |
if not tonumber(dur) then return end |
if not color then |
color, colorzero = schoolColor(spellschool) |
if dur then |
if tonumber(dur) then |
if not color then |
color, colorzero = schoolColor(spellschool) |
end |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
if appl then |
color.a = (1/appl) * (color.a or 1) |
end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
CompactBars:updateBarPos() |
end |
end |
end |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
if appl then |
color.a = (1/appl) * (color.a or 1) |
end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
CompactBars:updateBarPos() |
end |
-- ic end |
-- ic end |
elseif event == "SPELL_AURA_REMOVED" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then |
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid), dname) |
if not info then return end |
if not (info.typ == "InternalCooldowns") then |
hideBar(info) |
if info then |
if not (info.typ == "InternalCooldowns") then |
hideBar(info) |
end |
end |
elseif event == "SPELL_AURA_APPLIED_DOSE" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then |
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid), dname) |
if not info then return end |
dur, appl, color, colorzero = self:GetSpellInfo("Shortbuffs", spellid) |
if not color then |
color, colorzero = schoolColor(spellschool) |
if info then |
dur, appl, color, colorzero = self:GetSpellInfo("Shortbuffs", spellid) |
if not color then |
color, colorzero = schoolColor(spellschool) |
end |
color.a = (application / appl) * (color.a or 1) |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
setBarDur(deepCopy(info), self:GetSpellInfo("Shortbuffs", spellid)) |
setBarColor(info, color, colorzero) |
end |
color.a = (application / appl) * (color.a or 1) |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
setBarDur(deepCopy(info), self:GetSpellInfo("Shortbuffs", spellid)) |
setBarColor(info, color, colorzero) |
elseif event == "SPELL_AURA_REFRESH" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then |
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid), dname) |
if not info then return end |
dur, appl, color, colorzero = self:GetSpellInfo("Shortbuffs", spellid) |
setBarDur(deepCopy(info), dur) |
if info then |
dur, appl, color, colorzero = self:GetSpellInfo("Shortbuffs", spellid) |
setBarDur(deepCopy(info), dur) |
end |
end |
elseif auraType == "DEBUFF" then |
-- debuffs |
if CompactBars:GetSpellInfo("SharedDebuffs", spellid) or (sguid == UnitGUID("player")) then |
if (self.db.profile.owndots and dguid == UnitGUID("target")) or (not self.db.profile.owndots) then |
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname) |
if not info then return end |
expT[spellid..dguid] = select(7, debuffCheck(spellname, spellid)) |
dur, appl, color, colorzero = self:GetSpellInfo(info.typ, spellid) |
if not color then |
color, colorzero = schoolColor(spellschool) |
if info then |
expT[spellid..dguid] = select(7, debuffCheck(spellname, spellid)) |
dur, appl, color, colorzero = self:GetSpellInfo(info.typ, spellid) |
if not color then |
color, colorzero = schoolColor(spellschool) |
end |
if appl then |
color.a = (1/appl) * (color.a or 1) |
end |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
local bar = sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
CompactBars:updateBarPos() |
--if not self.db.profile.owndots then |
-- if not self.db.profile.ehidetext then |
--sb:SetFixedText(dname, getBarPos(info.dguid, info.typ)) |
-- end |
--end |
if CompactBars.db.profile.spells[info.spellid..info.typ].eticks then |
if CompactBars.db.profile.spells[info.spellid..info.typ].ticktimer and type(CompactBars.db.profile.spells[info.spellid..info.typ].ticktimer) == "number" then |
CompactBars.sb:createTicker(bar, CompactBars.db.profile.spells[info.spellid..info.typ].ticktimer) |
else |
CompactBars.db.profile.spells[info.spellid..info.typ].ticktimer = tostring(timestamp) |
end |
end |
CompactBars.colorcache[spellid] = deepCopy(color) |
end |
end |
if appl then |
color.a = (1/appl) * (color.a or 1) |
end |
if not colorzero then colorzero = deepCopy(color); colorzero.a = 0.1 end |
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then |
sb:CreateBar(deepCopy(info), dur, 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture) |
CompactBars:updateBarPos() |
--if not self.db.profile.owndots then |
-- if not self.db.profile.ehidetext then |
--sb:SetFixedText(dname, getBarPos(info.dguid, info.typ)) |
-- end |
--end |
CompactBars.colorcache[spellid] = deepCopy(color) |
end |
end |
end |
-- this event does not provide sguid! returns 0 |
-- |
------------------------------------------ |
local expirationTime = select(7, debuffCheck(spellname, spellid)) |
if not expirationTime then return end |
if not expT[spellid..dguid] then return end |
if expT[spellid..dguid] == expirationTime then return end |
expT[spellid..dguid] = expirationTime |
------------------------------------------ |
-- |
-- temorary fix end! |
-- |
------------------------------------------ |
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname) |
if not info then return end |
setBarDur(deepCopy(info), self:GetSpellInfo(info.typ, spellid)) |
if expirationTime then |
if expT[spellid..dguid] then |
if not (expT[spellid..dguid] == expirationTime) then |
expT[spellid..dguid] = expirationTime |
------------------------------------------ |
-- |
-- temorary fix end! |
-- |
------------------------------------------ |
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname) |
if info then |
setBarDur(deepCopy(info), self:GetSpellInfo(info.typ, spellid)) |
end |
end |
end |
end |
-- this event does not provide sguid! returns 0 |
elseif event == "SPELL_AURA_APPLIED_DOSE" and dguid == UnitGUID("target") then |
------------------------------------------ |
-- |
------------------------------------------ |
local expirationTime = select(7, debuffCheck(spellname, spellid)) |
if not expirationTime then return end |
if not expT[spellid..dguid] then return end |
if expT[spellid..dguid] == expirationTime then return end |
expT[spellid..dguid] = expirationTime |
------------------------------------------ |
-- |
-- temorary fix end! |
-- |
------------------------------------------ |
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname) |
if not info then return end |
dur, appl, color, colorzero = self:GetSpellInfo(info.typ, spellid) |
if not color then |
color, colorzero = schoolColor(spellschool) |
if expirationTime then |
if expT[spellid..dguid] then |
if not (expT[spellid..dguid] == expirationTime) then |
expT[spellid..dguid] = expirationTime |
------------------------------------------ |
-- |
-- temorary fix end! |
-- |
------------------------------------------ |
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname) |
if info then |
dur, appl, color, colorzero = self:GetSpellInfo(info.typ, spellid) |
if not color then |
color, colorzero = schoolColor(spellschool) |
end |
if appl then |
color.a = (application/appl) * (color.a or 1) |
end |
setBarDur(deepCopy(info), self:GetSpellInfo(info.typ, spellid)) |
setBarColor(info, color, colorzero) |
end |
end |
end |
end |
if appl then |
color.a = (application/appl) * (color.a or 1) |
end |
setBarDur(deepCopy(info), self:GetSpellInfo(info.typ, spellid)) |
setBarColor(info, color, colorzero) |
elseif event == "SPELL_AURA_REMOVED" and (sguid == UnitGUID("player") or CompactBars:getTyp(spellid) == "SharedDebuffs") then |
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname) |
if not info then return end |
expT[spellid..dguid] = nil |
hideBar(info) |
if info then |
expT[spellid..dguid] = nil |
hideBar(info) |
end |
end |
elseif event == "SPELL_PERIODIC_DAMAGE" and (sguid == UnitGUID("player")) then |
if type(CompactBars.db.profile.spells[spellid.."Dots"].ticktimer) == "string" then |
CompactBars.db.profile.spells[spellid.."Dots"].ticktimer = tostring(timestamp - tonumber(CompactBars.db.profile.spells[spellid.."Dots"].ticktimer)) |
local bcomma, acomma = string.match(tostring(CompactBars.db.profile.spells[spellid.."Dots"].ticktimer), "(%d)\.(%d)") |
if acomma then |
if tonumber(acomma) <= 4 then |
CompactBars.db.profile.spells[spellid.."Dots"].ticktimer = tonumber(bcomma) |
else |
CompactBars.db.profile.spells[spellid.."Dots"].ticktimer = tonumber(bcomma) + 1 |
end |
end |
else |
-- reset the timer to the maximum |
local bars = CompactBars.sb:GetBars() |
if bars and #bars ~= 0 then |
for _, bar in pairs(bars) do |
if bar and bar.data and bar.data.dguid == dguid and bar.data.spellid == spellid then |
if bar.ticker then |
bar.ticker.time = bar.ticker.maxtime |
break |
end |
end |
end |
end |
end |
end |
if info then |
deepDel(info) |
local L = LibStub("AceLocale-3.0"):NewLocale("CompactBars", "enUS", true) |
if L then |
L["Enable Ticks"] = "Enable ticks" |
L["Tick time"] = "Tick time" |
L["Duration"] = "Duration" |
L["This should return the time. For example if you want that this spell is 10 seconds then type: return 10 (you can use any lua code here)"] = "This should return the time. For example if you want that this spell is 10 seconds then type: return 10 (you can use any lua code here)" |
L["Applications"] = "Stacks" |
local L = LibStub("AceLocale-3.0"):NewLocale("CompactBars", "deDE") |
if L then |
L["Enable Ticks"] = "Ticks aktivieren" |
L["Tick time"] = "Dauer zwischen ticks" |
L["Duration"] = "Dauer" |
L["This should return the time. For example if you want that this spell is 10 seconds then type: return 10 (you can use any lua code here)"] = "Hier soll die Zeit zurück gegeben werden. Falls z.B. 10 Sekunden zurück gegeben werden soll muss hier return 10 eingegeben werden." |
L["Applications"] = "Aufladungen" |