local _,ns = ...
ns.ADDUIEVENT("PLAYER_ENTERING_WORLD", function()
if AddUIDB.mmba ==  false then return end
if C_AddOns.IsAddOnLoaded("Dominos") then return end
if C_AddOns.IsAddOnLoaded("Bartender4") then return end
if C_AddOns.IsAddOnLoaded("ElvUI") then	return end
if C_AddOns.IsAddOnLoaded("BigFoot") then return end
if C_AddOns.IsAddOnLoaded("NDui") then return end


--隐藏动作条按钮相关改动HideActionbarAnimations
local function StyleButton(Button)
	local Name = Button:GetName()
	local InterruptDisplay = _G[Name].InterruptDisplay -- 打断施法红色
	local SpellCastAnimFrame = _G[Name].SpellCastAnimFrame -- 施法进度
	local TargetReticleAnimFrame = _G[Name].TargetReticleAnimFrame -- 地板法术圈
	local CooldownFlash = _G[Name].CooldownFlash -- 冷却完成转圈
	for _, v in pairs ({
		InterruptDisplay,
		SpellCastAnimFrame,
		TargetReticleAnimFrame,
		CooldownFlash,
	}) do 
		hooksecurefunc(v, "Show", function(s)
			s:Hide()
		end)
		v:Show()
	end
end
local bar={"MultiBarBottomLeft", "MultiBarBottomRight", "Action", "MultiBarLeft", "MultiBarRight","MultiBar5","MultiBar6","MultiBar7"} 
for buttons=1,#bar do for i=1,12 do 
	StyleButton(_G[bar[buttons].."Button"..i])
end end
for i = 1, 6 do
	StyleButton(_G["OverrideActionBarButton"..i])
end

--恢复动作条充能冷却闪光HideActionbarAnimations
--[[
hooksecurefunc("StartChargeCooldown", function(parent, chargeStart, chargeDuration, chargeModRate)
	if parent.chargeCooldown then
		parent.chargeCooldown:SetEdgeTexture("Interface\\Cooldown\\edge")
	end
end)]]
--利用wa的lib旧版动画
if not LibStub or not LibStub("LibCustomGlow-1.0", true) then return end
--Blizzard_ActionBar\Shared\ActionButtonSpellAlerts.lua
hooksecurefunc(ActionButtonSpellAlertManager,"ShowAlert", function(self,actionButton)
	if actionButton.SpellActivationAlert then
		actionButton.SpellActivationAlert:Hide();
	end
	LibStub("LibCustomGlow-1.0").ButtonGlow_Start(actionButton,{0, 1, 1, 1},0.125)
end)
hooksecurefunc(ActionButtonSpellAlertManager,"HideAlert", function(self,actionButton)
	LibStub("LibCustomGlow-1.0").ButtonGlow_Stop(actionButton)
end)


end)