local AddonName,ns = ...
ns.ADDUIBB = C_AddOns.GetAddOnMetadata(AddonName,"Version")
ns.AddUIDefaultDB = {
	Gname = nil,
	cvar = true,
	dbm = true,
	exrt = true,
	skada = true,
	tiny = true,
	ui = true,
	chat = true,
	comb = true,
	jbtext = true,
	SAT = 10,
	syd = true,
	icon = true,
	ct = true,
	ctp = false,
	
	dimi = true,
	
	unitf = true,
	unitbt = true,
	cast = true,
	SCastTexture = true,
	CastTexture = "Rainbow",
	quest = true,
	smap = true,
	smapicon = true,
	mmb = true,
	mmba = true,
	minimb = true,

	chatm = true,
	chatb = true,
	chatp = true,
	zu = true,
	stop = true,
	mh = true,
	sf = true,
	lfgkg = true,
	lfgautoinv = true,
	
	debuff = false,
	sq = true,
	raidframebuff = true,
	buffcall = true,
	iconcall = true,
	
	ftip = 1,
	SpellQ = 150,
	
	QuestCheck = true,
	hpUnits = 1,--单位
}

ns.fontSize = 12	-- 字体大小
ns.fadeTime = 15	-- 文字消失时间
ns.Fx,ns.Fy = 250, -200--默认位置
ns.enable = true	-- 启用插件
ns.showAA = true	-- 显示自动攻击
ns.showABS = true	--吸收盾
ns.showDOT = true	--dot
ns.showHOT = false	--hot

ns.SetPrice = 0
ns.SetNumber = 1

ns.CastBarTextrue = {
	["Rainbow"] = "Interface\\Addons\\AddUI\\UI\\Textures\\colorbar.tga",
	["EvokerEbon"] = "Unit_Evoker_EbonMight_Fill",
	["DemonHunter"] = "Unit_DemonHunter_Fury_Fill",
	["Priest"] = "Unit_Priest_Insanity_Fill",
	["Druid"] = "Unit_Druid_AstralPower_Fill",
	["Shaman"] = "Unit_Shaman_Maelstrom_Fill",
	["MonkGreen"] = "Unit_Monk_Stagger_Fill_Green",
	["MonkYellow"] = "Unit_Monk_Stagger_Fill_Yellow",
	["MonkRed"] = "Unit_Monk_Stagger_Fill_Red",
	["随机使用材质"] = "",
	--["Hunter"] = "_DemonHunter-DemonicPainBar",
	--["Mana"] = "UI-HUD-UnitFrame-Player-PortraitOff-Bar-Mana",
	--["Rage"] = "UI-HUD-UnitFrame-Player-PortraitOff-Bar-Rage",
	--["Focus"] = "UI-HUD-UnitFrame-Player-PortraitOff-Bar-Focus",
	--["Energy"] = "UI-HUD-UnitFrame-Player-PortraitOff-Bar-Energy",
	--["RunicPower"] = "UI-HUD-UnitFrame-Player-PortraitOff-Bar-RunicPower",
	--["PortraitOn"] = "UI-HUD-UnitFrame-Player-PortraitOn-Bar-TempHPLoss",--斜
}
ns.RerollTextrue = {}
for key in pairs(ns.CastBarTextrue) do
	if key ~= "随机使用材质" then
		table.insert(ns.RerollTextrue, key)
	end
end

----------ONLOAD EVENT---------
local loadFrame = CreateFrame("FRAME"); 
loadFrame:RegisterEvent("ADDON_LOADED"); 
loadFrame:RegisterEvent("PLAYER_LOGOUT"); 

function loadFrame:OnEvent(event, arg1)
	if not AddUIDB then AddUIDB = {} end
	for i, j in pairs(ns.AddUIDefaultDB) do
		if type(j) == "table" then
			if AddUIDB[i] == nil then AddUIDB[i] = {} end
			for k, v in pairs(j) do
				if AddUIDB[i][k] == nil then
					AddUIDB[i][k] = v
				end
			end
		else
			if AddUIDB[i] == nil then AddUIDB[i] = j end
		end
	end
end
loadFrame:SetScript("OnEvent", loadFrame.OnEvent);
loadFrame:OnEvent()
----------------------------------