WoWInterface SVN CompactBars

Compare Revisions

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

Rev 11 → Rev 10

CompactBars/core.lua
28,26 → 28,7
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
67,10 → 48,7
 
bars = sb:GetBars()
if not bars or #bars == 0 then return end
for k,v in pairs(bars) do
v.order = nil
if v.pos then sb:SetFixedText(nil, v.pos) end
end
for k,v in pairs(bars) do v.order = nil end
local curpos = 0
local firstdebuff, firstshortbuff, firstcooldown, firstbossmod = true, true, true, true
for i = 1, 4 do
78,9 → 56,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
88,16 → 66,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 and bar.data.dguid == b.data.dguid and (bar.data.typ == "Debuffs" or bar.data.typ == "CCs" or bar.data.typ == "Dots") then
if b.order and not bar.order and b.data.dguid == bar.data.dguid 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
111,7 → 89,7
firstshortbuff = nil
else
for _, b in pairs(bars) do
if b.order and not bar.order and b.data and b.data.typ == bar.data.typ then
if b.order and not bar.order and b.data.typ == bar.data.typ then
bar.pos = b.pos
bar.order = true
break
126,14 → 104,13
firstbossmod = nil
else
for _, b in pairs(bars) do
if b.order and not bar.order and b.data and b.data.typ == bar.data.typ then
if b.order and not bar.order 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
142,7 → 119,7
firstcooldown = nil
else
for _, b in pairs(bars) do
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
if b.order and not bar.order and b.data.typ == bar.data.typ then
bar.pos = b.pos
bar.order = true
break
152,7 → 129,6
end
end
end
iterateFixedText()
end
local function getBarPos(uid, typ)
local positions = {strsplit(",", CompactBars.db.profile.barorder)}
166,7 → 142,7
if CompactBars.db.profile.eshortbuffs then
if pos["Shortbuffs"] < debuffpos then
if typ == "Shortbuffs" then
return 0--init
return init
end
init = init + 1
else
178,7 → 154,7
if CompactBars.db.profile.ecooldowns then
if pos["Cooldowns"] < debuffpos then
if typ == "Cooldowns" then
return 0--init
return init
end
else
if typ == "Cooldowns" then
189,7 → 165,7
if CompactBars.db.profile.einternalcooldowns then
if pos["Cooldowns"] < debuffpos then
if typ == "InternalCooldowns" then
return 0--init
return init
end
else
if typ == "InternalCooldowns" then
206,7 → 182,7
if CompactBars.db.profile.ebossmods then
if pos["Bossmods"] < debuffpos then
if typ == "Bossmods" then
return 0--init
return init
end
init = init + 1
else
224,7 → 200,7
for _, bar in pairs(bars) do
if bar.data then
if bar.data.dguid == uid and bar.data.typ == typ then
return 0--bar.pos
return bar.pos
end
end
end
232,7 → 208,7
for _, bar in pairs(bars) do
if bar.data then
if bar.data.dguid == uid then
return 0--bar.pos
return bar.pos
end
end
end
240,7 → 216,7
if findflag then
return findFirstEmptyBar(init)
end
return 0--findFirstEmptyBar(debuffpos)
return findFirstEmptyBar(debuffpos)
end
function CompactBars:GetBarPos(uid, typ)
return getBarPos(uid, typ)
337,7 → 313,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"
345,13 → 321,12
return "SharedDebuffs"
else return false end
end
local function createSpellInfo(dguid, spellid, typ, name)
local function createSpellInfo(dguid, spellid, typ)
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
 
437,7 → 412,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), UnitName("target"))
local info = createSpellInfo(UnitGUID("target"), spellid, CompactBars:getTyp(spellid))
if info and (info.typ == "SharedDebuffs" or ismine) then
if info then
spellid = tonumber(spellid)
493,34 → 468,27
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), dname)
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid))
if not info then return end
 
dur, appl, color, colorzero = CompactBars:GetSpellInfo("Shortbuffs", spellid)
 
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
if not dur then return end
if not tonumber(dur) then return end
if not color then
color, colorzero = schoolColor(spellschool)
end
if info then
deepDel(info)
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
deepDel(info)
info = nil
-- internal cooldowns
info = createSpellInfo(UnitGUID("player"), spellid, "InternalCooldowns", dname)
info = createSpellInfo(UnitGUID("player"), spellid, "InternalCooldowns")
dur, appl, color, colorzero = CompactBars:GetSpellInfo("InternalCooldowns", spellid)
if not dur then return end
if not tonumber(dur) then return end
537,13 → 505,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), dname)
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid))
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), dname)
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid))
if not info then return end
dur, appl, color, colorzero = self:GetSpellInfo("Shortbuffs", spellid)
if not color then
554,7 → 522,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), dname)
info = createSpellInfo(UnitGUID("player"), spellid, self:getTyp(spellid))
if not info then return end
dur, appl, color, colorzero = self:GetSpellInfo("Shortbuffs", spellid)
setBarDur(deepCopy(info), dur)
564,7 → 532,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), dname)
info = createSpellInfo(dguid, spellid, self:getTyp(spellid))
if not info then return end
expT[spellid..dguid] = select(7, debuffCheck(spellname, spellid))
dur, appl, color, colorzero = self:GetSpellInfo(info.typ, spellid)
580,11 → 548,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
606,7 → 574,7
-- temorary fix end!
--
------------------------------------------
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname)
info = createSpellInfo(dguid, spellid, self:getTyp(spellid))
if not info then return end
setBarDur(deepCopy(info), self:GetSpellInfo(info.typ, spellid))
-- this event does not provide sguid! returns 0
626,7 → 594,7
-- temorary fix end!
--
------------------------------------------
info = createSpellInfo(dguid, spellid, self:getTyp(spellid), dname)
info = createSpellInfo(dguid, spellid, self:getTyp(spellid))
if not info then return end
dur, appl, color, colorzero = self:GetSpellInfo(info.typ, spellid)
if not color then
638,7 → 606,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), dname)
info = createSpellInfo(dguid, spellid, self:getTyp(spellid))
if not info then return end
expT[spellid..dguid] = nil
hideBar(info)
CompactBars/localization/deDE.lua
118,7 → 118,6
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,7 → 92,6
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