function ControlModule.OnComputerMovementModeChange(N)local f,z=N:SelectComputerMovementModule()if z then N:SwitchToController(f)end end function ControlModule.OnTouchMovementModeChange(N)local f,z=N:SelectTouchModule()if z then while not N.touchControlFrame do wait()end N:SwitchToController(f)end end function ControlModule.CreateTouchGuiContainer(N)if N.touchGui then N.touchGui:Destroy()end N.touchGui=Instance.new("\083\099\114\101\101\110\071\117\105")N.touchGui.Name="\084\111\117\099\104\071\117\105"N.touchGui.ResetOnSpawn=false N.touchGui.ZIndexBehavior=Enum.ZIndexBehavior.Sibling N:UpdateTouchGuiVisibility()if FFlagUserDynamicThumbstickSafeAreaUpdate then N.touchGui.ClipToDeviceSafeArea=false end N.touchControlFrame=Instance.new("\070\114\097\109\101")N.touchControlFrame.Name="\084\111\117\099\104\067\111\110\116\114\111\108\070\114\097\109\101"N.touchControlFrame.Size=UDim2.new(1,0,1,0)N.touchControlFrame.BackgroundTransparency=1 N.touchControlFrame.Parent=N.touchGui N.touchGui.Parent=N.playerGui end function ControlModule.GetClickToMoveController(N)if not N.controllers[ClickToMove]then N.controllers[ClickToMove]=ClickToMove.new(CONTROL_ACTION_PRIORITY)end return N.controllers[ClickToMove]end return ControlModule.new()
-- Called when any relevant values of GameSettings or LocalPlayer change, forcing re-evalulation of
-- current control scheme
function ControlModule:OnComputerMovementModeChange()
	local controlModule, success = self:SelectComputerMovementModule()
	if success then
		self:SwitchToController(controlModule)
	end
end

function ControlModule:OnTouchMovementModeChange()
	local touchModule, success = self:SelectTouchModule()
	if success then
		while not self.touchControlFrame do
			wait()
		end
		self:SwitchToController(touchModule)
	end
end

function ControlModule:CreateTouchGuiContainer()
	if self.touchGui then
		self.touchGui:Destroy()
	end

	-- Container for all touch device guis
	self.touchGui = Instance.new("ScreenGui")
	self.touchGui.Name = "TouchGui"
	self.touchGui.ResetOnSpawn = false
	self.touchGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
	self:UpdateTouchGuiVisibility()

	if FFlagUserDynamicThumbstickSafeAreaUpdate then
		self.touchGui.ClipToDeviceSafeArea = false
	end

	self.touchControlFrame = Instance.new("Frame")
	self.touchControlFrame.Name = "TouchControlFrame"
	self.touchControlFrame.Size = UDim2.new(1, 0, 1, 0)
	self.touchControlFrame.BackgroundTransparency = 1
	self.touchControlFrame.Parent = self.touchGui

	self.touchGui.Parent = self.playerGui
end

function ControlModule:GetClickToMoveController()
	if not self.controllers[ClickToMove] then
		self.controllers[ClickToMove] = ClickToMove.new(CONTROL_ACTION_PRIORITY)
	end
	return self.controllers[ClickToMove]
end

return ControlModule.new()
