local addonName, addon = ...

-- Frames to permanently hide:
--false = no need to unregister events
--true = unregister events (no point processing stuff we'll never see)
local frames = {
	--TargetFrame = false,
	--TargetFrameToT = true,
	ReputationWatchBar = true,
	--GameTimeFrameNormal = false, -- Handled in the dashboard.lua because of funny hide behavior
	--CastingBarFrameBorder = false,
	TimeManagerClockButton = false,
	ExhaustionTick = true,
	MainMenuExpBar = true,
	--MainMenuBarArtFrame = false, -- This hides buttons too.
	MainMenuBarMaxLevelBar = false,
	MainMenuBarTexture0 = false,
	MainMenuBarTexture1 = false,
	MainMenuBarTexture2 = false,
	MainMenuBarTexture3 = false,
	MainMenuBarLeftEndCap = false,
	MainMenuBarRightEndCap = false,
	--MainMenuBarPageNumber = false,
	BonusActionBarFrameTexture1 = false,
	BonusActionBarFrameTexture2 = false,
	
	SlidingActionBarTexture0 = false,
	SlidingActionBarTexture1 = false,
	
	ShapeshiftBarLeft = false,
	ShapeshiftBarRight = false,
	ShapeshiftBarMiddle = false,
	
	VehicleMenuBarArtFrameOVERLAY1 = false,
	VehicleMenuBarArtFrameOVERLAY2 = false,
	--VehicleMenuBarArtFrameOVERLAY3 = false,
	--VehicleMenuBarArtFrameOVERLAY4 = false,
	--VehicleMenuBarArtFrameARTWORK1 = false,
	--VehicleMenuBarArtFrameARTWORK2 = false,
	--VehicleMenuBarArtFrameARTWORK3 = false,
	--VehicleMenuBarArtFrameARTWORK4 = false,
	--VehicleMenuBarArtFrameARTWORK5 = false,
	--VehicleMenuBarArtFrameARTWORK6 = false,
	--VehicleMenuBarArtFrameARTWORK7 = false,
	--VehicleMenuBarArtFrameARTWORK8 = false,
	--VehicleMenuBarArtFrameARTWORK9 = false,
	--VehicleMenuBarArtFrameARTWORK10 = false,
	--VehicleMenuBarArtFrameBORDER1 = false,
	--VehicleMenuBarArtFrameBORDER2 = false,
	--VehicleMenuBarArtFrameBORDER3 = false,
	--VehicleMenuBarArtFrameBORDER4 = false,
	--VehicleMenuBarArtFrameBORDER5 = false,
	--VehicleMenuBarArtFrameBORDER6 = false,
	--VehicleMenuBarArtFrameBORDER7 = false,
	--VehicleMenuBarArtFrameBACKGROUND1 = false,
	--VehicleMenuBarArtFrameBACKGROUND2 = false,
	--VehicleMenuBarArtFrameBACKGROUND3 = false,
	
	MiniMapMailFrame = true,
	MinimapZoomIn = false,
	MinimapZoomOut = false,
	MinimapBackdrop = false,
	MinimapZoneTextButton = false,
	MinimapToggleButton = false,
	MiniMapWorldMapButton = true,
}

--[[-----------------------------------------------------------------------------
Initialize
-------------------------------------------------------------------------------]]
addon.RegisterEvent("HideFrames-Monitor", 'PLAYER_LOGIN', function(self, event)
	addon.UnregisterEvent(self, event)
	for name, unregister in pairs(frames) do
		local frame = _G[name]
		if frame then
			frames[name] = nil
			addon:HideFrame(frame)
			if unregister then
				frame:UnregisterAllEvents()
				frame:SetScript('OnEvent', nil)
			end
		end
	end
	if next(frames) then return end
end)