function CameraModule.GetCameraControlChoice(C)local s=Players.LocalPlayer if s then if C.lastInputType==Enum.UserInputType.Touch or UserInputService.TouchEnabled then if s.DevTouchCameraMode==Enum.DevTouchCameraMovementMode.UserChoice then return CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.TouchCameraMovementMode)else return CameraUtils.ConvertCameraModeEnumToStandard(s.DevTouchCameraMode)end else if s.DevComputerCameraMode==Enum.DevComputerCameraMovementMode.UserChoice then local C=CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)return CameraUtils.ConvertCameraModeEnumToStandard(C)else return CameraUtils.ConvertCameraModeEnumToStandard(s.DevComputerCameraMode)end end end end function CameraModule.OnCharacterAdded(p,C,s)if p.activeOcclusionModule then p.activeOcclusionModule:CharacterAdded(C,s)end end function CameraModule.OnCharacterRemoving(p,C,s)if p.activeOcclusionModule then p.activeOcclusionModule:CharacterRemoving(C,s)end end function CameraModule.OnPlayerAdded(s,C)C.CharacterAdded:Connect(function(p)s:OnCharacterAdded(p,C)end)C.CharacterRemoving:Connect(function(p)s:OnCharacterRemoving(p,C)end)end function CameraModule.OnMouseLockToggled(C)if C.activeMouseLockController then local s=C.activeMouseLockController:GetIsMouseLocked()local p=C.activeMouseLockController:GetMouseLockOffset()if C.activeCameraController then C.activeCameraController:SetIsMouseLocked(s)C.activeCameraController:SetMouseLockOffset(p)end end end local C=CameraModule.new()local s={}return C
-- 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
