function ScopeHUD.didMount(p)p:UpdateTargetingState()local E=p.props.Core.Targeting p.Maid.ScopeChangeListener=E.ScopeChanged:Connect(function(u)E:UpdateTarget()p:setState({Scope=u or Roact.None})end)p.Maid.ScopeTargetChangeListener=E.ScopeTargetChanged:Connect(function(E)p:setState({ScopeTarget=E or Roact.None})end)p.Maid.TargetChangeListener=E.TargetChanged:Connect(function(E)p:setState({DirectTarget=E or Roact.None})end)p.Maid.ScopeLockChangeListener=E.ScopeLockChanged:Connect(function(E)p:setState({IsScopeLocked=E})end)local function u(E,u,z)if u.Name=="\066\101\103\105\110"then p:setState({IsAltDown=true})elseif u.Name=="\069\110\100"then p:setState({IsAltDown=false})end return Enum.ContextActionResult.Pass end ContextActionService:BindAction("\066\084\047\083\099\111\112\101\072\085\068\058 \083\099\111\112\101",u,false,Enum.KeyCode.LeftAlt,Enum.KeyCode.RightAlt)if p.LayoutRef.current then local E=p.LayoutRef.current local u=E:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\067\111\110\116\101\110\116\083\105\122\101")p.UpdateContainerSize(UDim2.new(0,E.AbsoluteContentSize.X,0,19.0))p.Maid.LayoutListener=u:Connect(function()p.UpdateContainerSize(UDim2.new(0,E.AbsoluteContentSize.X,0,19.0))end)end end
--- Begins tracking scope and target changes.
function ScopeHUD:didMount()
	self:UpdateTargetingState()

	-- Set up targeting change listeners
	local Targeting = self.props.Core.Targeting
	self.Maid.ScopeChangeListener = Targeting.ScopeChanged:Connect(function(Scope)
		Targeting:UpdateTarget()
		self:setState({
			Scope = Scope or Roact.None,
		})
	end)
	self.Maid.ScopeTargetChangeListener = Targeting.ScopeTargetChanged:Connect(function(ScopeTarget)
		self:setState({
			ScopeTarget = ScopeTarget or Roact.None,
		})
	end)
	self.Maid.TargetChangeListener = Targeting.TargetChanged:Connect(function(DirectTarget)
		self:setState({
			DirectTarget = DirectTarget or Roact.None,
		})
	end)
	self.Maid.ScopeLockChangeListener = Targeting.ScopeLockChanged:Connect(function(IsScopeLocked)
		self:setState({
			IsScopeLocked = IsScopeLocked,
		})
	end)

	-- Set up alt key listeners
	local function AltKeyCallback(_, State, Input)
		if State.Name == "Begin" then
			self:setState({
				IsAltDown = true,
			})
		elseif State.Name == "End" then
			self:setState({
				IsAltDown = false,
			})
		end
		return Enum.ContextActionResult.Pass
	end
	ContextActionService:BindAction(
		"BT/ScopeHUD: Scope",
		AltKeyCallback,
		false,
		Enum.KeyCode.LeftAlt,
		Enum.KeyCode.RightAlt
	)

	-- Set up content size listener
	if self.LayoutRef.current then
		local Layout = self.LayoutRef.current
		local LayoutChanged = Layout:GetPropertyChangedSignal("AbsoluteContentSize")
		self.UpdateContainerSize(UDim2.new(0, Layout.AbsoluteContentSize.X, 0, 38 / 2))
		self.Maid.LayoutListener = LayoutChanged:Connect(function()
			self.UpdateContainerSize(UDim2.new(0, Layout.AbsoluteContentSize.X, 0, 38 / 2))
		end)
	end
end
