MoveTool.HandleDragging=(require(script:WaitForChild("\072\097\110\100\108\101\068\114\097\103\103\105\110\103"))).new(MoveTool)MoveTool.FreeDragging=(require(script:WaitForChild("\070\114\101\101\068\114\097\103\103\105\110\103"))).new(MoveTool)MoveTool.UIController=(require(script:WaitForChild("\085\073\067\111\110\116\114\111\108\108\101\114"))).new(MoveTool)function MoveTool.Equip(V)V:SetAxes(V.Axes)V.UIController:ShowUI()V:BindShortcutKeys()V.FreeDragging:EnableDragging()end function MoveTool.Unequip(V)if V.FreeDragging.IsDragging then V.FreeDragging:FinishDragging()end ContextActionService:UnbindAction("\066\084\058 \083\116\097\114\116 \100\114\097\103\103\105\110\103")V.UIController:HideUI()V.HandleDragging:HideHandles()V.Maid:Destroy()BoundingBox.ClearBoundingBox()SnapTracking.StopTracking()end function MoveTool.SetAxes(s,V)s.Axes=V s.AxesChanged:Fire(s.Axes)BoundingBox.ClearBoundingBox()if V=="\071\108\111\098\097\108"then BoundingBox.StartBoundingBox(function(V)s.HandleDragging:AttachHandles(V)end)elseif V=="\076\111\099\097\108"then s.HandleDragging:AttachHandles(Selection.Focus,true)elseif V=="\076\097\115\116"then s.HandleDragging:AttachHandles(Selection.Focus,true)end end

MoveTool.HandleDragging = require(script:WaitForChild 'HandleDragging')
	.new(MoveTool)
MoveTool.FreeDragging = require(script:WaitForChild 'FreeDragging')
	.new(MoveTool)
MoveTool.UIController = require(script:WaitForChild 'UIController')
	.new(MoveTool)

function MoveTool:Equip()
	-- Enables the tool's equipped functionality

	-- Set our current axis mode
	self:SetAxes(self.Axes)

	-- Start up our interface
	self.UIController:ShowUI()
	self:BindShortcutKeys()
	self.FreeDragging:EnableDragging()

end

function MoveTool:Unequip()
	-- Disables the tool's equipped functionality

	-- If dragging, finish dragging
	if self.FreeDragging.IsDragging then
		self.FreeDragging:FinishDragging()
	end

	-- Disable dragging
	ContextActionService:UnbindAction 'BT: Start dragging'

	-- Clear unnecessary resources
	self.UIController:HideUI()
	self.HandleDragging:HideHandles()
	self.Maid:Destroy()
	BoundingBox.ClearBoundingBox();
	SnapTracking.StopTracking();

end

function MoveTool:SetAxes(AxisMode)
	-- Sets the given axis mode

	-- Update setting
	self.Axes = AxisMode
	self.AxesChanged:Fire(self.Axes)

	-- Disable any unnecessary bounding boxes
	BoundingBox.ClearBoundingBox();

	-- For global mode, use bounding box handles
	if AxisMode == 'Global' then
		BoundingBox.StartBoundingBox(function (BoundingBox)
			self.HandleDragging:AttachHandles(BoundingBox)
		end)

	-- For local mode, use focused part handles
	elseif AxisMode == 'Local' then
		self.HandleDragging:AttachHandles(Selection.Focus, true)

	-- For last mode, use focused part handles
	elseif AxisMode == 'Last' then
		self.HandleDragging:AttachHandles(Selection.Focus, true)
	end

end
