WoWInterface SVN CompactBars

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 10 to Rev 11
    Reverse comparison

Rev 10 → Rev 11

CompactBars/core.lua
28,7 → 28,26
end
end
end
 
local function iterateFixedText()
local bars = sb:GetBars()
if not bars or #bars == 0 then return end
 
for i = 1, 10 do
-- find a bar for that position
for _, bar in pairs(bars) do
if bar.pos and bar.pos == i then
if bar.data and bar.data.typ and (bar.data.typ == "Dots" or bar.data.typ == "CCs" or bar.data.typ == "Debuffs") then
if not CompactBars.db.profile.owndots then
if not CompactBars.db.profile.ehidetext then
sb:SetFixedText(bar.data.name, i)
break
end
end
end
end
end
end
end
local function findFirstEmptyBar(init)
local bars = sb:GetBars()
if not bars then return init end
48,7 → 67,10
 
bars = sb:GetBars()
if not bars or #bars == 0 then return end
for k,v in pairs(bars) do v.order = nil end
for k,v in pairs(bars) do
v.order = nil
if v.pos then sb:SetFixedText(nil, v.pos) end
end
local curpos = 0
local firstdebuff, firstshortbuff, firstcooldown, firstbossmod = true, true, true, true
for i = 1, 4 do
56,9 → 78,9
if positions[i] == "Debuffs" and bar.data and (bar.data.typ == "Debuffs" or bar.data.typ == "CCs" or bar.data.typ == "Dots") then
local ftext
if firstdebuff then
ftext = sb:GetFixedText(bar.pos)
sb:SetFixedText(nil, bar.pos)
sb:SetFixedText(ftext, curpos)
--ftext = sb:GetFixedText(bar.pos)
--sb:SetFixedText(nil, bar.pos)
--sb:SetFixedText(ftext, curpos)
bar.pos = curpos
bar.order = true
curpos = curpos + 1
66,16 → 88,16
else
-- try to find a bar that fits
for _, b in pairs(bars) do
if b.order and not bar.order and b.data.dguid == bar.data.dguid then
if b.order and not bar.order and b.data and bar.data.dguid == b.data.dguid and (bar.data.typ == "Debuffs" or bar.data.typ == "CCs" or bar.data.typ == "Dots") then
bar.pos = b.pos
bar.order = true
break
end
end
if not bar.order then
ftext = sb:GetFixedText(bar.pos)
sb:SetFixedText(nil, bar.pos)
sb:SetFixedText(ftext, curpos)
--ftext = sb:GetFixedText(bar.pos)
--sb:SetFixedText(nil, bar.pos)
--sb:SetFixedText(ftext, curpos)
bar.pos = curpos
bar.order = true
curpos = curpos + 1
89,7 → 111,7
firstshortbuff = nil
else
for _, b in pairs(bars) do
if b.order and not bar.order and b.data.typ == bar.data.typ then
if b.order and not bar.order and b.data and b.data.typ == bar.data.typ then
bar.pos = b.pos
bar.order = true
break
104,13 → 126,14
firstbossmod = nil
else
for _, b in pairs(bars) do
if b.order and not bar.order and b.data.typ == bar.data.typ then
if b.order and not bar.order and b.data and b.data.typ == bar.data.typ then
bar.pos = b.pos
bar.order = true
break
end
end
end
 
elseif positions[i] == "Cooldowns" and bar.data and (bar.data.typ == "Cooldowns" or bar.data.typ == "ItemCooldowns" or bar.data.typ == "InternalCooldowns") then
if firstcooldown then
bar.pos = curpos
119,7 → 142,7
firstcooldown = nil
else
for _, b in pairs(bars) do
if b.order and not bar.order and b.data.typ == bar.data.typ then
if b.order and not bar.order and b.data and (b.data.typ == "Cooldowns" or b.data.typ == "ItemCooldowns" or b.data.typ == "InternalCooldowns") then
bar.pos = b.pos
bar.order = true
break
129,6 → 152,7
end
end
end
iterateFixedText()
end
local function getBarPos(uid, typ)
local positions = {strsplit(",", CompactBars.db.profile.barorder)}
142,7 → 166,7
if CompactBars.db.profile.eshortbuffs then
if pos["Shortbuffs"] < debuffpos then
if typ == "Shortbuffs" then
return init
return 0--init
end
init = init + 1
else
154,7 → 178,7
if CompactBars.db.profile.ecooldowns then
if pos["Cooldowns"] < debuffpos then
if typ == "Cooldowns" then
return init
return 0--init
end
else
if typ == "Cooldowns" then
165,7 → 189,7
if CompactBars.db.profile.einternalcooldowns then
if pos["Cooldowns"] < debuffpos then
if typ == "InternalCooldowns" then
return init
return 0--init
end
else
if typ == "InternalCooldowns" then
182,7 → 206,7
if CompactBars.db.profile.ebossmods then
if pos["Bossmods"] < debuffpos then
if typ == "Bossmods" then
return init
return 0--init
end
init = init + 1
else
200,7 → 224,7
for _, bar in pairs(bars) do
if bar.data then
if bar.data.dguid == uid and bar.data.typ == typ then
return bar.pos
return 0--bar.pos
end
end
end
208,7 → 232,7
for _, bar in pairs(bars) do
if bar.data then
if bar.data.dguid == uid then
return bar.pos
return 0--bar.pos
end
end
end
216,7 → 240,7
if findflag then
return findFirstEmptyBar(init)
end
return findFirstEmptyBar(debuffpos)
return 0--findFirstEmptyBar(debuffpos)
end
function CompactBars:GetBarPos(uid, typ)
return getBarPos(uid, typ)
313,7 → 337,7
return "Debuffs"
elseif CompactBars:GetSpellInfo("CCs", spellid) then
return "CCs"
elseif CompactBars:GetSpellInfo("Shortbuffs", spellid) then
elseif CompactBars:GetSpellInfo("Shortbuffs",spellid) then
return "Shortbuffs"
elseif CompactBars:GetSpellInfo("InternalCooldowns", spellid) then
return "InternalCooldowns"
321,12 → 345,13
return "SharedDebuffs"
else return false end
end
local function createSpellInfo(dguid, spellid, typ)
local function createSpellInfo(dguid, spellid, typ, name)
if not typ then return false end
local infos = newList()
infos.dguid = dguid
infos.spellid = spellid
infos.typ = typ
infos.name = name
return infos
end
 
