mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Fix addon initialization order with guard checks
Refactor mouseover extensions to split initialization into two phases: OnLoad (empty) and OnAddOnLoad (actual setup). This ensures hooks are only registered when the target addon's globals are defined. Add guard clauses to check for required functions before hooking. Also remove Cursive's premature initialization attempt.
This commit is contained in:
@@ -38,7 +38,9 @@ function CleveRoids:NotGrid_CreateFrames()
|
||||
end
|
||||
end
|
||||
|
||||
function Extension.OnLoad()
|
||||
function Extension.OnLoad() end
|
||||
|
||||
function Extension.OnAddOnLoad()
|
||||
-- NotGrid loads before CleveRoids, so if NotGrid is enabled, then it's global will exist.
|
||||
if not NotGrid then
|
||||
return
|
||||
@@ -49,4 +51,4 @@ function Extension.OnLoad()
|
||||
|
||||
end
|
||||
|
||||
EventUtil.ContinueOnAddOnLoaded("NotGrid", Extension.OnLoad)
|
||||
EventUtil.ContinueOnAddOnLoaded("NotGrid", Extension.OnAddOnLoad)
|
||||
|
||||
Reference in New Issue
Block a user