local addonName, addon = ...

UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarBottomLeft'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarBottomRight'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarLeft'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['MultiBarRight'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['MultiCastActionBarFrame'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['MULTICASTACTIONBAR_YPOS'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['PetActionBar'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['PETACTIONBAR_YPOS'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['PossessBarFrame'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['ShapeshiftBarFrame'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['VehicleMenuBar'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame1'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame2'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame3'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame4'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS['ContainerFrame5'] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["CONTAINER_OFFSET_X"] = nil
UIPARENT_MANAGED_FRAME_POSITIONS["CONTAINER_OFFSET_Y"] = nil






-- VehicleMenuBar

--VehicleMenuBar:SetScale(0.84)
function addon:VehicFrameSetup()
	local vehicpitchShown = IsVehicleAimAngleAdjustable()
	if vehicpitchShown == 1 then
		VehicleMenuBar:SetScale(0.77)
		VehicleMenuBarPowerBar:ClearAllPoints()
		VehicleMenuBarPowerBar:SetPoint("CENTER", VehicleMenuBar, "CENTER", 235, 12)

		
		VehicleMenuBarHealthBar:ClearAllPoints()
		VehicleMenuBarHealthBar:SetPoint("CENTER", VehicleMenuBar, "CENTER", 170, 12)

		
		VehicleMenuBarArtFrameBACKGROUND1:Hide()
		VehicleMenuBarArtFrameBACKGROUND2:Hide()
		VehicleMenuBarArtFrameBACKGROUND3:Hide() 
	
	
	else
		VehicleMenuBar:SetScale(0.84)
		VehicleMenuBarPowerBar:ClearAllPoints()
		VehicleMenuBarPowerBar:SetPoint("CENTER", VehicleMenuBar, "CENTER", 165, 12)


		VehicleMenuBarHealthBar:ClearAllPoints()
		VehicleMenuBarHealthBar:SetPoint("CENTER", VehicleMenuBar, "CENTER", 100, 12)

		
		VehicleMenuBarArtFrameBACKGROUND1:Show()
		VehicleMenuBarArtFrameBACKGROUND2:Show()
		VehicleMenuBarArtFrameBACKGROUND3:Show() 
	
	end
end



hooksecurefunc("UIParent_ManageFramePositions", function(self)
	addon:SafeCall("VehicFrameSetup")
end)

hooksecurefunc("UpdateUIPanelPositions", function(self)
	addon:SafeCall("VehicFrameSetup")
end)

hooksecurefunc("ValidateFramePosition", function(self)
	addon:SafeCall("VehicFrameSetup")
end)