From 3578bd7521b56b98f30a8b30ecba2b6615f3a555 Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Sat, 2 Jun 2018 09:42:43 +0300 Subject: [PATCH] auras --- !Compatibility/api/wowAPI.lua | 12 ++++---- ElvUI/Libraries/oUF/elements/auras.lua | 8 ++--- ElvUI/Modules/UnitFrames/Elements/Auras.lua | 34 ++++++++++----------- ElvUI/Modules/UnitFrames/Units/Player.lua | 1 - ElvUI/Modules/UnitFrames/Units/Target.lua | 1 - 5 files changed, 27 insertions(+), 29 deletions(-) diff --git a/!Compatibility/api/wowAPI.lua b/!Compatibility/api/wowAPI.lua index f4de94c..2a853cf 100644 --- a/!Compatibility/api/wowAPI.lua +++ b/!Compatibility/api/wowAPI.lua @@ -14,8 +14,8 @@ local GetItemInfo = GetItemInfo local GetQuestGreenRange = GetQuestGreenRange local GetRealZoneText = GetRealZoneText local IsInInstance = IsInInstance -local UnitBuff = UnitBuff -local UnitDebuff = UnitDebuff +--local UnitBuff = UnitBuff +--local UnitDebuff = UnitDebuff local UnitLevel = UnitLevel --WoW Variables local DUNGEON_DIFFICULTY1 = DUNGEON_DIFFICULTY1 @@ -145,11 +145,11 @@ function UnitAura(unit, i, filter) end if not filter or match(filter, "(HELPFUL)") then - local name, rank, aura, count, duration, maxDuration = UnitBuff(unit, i, filter) - return name, rank, aura, count, nil, duration or 0, maxDuration or 0 + local texture, count = UnitBuff(unit, i, filter) + return texture, count else - local name, rank, aura, count, dType, duration, maxDuration = UnitDebuff(unit, i, filter) - return name, rank, aura, count, dType, duration or 0, maxDuration or 0 + local texture, count, dType = UnitDebuff(unit, i, filter) + return texture, count, dType end end diff --git a/ElvUI/Libraries/oUF/elements/auras.lua b/ElvUI/Libraries/oUF/elements/auras.lua index f4d5751..14f4855 100644 --- a/ElvUI/Libraries/oUF/elements/auras.lua +++ b/ElvUI/Libraries/oUF/elements/auras.lua @@ -138,8 +138,8 @@ local function createAuraIcon(element, index) return button end -local function customFilter(element, unit, button, name) - if name then return true end +local function customFilter(element, unit, button, texture) + if texture then return true end end local function updateIcon(element, unit, index, offset, filter, isDebuff, visible) @@ -156,7 +156,7 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl end if element.forceShow then - name, rank, texture = GetSpellInfo(26993) + texture = "Interface\\Icons\\Spell_Holy_DivineSpirit" count, dispelType, duration, expiration = 5, 'Magic', 0, 60 end @@ -198,7 +198,7 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl --]] local show = true if not element.forceShow then - -- show = (element.CustomFilter or customFilter) (element, unit, button, name, rank, texture, count, dispelType, duration, expiration) + show = (element.CustomFilter or customFilter) (element, unit, button, texture, count, dispelType, duration, expiration) end if not show then return HIDDEN end diff --git a/ElvUI/Modules/UnitFrames/Elements/Auras.lua b/ElvUI/Modules/UnitFrames/Elements/Auras.lua index 40589f6..6d10d79 100644 --- a/ElvUI/Modules/UnitFrames/Elements/Auras.lua +++ b/ElvUI/Modules/UnitFrames/Elements/Auras.lua @@ -445,7 +445,7 @@ function UF:UpdateAuraTimer(elapsed) end end -function UF:AuraFilter(unit, button, name, _, _, _, dispelType, duration, expiration, caster, isStealable, _, spellID) +function UF:AuraFilter(unit, button, texture, count, dispelType, duration, expiration) local db = self:GetParent().db if not db or not db[self.type] then return true end @@ -491,10 +491,10 @@ function UF:UpdateBuffsHeaderPosition() if numDebuffs == 0 then buffs:ClearAllPoints() - buffs:Point(debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) + E:Point(buffs, debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) else buffs:ClearAllPoints() - buffs:Point(buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) + E:Point(buffs, buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) end end @@ -506,10 +506,10 @@ function UF:UpdateDebuffsHeaderPosition() if numBuffs == 0 then debuffs:ClearAllPoints() - debuffs:Point(buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) + E:Point(debuff, sbuffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) else debuffs:ClearAllPoints() - debuffs:Point(debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) + E:Point(debuff, sdebuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) end end @@ -522,17 +522,17 @@ function UF:UpdateBuffsPositionAndDebuffHeight() if numDebuffs == 0 then buffs:ClearAllPoints() - buffs:Point(debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) + E:Point(buffs, debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) else buffs:ClearAllPoints() - buffs:Point(buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) + E:Point(buffs, buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) end if numDebuffs > 0 then local numRows = ceil(numDebuffs/db.debuffs.perrow) - debuffs:Height(debuffs.size * (numRows > db.debuffs.numrows and db.debuffs.numrows or numRows)) + E:Height(debuffs, debuffs.size * (numRows > db.debuffs.numrows and db.debuffs.numrows or numRows)) else - debuffs:Height(debuffs.size) + E:Height(debuffs, debuffs.size) end end @@ -545,17 +545,17 @@ function UF:UpdateDebuffsPositionAndBuffHeight() if numBuffs == 0 then debuffs:ClearAllPoints() - debuffs:Point(buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) + E:Point(debuffs, buffs.point, buffs.attachTo, buffs.anchorPoint, buffs.xOffset, buffs.yOffset) else debuffs:ClearAllPoints() - debuffs:Point(debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) + E:Point(debuffs, debuffs.point, debuffs.attachTo, debuffs.anchorPoint, debuffs.xOffset, debuffs.yOffset) end if numBuffs > 0 then local numRows = ceil(numBuffs/db.buffs.perrow) - buffs:Height(buffs.size * (numRows > db.buffs.numrows and db.buffs.numrows or numRows)) + E:Height(buffs, buffs.size * (numRows > db.buffs.numrows and db.buffs.numrows or numRows)) else - buffs:Height(buffs.size) + E:Height(buffs, buffs.size) end end @@ -567,9 +567,9 @@ function UF:UpdateBuffsHeight() if numBuffs > 0 then local numRows = ceil(numBuffs/db.buffs.perrow) - buffs:Height(buffs.size * (numRows > db.buffs.numrows and db.buffs.numrows or numRows)) + E:Height(buffs, buffs.size * (numRows > db.buffs.numrows and db.buffs.numrows or numRows)) else - buffs:Height(buffs.size) + E:Height(buffs, buffs.size) -- Any way to get rid of the last row as well? -- Using buffs:SetHeight(0) makes frames anchored to this one disappear end @@ -583,9 +583,9 @@ function UF:UpdateDebuffsHeight() if numDebuffs > 0 then local numRows = ceil(numDebuffs/db.debuffs.perrow) - debuffs:Height(debuffs.size * (numRows > db.debuffs.numrows and db.debuffs.numrows or numRows)) + E:Height(debuffs, debuffs.size * (numRows > db.debuffs.numrows and db.debuffs.numrows or numRows)) else - debuffs:Height(debuffs.size) + E:Height(debuffs, debuffs.size) -- Any way to get rid of the last row as well? -- Using debuffs:SetHeight(0) makes frames anchored to this one disappear end diff --git a/ElvUI/Modules/UnitFrames/Units/Player.lua b/ElvUI/Modules/UnitFrames/Units/Player.lua index 651f42e..76f2bfb 100644 --- a/ElvUI/Modules/UnitFrames/Units/Player.lua +++ b/ElvUI/Modules/UnitFrames/Units/Player.lua @@ -28,7 +28,6 @@ function UF:Construct_PlayerFrame(frame) frame.RaidTargetIndicator = UF:Construct_RaidIcon(frame) frame.RestingIndicator = self:Construct_RestingIndicator(frame) frame.CombatIndicator = self:Construct_CombatIndicator(frame) - frame.AuraBars = self:Construct_AuraBarHeader(frame) frame.InfoPanel = self:Construct_InfoPanel(frame) frame:SetPoint("BOTTOMLEFT", E.UIParent, "BOTTOM", -413, 68) diff --git a/ElvUI/Modules/UnitFrames/Units/Target.lua b/ElvUI/Modules/UnitFrames/Units/Target.lua index bd6f769..75210df 100644 --- a/ElvUI/Modules/UnitFrames/Units/Target.lua +++ b/ElvUI/Modules/UnitFrames/Units/Target.lua @@ -25,7 +25,6 @@ function UF:Construct_TargetFrame(frame) frame.RaidTargetIndicator = UF:Construct_RaidIcon(frame) frame.GPS = self:Construct_GPS(frame) frame.InfoPanel = self:Construct_InfoPanel(frame) - frame.AuraBars = self:Construct_AuraBarHeader(frame) E:Point(frame, "BOTTOMRIGHT", E.UIParent, "BOTTOM", 413, 68) E:CreateMover(frame, frame:GetName().."Mover", L["Target Frame"], nil, nil, nil, "ALL,SOLO")