mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
auras
This commit is contained in:
@@ -81,7 +81,7 @@ local HIDDEN = 0
|
||||
|
||||
local function UpdateTooltip(self)
|
||||
if self:GetParent().__owner.unit == "player" then
|
||||
GameTooltip:SetPlayerBuff(self:GetID())
|
||||
GameTooltip:SetPlayerBuff(self:GetID() - 1)
|
||||
elseif self.filter == 'HELPFUL' then
|
||||
GameTooltip:SetUnitBuff(self:GetParent().__owner.unit, self:GetID(), self.filter)
|
||||
else
|
||||
@@ -143,16 +143,18 @@ local function customFilter(element, unit, button, texture)
|
||||
end
|
||||
|
||||
local function updateIcon(element, unit, index, offset, filter, isDebuff, visible)
|
||||
local texture, count, dispelType, duration, expiration = UnitAura(unit, index, filter)
|
||||
local texture, count, dispelType, duration, expiration
|
||||
|
||||
if unit == "player" then
|
||||
local idx = GetPlayerBuff(index - 1, filter)
|
||||
if idx < 0 then return end
|
||||
index = idx
|
||||
--if idx < 0 then return end
|
||||
--index = idx
|
||||
texture = GetPlayerBuffTexture(idx)
|
||||
count = GetPlayerBuffApplications(idx)
|
||||
dispelType = GetPlayerBuffDispelType(idx)
|
||||
duration = GetPlayerBuffTimeLeft(idx)
|
||||
else
|
||||
texture, count, dispelType, duration, expiration = UnitAura(unit, index, filter)
|
||||
end
|
||||
|
||||
if element.forceShow then
|
||||
@@ -160,8 +162,7 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl
|
||||
count, dispelType, duration, expiration = 5, 'Magic', 0, 60
|
||||
end
|
||||
|
||||
if not texture then return end
|
||||
|
||||
if texture then
|
||||
local position = visible + offset + 1
|
||||
local button = element[position]
|
||||
if not button then
|
||||
@@ -201,8 +202,7 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl
|
||||
show = (element.CustomFilter or customFilter) (element, unit, button, texture, count, dispelType, duration, expiration)
|
||||
end
|
||||
|
||||
if not show then return HIDDEN end
|
||||
|
||||
if show then
|
||||
-- We might want to consider delaying the creation of an actual cooldown
|
||||
-- object to this point, but I think that will just make things needlessly
|
||||
-- complicated.
|
||||
@@ -251,6 +251,10 @@ local function updateIcon(element, unit, index, offset, filter, isDebuff, visibl
|
||||
end
|
||||
|
||||
return VISIBLE
|
||||
else
|
||||
return HIDDEN
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function SetPosition(element, from, to)
|
||||
@@ -302,6 +306,8 @@ local function filterIcons(element, unit, filter, limit, isDebuff, offset, dontH
|
||||
end
|
||||
|
||||
local function UpdateAuras(self, event, unit)
|
||||
if event == "PLAYER_AURAS_CHANGED" then unit = "player" end
|
||||
|
||||
if self.unit ~= unit then return end
|
||||
|
||||
local auras = self.Auras
|
||||
|
||||
@@ -22,7 +22,7 @@ local UnitIsUnit = UnitIsUnit
|
||||
function UF:Construct_Buffs(frame)
|
||||
local buffs = CreateFrame("Frame", frame:GetName().."Buffs", frame)
|
||||
buffs.spacing = E.Spacing
|
||||
--buffs.PreSetPosition = (not frame:GetScript("OnUpdate")) and self.SortAuras or nil
|
||||
buffs.PreSetPosition = (not frame:GetScript("OnUpdate")) and self.SortAuras or nil
|
||||
buffs.PostCreateIcon = self.Construct_AuraIcon
|
||||
buffs.PostUpdateIcon = self.PostUpdateAura
|
||||
--buffs.CustomFilter = self.AuraFilter
|
||||
@@ -37,7 +37,7 @@ end
|
||||
function UF:Construct_Debuffs(frame)
|
||||
local debuffs = CreateFrame("Frame", frame:GetName().."Debuffs", frame)
|
||||
debuffs.spacing = E.Spacing
|
||||
--debuffs.PreSetPosition = (not frame:GetScript("OnUpdate")) and self.SortAuras or nil
|
||||
debuffs.PreSetPosition = (not frame:GetScript("OnUpdate")) and self.SortAuras or nil
|
||||
debuffs.PostCreateIcon = self.Construct_AuraIcon
|
||||
debuffs.PostUpdateIcon = self.PostUpdateAura
|
||||
--debuffs.CustomFilter = self.AuraFilter
|
||||
@@ -298,7 +298,7 @@ local function SortAurasByCaster(a, b)
|
||||
end
|
||||
|
||||
function UF:SortAuras()
|
||||
if not self.db then return end
|
||||
--[[if not self.db then return end
|
||||
|
||||
--Sorting by Index is Default
|
||||
if self.db.sortMethod == "TIME_REMAINING" then
|
||||
@@ -309,7 +309,7 @@ function UF:SortAuras()
|
||||
tsort(self, SortAurasByDuration)
|
||||
elseif self.db.sortMethod == "PLAYER" then
|
||||
tsort(self, SortAurasByCaster)
|
||||
end
|
||||
end]]
|
||||
|
||||
--Look into possibly applying filter priorities for auras here.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user