local _, NS = ...;

SetCVar("cameraDistanceMaxZoomFactor", 2.6);
SetCVar("weatherDensity", 0);
-- Size of cursor: -1=determine based on system/monitor dpi (default), 0=32x32, 1=48x48, 2=64x64, 3=96x96, 4=128x128
SetCVar("cursorSizePreferred", 1);

-- Hide target & focus cast bars (duplicate info with sArena cast bars)
TargetFrameSpellBar:UnregisterAllEvents()
FocusFrameSpellBar:UnregisterAllEvents()

-- Hide focus frame
FocusFrame:SetAlpha(0)



ArenaEnemyMatchFrame1PetFrame:SetAlpha(0)
ArenaEnemyMatchFrame2PetFrame:SetAlpha(0)
ArenaEnemyMatchFrame3PetFrame:SetAlpha(0)

-- Hide group indicator
hooksecurefunc("PlayerFrame_UpdateGroupIndicator", function ()
    local groupIndicator = PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual.GroupIndicator
    if GetNumGroupMembers() <= 5 then
        groupIndicator:Hide()
    end
end)

-- Hide group leader icon
hooksecurefunc("PlayerFrame_UpdatePartyLeader", function ()
    local playerFrameTargetContextual = PlayerFrame_GetPlayerFrameContentContextual()
    playerFrameTargetContextual.LeaderIcon:Hide()
    playerFrameTargetContextual.GuideIcon:Hide()
end)

-- Hide player name and level (if full level)
PlayerName:Hide();

-- Hide level text when max level
hooksecurefunc("PlayerFrame_UpdateLevel", function ()
    if (UnitExists("player")) then
		local level = UnitLevel(PlayerFrame.unit);
		local effectiveLevel = UnitEffectiveLevel(PlayerFrame.unit);
		if (effectiveLevel ~= level) then
			PlayerLevelText:SetVertexColor(0.1, 1.0, 0.1, 1.0);
		else
			PlayerLevelText:SetVertexColor(1.0, 0.82, 0.0, 1.0);
		end

        if (effectiveLevel ~= 70) then
		    PlayerLevelText:SetText(effectiveLevel);
        else
            PlayerLevelText:SetText("");
        end
	end
end)

-- Hide role icon in arena
hooksecurefunc("PlayerFrame_UpdateRolesAssigned", function ()
	local roleIcon = PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual.RoleIcon;
	if IsActiveBattlefieldArena() then
        roleIcon:SetShown(false);
    end
end)

hooksecurefunc("CompactUnitFrame_UpdateName", function(frame)
    if frame:IsForbidden() then
        return;
    end

    -- Check if this is a compact party/raid frame
    if ( frame:GetParent() == CompactPartyFrame ) then
        frame.name:Hide();
        return true;
    end
end)

-- Hide reputation/XP bar in arena
local hideXP = CreateFrame("Frame");
hideXP:RegisterEvent(NS.PLAYER_ENTERING_WORLD);
hideXP:RegisterEvent(NS.ARENA_PREP_OPPONENT_SPECIALIZATIONS);
hideXP:SetScript("OnEvent", function (self, event, ...)
    if IsActiveBattlefieldArena() then
        StatusTrackingBarManager:Hide();
    else
        StatusTrackingBarManager:Show();
    end
end)

--[[     

Profile:

4Xz7yU0CAJeeh)tusnVFC0yJRYvTHKkY(6uRaKXQSqsLKiKSh2p7Bp9OhqeGbVSPYH9qk6mp6Pvp)6)QLDu3JUOYQINtZs8MZJRQ9)(515PtIRKE7vzfBDtCr1lsYJRsl82ZlQwMu5TAkkYAslRDZDr5XRtqJ1B8JbU0VTxk2(u(M6KL(zaF0aBeSIRa3HEOkEXRpLN20ogZfTTOkBPFUxsx9sg8VMhJRwL043xD6FL4MXGvTao6LfBZVTytEJF1vXnjlNe30KLSQcgeDXIISnRZRDZmUOnyCCtw5lXUzKpkKWrcUp3f9htVhEuRltYY8jGzcT2yGTptr5CL3WOjmH3GAK4auceeWVwdHycdyyAAyjcUcxmxtSkcoMvjLsVLqlnObLAiCCRCoJeCkvzew8GfO3fgTfnKmTU9y5HPOmMqJ(M7ndtcbopeckMcpfUIBPOZzuILINNqkWdgY51Btlt6tjkFkzzCzt63sWBY4V)WII20xwXIxtWKQ)M2fDhCjuwuN2KwK7jLQKSy)gFSaC7n(7YP5jR)X9vWQXLMc3tTP6U1(LWG3oD2Jt)Ql6hF(z4S(aN4I(oAsPG5ZEp4bLMyx0NME3dp9jFO3th3xSydcELXlxMMVcEubUTcaVYTXvyepFFSOPNXPxbgFiXmoKoeNFZxNo7MouMZoc52xfmc0pqzrpMRofM3LMhaDQrRjiyz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