diff --git a/modules/buff.lua b/modules/buff.lua index 10ee345b..b7b18774 100644 --- a/modules/buff.lua +++ b/modules/buff.lua @@ -23,7 +23,7 @@ pfUI:RegisterModule("buff", function () CreateBackdropShadow(buff) end - local aura = C_UnitAuras.GetAuraDataByIndex("player", buff.id, buff.btype) + local name, icon, count, dispelType, _, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAura("player", buff.id, buff.btype) --detect weapon buffs if buff.btype == "HELPFUL" and ((C.buffs.separateweapons == "0" and buff.gid <= pfUI.buff.wepbuffs.count) or (pfUI.buff.wepbuffs.count > 0 and buff.weapon ~= nil)) then @@ -55,16 +55,16 @@ pfUI:RegisterModule("buff", function () buff.texture:SetTexture(GetInventoryItemTexture("player", 17)) buff.backdrop:SetBackdropBorderColor(GetItemQualityColor(GetInventoryItemQuality("player", 17) or 1)) end - elseif aura and (( buff.btype == "HARMFUL" and C.buffs.debuffs == "1" ) or ( buff.btype == "HELPFUL" and C.buffs.buffs == "1" )) then + elseif name and (( buff.btype == "HARMFUL" and C.buffs.debuffs == "1" ) or ( buff.btype == "HELPFUL" and C.buffs.buffs == "1" )) then -- Set Buff Texture and Border buff.mode = buff.btype - buff.expirationTime = aura.expirationTime - buff.stackCount = aura.applications - buff.spellId = aura.spellId - buff.texture:SetTexture(aura.icon) + buff.expirationTime = expirationTime + buff.stackCount = count + buff.spellId = spellId + buff.texture:SetTexture(icon) if buff.btype == "HARMFUL" then - local dispelColor = C_UnitAuras.GetAuraDispelTypeColor(aura.dispelName) + local dispelColor = C_UnitAuras.GetAuraDispelTypeColor(dispelType) buff.backdrop:SetBackdropBorderColor(dispelColor:GetRGBA()) else buff.backdrop:SetBackdropBorderColor(br,bg,bb,ba) diff --git a/modules/buffwatch.lua b/modules/buffwatch.lua index 8d7b0d15..5e7e2498 100644 --- a/modules/buffwatch.lua +++ b/modules/buffwatch.lua @@ -75,10 +75,10 @@ pfUI:RegisterModule("buffwatch", function () local function GetBuffData(unit, id, type, selfdebuff) local filter = (selfdebuff and type == "HARMFUL") and "HARMFUL|PLAYER" or type - local aura = C_UnitAuras.GetAuraDataByIndex(unit, id, filter) - if not aura then return end - local remaining = aura.expirationTime > 0 and (aura.expirationTime - GetTime()) or 0 - return remaining, aura.icon, aura.name, aura.applications + local name, icon, count, dispelType, _, expirationTime = C_UnitAuras.UnitAura(unit, id, filter) + if not name then return end + local remaining = expirationTime > 0 and (expirationTime - GetTime()) or 0 + return remaining, icon, name, count, dispelType end local function StatusBarOnClick() @@ -236,7 +236,7 @@ pfUI:RegisterModule("buffwatch", function () local selfdebuff = frame.config.selfdebuff == "1" for i=1,32 do - local timeleft, texture, name, stacks = GetBuffData(frame.unit, i, frame.type, selfdebuff) + local timeleft, texture, name, stacks, dtype = GetBuffData(frame.unit, i, frame.type, selfdebuff) timeleft = timeleft or 0 if texture and name and name ~= "" and BuffIsVisible(frame.config, name) then @@ -245,12 +245,14 @@ pfUI:RegisterModule("buffwatch", function () frame.buffs[i][3] = name frame.buffs[i][4] = texture frame.buffs[i][5] = stacks + frame.buffs[i][6] = dtype else frame.buffs[i][1] = 0 frame.buffs[i][2] = nil frame.buffs[i][3] = nil frame.buffs[i][4] = nil frame.buffs[i][5] = 0 + frame.buffs[i][6] = nil end end @@ -295,8 +297,7 @@ pfUI:RegisterModule("buffwatch", function () local r, g, b if frame.type == "HARMFUL" then r, g, b = 1, .2, .2 - local a = C_UnitAuras.GetDebuffDataByIndex(frame.unit, data[2]) - local dtype = a and a.dispelName + local dtype = data[6] if dtype and DebuffTypeColor[dtype] then r,g,b = DebuffTypeColor[dtype].r,DebuffTypeColor[dtype].g,DebuffTypeColor[dtype].b end