local _,ns = ...
ns.ADDUIEVENT("PLAYER_LOGIN", function()
if not AddUIDB.raidframebuff then return end


local BigDotList = {
[440313] = true,--词缀不显示放大
--11.1第二赛季流血dot
[438975] = true,
[257544] = true,
[424414] = true, 
[424426] = true, 
[427621] = true, 
[427635] = true, 
[434773] = true, 
[439468] = true, 
[447272] = true, 
[453461] = true,
}

hooksecurefunc('CompactUnitFrame_UtilSetBuff', function(buffFrame, aura)
	if aura.duration < 61 or aura.expirationTime - GetTime()<61 then 
		local fontsize = buffFrame:GetHeight()/1.7
		buffFrame.cooldown:GetRegions():SetFont(STANDARD_TEXT_FONT, fontsize, nil)
		buffFrame.cooldown:SetHideCountdownNumbers(false)
	else
		buffFrame.cooldown:SetHideCountdownNumbers(true)
	end
end)

hooksecurefunc('CompactUnitFrame_UtilSetDebuff', function(debuffFrame, aura)
	local debuffsize = debuffFrame:GetParent():GetHeight()/3
	if aura.dispelName or BigDotList[aura.spellId] then
		debuffFrame:SetSize(debuffsize*1.5,debuffsize*1.5)
		debuffFrame.cooldown:GetRegions():SetFont(STANDARD_TEXT_FONT, debuffFrame:GetHeight()/1.8, nil)
		if (aura.duration < 61 or aura.expirationTime - GetTime()<61) and aura.expirationTime - GetTime()>0 then 
			debuffFrame.cooldown:SetHideCountdownNumbers(false)
		else
			debuffFrame.cooldown:SetHideCountdownNumbers(true)
		end
	elseif (aura.duration < 61 or aura.expirationTime - GetTime()<61) and aura.expirationTime - GetTime()>0 then 
		debuffFrame:SetSize(debuffsize,debuffsize)
		debuffFrame.cooldown:SetHideCountdownNumbers(false)
		debuffFrame.cooldown:GetRegions():SetFont(STANDARD_TEXT_FONT, debuffFrame:GetHeight()/1.8, nil)
	else
		debuffFrame:SetSize(debuffsize*.7,debuffsize*.7)
		debuffFrame.cooldown:SetHideCountdownNumbers(true)
	end
end)
--[[
hooksecurefunc('CompactUnitFrame_UpdatePrivateAuras', function(frame)
	if not frame.PrivateAuraAnchors then
		return;
	end
	local framesize = frame:GetParent():GetHeight()/3
	frame.PrivateAuraAnchor1:SetSize(framesize*1.4,framesize*1.4)
	if not frame.PrivateAuraAnchor1.cooldown then return end
	frame.PrivateAuraAnchor1.cooldown:SetHideCountdownNumbers(false)
	frame.PrivateAuraAnchor1.cooldown:GetRegions():SetFont(STANDARD_TEXT_FONT, frame.PrivateAuraAnchor1.cooldown:GetHeight()/1.8, nil)
end)]]

end)
--[[
local movespell = CreateFrame("Button", "movespell", UIParent, "SecureActionButtonTemplate")
--movespell:SetAllPoints(region)
movespell:RegisterForClicks("AnyDown", "AnyUp")
movespell:SetSize(1,1)
movespell:SetAttribute("type", "spell")
movespell:SetAttribute("spell","浮冰")


local magecool = CreateFrame("Frame",UIParent)
magecool:EnableKeyboard(true)
magecool:SetPropagateKeyboardInput(true)
magecool:SetScript("OnKeyDown", function(self, key)
	local spellID = select(9, UnitCastingInfo("player"))
	if key == "W" or key == "A" or key == "S" or key == "D" then
		--if spellID == "30451" or spellID == "365350" then
			movespell:Click("LeftButton")
			print("11")
		--end
		
	end
end)
]]

