function CameraModule.GetCameraControlChoice(J)local Y=Players.LocalPlayer if Y then if J.lastInputType==Enum.UserInputType.Touch or UserInputService.TouchEnabled then if Y.DevTouchCameraMode==Enum.DevTouchCameraMovementMode.UserChoice then return CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)else return CameraUtils.ConvertCameraModeEnumToStandard(Y.DevTouchCameraMode)end else if Y.DevComputerCameraMode==Enum.DevComputerCameraMovementMode.UserChoice then local J=CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)return CameraUtils.ConvertCameraModeEnumToStandard(J)else return CameraUtils.ConvertCameraModeEnumToStandard(Y.DevComputerCameraMode)end end end end function CameraModule.OnCharacterAdded(U,J,Y)if U.activeOcclusionModule then U.activeOcclusionModule:CharacterAdded(J,Y)end end function CameraModule.OnCharacterRemoving(U,J,Y)if U.activeOcclusionModule then U.activeOcclusionModule:CharacterRemoving(J,Y)end end function CameraModule.OnPlayerAdded(Y,J)J.CharacterAdded:Connect(function(U)Y:OnCharacterAdded(U,J)end)J.CharacterRemoving:Connect(function(U)Y:OnCharacterRemoving(U,J)end)end function CameraModule.OnMouseLockToggled(J)if J.activeMouseLockController then local Y=J.activeMouseLockController:GetIsMouseLocked()local U=J.activeMouseLockController:GetMouseLockOffset()if J.activeCameraController then J.activeCameraController:SetIsMouseLocked(Y)J.activeCameraController:SetMouseLockOffset(U)end end end local J=CameraModule.new()local Y={}return J
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types
function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer

	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevTouchCameraMode)
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode =
					CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end

function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end

local cameraModuleObject = CameraModule.new()
local cameraApi = {}

return cameraModuleObject
