Commit 186b5b9d authored by Blazeflack's avatar Blazeflack

Attempt to fix 'script ran too long' error

Only execute 'UpdateButtonSettings()' when out of combat
parent a9a2c4f8
......@@ -95,12 +95,22 @@ EABFrame:SetScript('OnEvent',function(self, event, arg1)
end
elseif event == 'PLAYER_SPECIALIZATION_CHANGED' then
if arg1 == 'player' then
-- We learned a specialization, update the bar
EAB:UpdateButtonSettings()
if InCombatLockdown() then
-- In combat, wait until we're out of combat
EAB:RegisterEvent('PLAYER_REGEN_ENABLED')
else
-- We learned a specialization, update the bar
EAB:UpdateButtonSettings()
end
end
end
end)
function EAB:PLAYER_REGEN_ENABLED()
self:UnregisterEvent('PLAYER_REGEN_ENABLED')
self:UpdateButtonSettings()
end
function EAB:OnInitialize()
-- Register callback with LibElvUIPlugin
EP:RegisterPlugin(addon, EAB.InsertOptions)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment