Skip to content

Commit

Permalink
Added SpellID to Unitframe Buffs/Debuffs
Browse files Browse the repository at this point in the history
  • Loading branch information
muleyo committed Dec 21, 2024
1 parent f5602a8 commit 7b580b5
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions Modules/Tooltip/_Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ function Module:OnEnable()
}

if (db) then
GameTooltipStatusBar:SetStatusBarTexture("Interface\\Addons\\SUI\\Media\\Textures\\Tooltip\\UI-TargetingFrame-BarFill_test")
GameTooltipStatusBar:SetStatusBarTexture(
"Interface\\Addons\\SUI\\Media\\Textures\\Tooltip\\UI-TargetingFrame-BarFill_test")
end

local function GetHexColor(color)
Expand Down Expand Up @@ -244,18 +245,22 @@ function Module:OnEnable()

--hooksecurefunc GameTooltip SetUnitBuff
hooksecurefunc(GameTooltip, "SetUnitBuff", function(self, unitToken, index, filter)
TooltipAddSpellID(self, select(10, AuraUtil.UnpackAuraData(C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter))))
TooltipAddSpellID(self,
select(10, AuraUtil.UnpackAuraData(C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter))))
end)

--hooksecurefunc GameTooltip SetUnitDebuff
hooksecurefunc(GameTooltip, "SetUnitDebuff", function(self, unitToken, index, filter)
TooltipAddSpellID(self, select(10, AuraUtil.UnpackAuraData(C_UnitAuras.GetDebuffDataByIndex(unitToken, index, filter))))
TooltipAddSpellID(self,
select(10, AuraUtil.UnpackAuraData(C_UnitAuras.GetDebuffDataByIndex(unitToken, index, filter))))
end)

--hooksecurefunc GameTooltip SetUnitAura
hooksecurefunc(GameTooltip, "SetUnitAura", function(self, unitToken, index, filter)
TooltipAddSpellID(self, select(10, AuraUtil.UnpackAuraData(C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter))))
TooltipAddBuffSource(self, select(7, AuraUtil.UnpackAuraData(C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter))))
TooltipAddSpellID(self,
select(10, AuraUtil.UnpackAuraData(C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter))))
TooltipAddBuffSource(self,
select(7, AuraUtil.UnpackAuraData(C_UnitAuras.GetBuffDataByIndex(unitToken, index, filter))))
end)

--hooksecurefunc SetItemRef
Expand All @@ -267,16 +272,16 @@ function Module:OnEnable()
end)

--HookScript GameTooltip OnTooltipSetSpell
local function OnTooltipSetSpell(self)
TooltipAddSpellID(self, select(2, self:GetSpell()))
local function OnTooltipSetSpell(self, data)
TooltipAddSpellID(self, data.id)
end

local function OnMacroTooltipSetSpell(self)
if self:GetTooltipData() and self:GetTooltipData().lines and self:GetTooltipData().lines[2] and
self:GetTooltipData().lines[2].leftText then
local tooltipData = self:GetTooltipData()
local tooltipName = tooltipData.lines[2].leftText
local spellInfo = C_Spell.GetSpellInfo(tooltipName)
local tooltipData = self:GetTooltipData()
local tooltipName = tooltipData.lines[2].leftText
local spellInfo = C_Spell.GetSpellInfo(tooltipName)

if (spellInfo and spellInfo.spellID) then
TooltipAddSpellID(self, spellInfo.spellID)
Expand All @@ -286,6 +291,7 @@ function Module:OnEnable()

TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Macro, OnMacroTooltipSetSpell)
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Spell, OnTooltipSetSpell)
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.UnitAura, OnTooltipSetSpell)
end

if (db.hideincombat) then
Expand Down

0 comments on commit 7b580b5

Please sign in to comment.