Skip to content

Commit

Permalink
🦠 FIX: SUF update portraits
Browse files Browse the repository at this point in the history
  • Loading branch information
mBlinkii committed Dec 25, 2024
1 parent 10a3ca0 commit ff6d029
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
12 changes: 12 additions & 0 deletions Blinkiis_Portraits/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ function BLINKIISPORTRAITS:PLAYER_ENTERING_WORLD(event)
end

function BLINKIISPORTRAITS:OnInitialize()
BLINKIISPORTRAITS.SUF = IsAddOnLoaded("ShadowedUnitFrames")
BLINKIISPORTRAITS.ELVUI = IsAddOnLoaded("ElvUI")

BLINKIISPORTRAITS:LoadDB()
BLINKIISPORTRAITS:RegisterEvent("PLAYER_ENTERING_WORLD")

Expand All @@ -83,4 +86,13 @@ function BLINKIISPORTRAITS:OnInitialize()

-- callback on profile change
self.db.RegisterCallback(self, "OnProfileChanged", BLINKIISPORTRAITS.LoadPortraits)

-- fix for suf
if BLINKIISPORTRAITS.SUF and ShadowUF then
if not BLINKIISPORTRAITS.SUF_Hook then
hooksecurefunc(ShadowUF, "LoadUnits", BLINKIISPORTRAITS.LoadPortraits)

BLINKIISPORTRAITS.SUF_Hook = true
end
end
end
8 changes: 0 additions & 8 deletions Blinkiis_Portraits/portraits/arena.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ end
function BLINKIISPORTRAITS:InitializeArenaPortrait()
if not BLINKIISPORTRAITS.db.profile.arena.enable then return end

if BLINKIISPORTRAITS.SUF and ShadowUF then
if not BLINKIISPORTRAITS.SUF_Arena_Hook then
hooksecurefunc(ShadowUF, "LoadUnits", BLINKIISPORTRAITS.InitializeArenaPortrait)

BLINKIISPORTRAITS.SUF_Arena_Hook = true
end
end

local unitframe = BLINKIISPORTRAITS:GetUnitFrames("arena")
if unitframe then
local portraits = BLINKIISPORTRAITS.Portraits
Expand Down
8 changes: 0 additions & 8 deletions Blinkiis_Portraits/portraits/boss.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ end
function BLINKIISPORTRAITS:InitializeBossPortrait()
if not BLINKIISPORTRAITS.db.profile.boss.enable then return end

if BLINKIISPORTRAITS.SUF and ShadowUF then
if not BLINKIISPORTRAITS.SUF_Boss_Hook then
hooksecurefunc(ShadowUF, "LoadUnits", BLINKIISPORTRAITS.InitializeBossPortrait)

BLINKIISPORTRAITS.SUF_Boss_Hook = true
end
end

local unitframe = BLINKIISPORTRAITS:GetUnitFrames("boss")
if unitframe then
local portraits = BLINKIISPORTRAITS.Portraits
Expand Down
8 changes: 0 additions & 8 deletions Blinkiis_Portraits/portraits/party.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ end
function BLINKIISPORTRAITS:InitializePartyPortrait()
if not BLINKIISPORTRAITS.db.profile.party.enable then return end

if BLINKIISPORTRAITS.SUF and ShadowUF then
if not BLINKIISPORTRAITS.SUF_Party_Hook then
hooksecurefunc(ShadowUF, "LoadUnits", BLINKIISPORTRAITS.InitializePartyPortrait)

BLINKIISPORTRAITS.SUF_Party_Hook = true
end
end

local unitframe = BLINKIISPORTRAITS:GetUnitFrames("party")
if unitframe then
local portraits = BLINKIISPORTRAITS.Portraits
Expand Down

0 comments on commit ff6d029

Please sign in to comment.