412,7 → 437,7
local link = GetSpellLink(name, rank)
if link then
local spellid = string.match(link, "Hspell:(%d+)")
local info = createSpellInfo(UnitGUID("target"), spellid, CompactBars:getTyp(spellid))
local info = createSpellInfo(UnitGUID("target"), spellid, CompactBars:getTyp(spellid), UnitName("target"))
if info and (info.typ == "SharedDebuffs" or ismine) then
if info then
spellid = tonumber(spellid)
468,27 → 493,34
local info, dur, appl, color, colorzero
if auraType == "BUFF" then
if event == "SPELL_AURA_APPLIED" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid))
 
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid), dname)
if not info then return end
 
dur, appl, color, colorzero = CompactBars:GetSpellInfo("Shortbuffs", 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), tonumber(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)
if info then
deepDel(info)
end
 
if not isBarActive(info) and getBarPos(info.dguid, info.typ) then
sb:CreateBar(deepCopy(info), tonumber(dur), 0, nil, select(3, GetSpellInfo(spellid)), getBarPos(info.dguid, info.typ), color, colorzero, self.db.profile.bartexture)
CompactBars:updateBarPos()
end
deepDel(info)
info = nil
-- internal cooldowns
info = createSpellInfo(UnitGUID("player"), spellid, "InternalCooldowns")
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
505,13 → 537,13
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))
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid), dname)
if not info then return end
if not (info.typ == "InternalCooldowns") then
hideBar(info)
end
elseif event == "SPELL_AURA_APPLIED_DOSE" and (dguid == UnitGUID("player") or dguid == UnitGUID("pet")) then
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid))
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
522,7 → 554,7
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))
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)
532,7 → 564,7
if event == "SPELL_AURA_APPLIED" then
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))
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)
548,11 → 580,11
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
--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
574,7 → 606,7
-- temorary fix end!
--
------------------------------------------
info = createSpellInfo(dguid, spellid, self:getTyp(spellid))
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname)
if not info then return end
setBarDur(deepCopy(info), self:GetSpellInfo(info.typ, spellid))
-- this event does not provide sguid! returns 0
594,7 → 626,7
-- temorary fix end!
--
------------------------------------------
info = createSpellInfo(dguid, spellid, self:getTyp(spellid))
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
606,7 → 638,7
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))
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname)
if not info then return end
expT[spellid..dguid] = nil
hideBar(info)
CompactBars/localization/deDE.lua
118,6 → 118,7
L["Warlock"] = "Hexenmeister"
L["Warrior"] = "Krieger"
L["General"] = "Allgemein"
L["General"] = "Allgemein"
L["Shared debuffs are things that can be refreshed from other people (eg Sunder Armor)"] = "Geteilte Debuffs sind debuffs die von anderen Personen erneuert werden können (z.B. Rüstung zerreißen)"
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)"] = "Sollte die Zeit zurück geben. Wenn man einen Zauber will, der 10 Sekunden lang ist, dann muss man hier return 10 eintippen"
L["The class which uses the spell"] = "Die Klasse welche den Zauber benutzt"
CompactBars/bossmods.lua
92,6 → 92,7
local function bwWipeBars()
local wpos = CompactBars:GetBarPos(0, "Bossmods")
local bars = CompactBars.sb:GetBars()
if not bars or #bars == 0 then return end
for _, bar in bars do
if bar and bar.pos and bar.pos == wpos then
bar.start = nil