Quantcast
local T, C, L = unpack(Tukui)

local datatext = {
	"Guild",
	"Friends",
	"Gold",
	"FPS",
	"System",
	"Bags",
	"Gold",
	"Time",
	"Durability",
	"Heal",
	"Damage",
	"Power",
	"Haste",
	"Crit",
	"Avoidance",
	"Armor",
	"Currency",
	"Hit",
	"Mastery",
	"MicroMenu",
	"Regen",
	"Talent",
	"CallToArms",
	"Experience",
}

local function SkinDataText()
	local mmsLeft, mmsRight = false, false
	for _, dt in pairs(datatext) do
		local stat = _G["TukuiStat"..dt]
		local text = _G["TukuiStat"..dt.."Text"]
		if stat then
			local point = stat.Option
			if point == 7 then mmsLeft = true end
			if point == 8 then mmsRight = true end

			text:SetFont(T.GetPixelFont())
		end
	end

	if mmsLeft == false then
		TukuiMinimapStatsRight:SetAllPoints(TukuiMinimapStatsLeft)
		TukuiMinimapStatsLeft:Kill()
	end

	if mmsRight == false then
		TukuiMinimapStatsRight:Kill()
	end


	TukuiMinimapStatsLeft:SetBackdrop(nil)
	TukuiMinimapStatsRight:SetBackdrop(nil)
	TukuiInfoLeft:SetBackdrop(nil)
	TukuiInfoRight:SetBackdrop(nil)
	TukuiInfoBackdrop = CreateFrame("Frame", "TukuiInfoBackdrop", UIParent)
	TukuiInfoBackdrop:SetTemplate("Transparent")
	TukuiInfoBackdrop:ThickBorder()
	TukuiInfoBackdrop:SetPoint("BOTTOMLEFT", TukuiInfoLeft, -8, 0)
	TukuiInfoBackdrop:SetPoint("TOPRIGHT", UIParent, 2, 2)--mmsRight and TukuiMinimapStatsRight or mmsLeft and TukuiMinimapStatsLeft or TukuiInfoRight)
	TukuiInfoBackdrop:SetFrameStrata("BACKGROUND")
	TukuiInfoBackdrop:SetFrameLevel(0)
end

local OnLoad = CreateFrame("Frame")
OnLoad:RegisterEvent("PLAYER_ENTERING_WORLD")
OnLoad:SetScript("OnEvent", function()
	SkinDataText()
end)