Skip to content

Commit

Permalink
NP: prevent ZNP init if Elvui Nameplates are disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Zidras committed Nov 13, 2024
1 parent e51d211 commit 24f777a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ElvUI_ProjectZidras/Modules/Nameplates/Nameplates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -493,16 +493,16 @@ function ZNP:UpdateAllSettings()
end

function ZNP:Initialize()
if NP.Initialized then
self:UpdateAllSettings()
if not NP.Initialized then return end

if E.db.pz.nameplates.hdClient.hdNameplates then
UpdateCVarsHook(NP) -- update once since we cannot hook it in time on NP:Initialize.
end
self:UpdateAllSettings()

hooksecurefunc(NP, "SetMouseoverFrame", restoreNameplateUnitAfterMouseover) -- this is needed to hotfix ElvUI behaviour that clears frame.unit on all mouseover losses, so always hook it
if E.db.pz.nameplates.hdClient.hdNameplates then
UpdateCVarsHook(NP) -- update once since we cannot hook it in time on NP:Initialize.
end

hooksecurefunc(NP, "SetMouseoverFrame", restoreNameplateUnitAfterMouseover) -- this is needed to hotfix ElvUI behaviour that clears frame.unit on all mouseover losses, so always hook it

self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
self:RegisterEvent("PLAYER_TARGET_CHANGED")
self:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
Expand Down

0 comments on commit 24f777a

Please sign in to comment.