function IconController.updateTopbar(M)local function o(M,o)local I=M:get("\105\099\111\110\083\105\122\101")or UDim2.new(0,32,0,32)local l=I.X.Offset local U=IconController[o.."\071\097\112"]local Y=l+U local D=Y local t=0 if M._parentIcon==nil then local o,I,l=IconController.getMenuOffset(M)t+=o D+=I+l end return D,t end if topbarUpdating then return false end;(coroutine.wrap(function()topbarUpdating=true runService.Heartbeat:Wait()topbarUpdating=false for M,o in pairs(alignmentDetails)do o.records={}end for M,o in pairs(topbarIcons)do if IconController.canShowIconOnTopbar(M)then local o=M:get("\097\108\105\103\110\109\101\110\116")table.insert(alignmentDetails[o].records,M)end end local I=workspace.CurrentCamera.ViewportSize for l,U in pairs(alignmentDetails)do local Y=U.records if#Y>1 then if U.reverseSort then table.sort(Y,function(M,o)return M:get("\111\114\100\101\114")>o:get("\111\114\100\101\114")end)else table.sort(Y,function(M,o)return M:get("\111\114\100\101\114")<o:get("\111\114\100\101\114")end)end end local D=0 for M,I in pairs(Y)do local U=o(I,l)D=D+U end local t=U.getStartOffset(D,l)local k=t local i=TopbarPlusGui.TopbarContainer.AbsoluteSize.X for M,I in pairs(Y)do local Y,D=o(I,l)local t=(U.startScale*i+k)+D k=k+Y end for Y,D in pairs(Y)do local k=D.instances.iconContainer local i,P=o(D,l)local H=D.topPadding local h=UDim2.new(U.startScale,t+P,H.Scale,H.Offset)local c=string.match(D.name,"\095\111\118\101\114\102\108\111\119\073\099\111\110-")if M then(tweenService:Create(k,M,{Position=h})):Play()else k.Position=h end t=t+i D.targetPosition=UDim2.new(0,h.X.Scale*I.X+h.X.Offset,0,h.Y.Scale*I.Y+h.Y.Offset)end end local l=10 local function U(M,o,I)local l=I or 0 local U=M:get("\105\099\111\110\083\105\122\101")local Y=U.X.Offset local D,t=IconController.getMenuOffset(M)local k=o=="\108\101\102\116"and-l-D or o=="\114\105\103\104\116"and(Y+l)+t local i=M.targetPosition.X.Offset+k return i end local function Y(M,o)local I,l=M:get("\105\099\111\110\083\105\122\101",nil,"\098\101\102\111\114\101\068\114\111\112\100\111\119\110")local U=o and l or I local Y,D=IconController.getMenuOffset(M)local t=(U.X.Offset+Y)+D return t end for M,o in pairs(alignmentDetails)do local D=o.overflowIcon if D then local t=IconController[M.."\071\097\112"]local k=M=="\108\101\102\116"and"\114\105\103\104\116"or"\108\101\102\116"local i=alignmentDetails[k]local P=IconController.getIcon("\095\111\118\101\114\102\108\111\119\073\099\111\110-"..k)local H=U(D,M)if D.enabled then H=U(D,k,t)end local function h(o)local I=M=="\108\101\102\116"and o<H or M=="\114\105\103\104\116"and o>H return I end local c=i.getOffset()if not D.enabled then c+=l end local j=M=="\108\101\102\116"and I.X-c or M=="\114\105\103\104\116"and c local e=j local T=h(e)local function a(o)local I=#o for Y=1,I,1 do local t=o[(I+1)-Y]if IconController.canShowIconOnTopbar(t)then local o=string.match(t.name,"\095\111\118\101\114\102\108\111\119\073\099\111\110-")if o and I~=1 then break elseif o and not t.enabled then continue end local Y=0 if not D.enabled then Y=l end local k=U(t,M,Y)local i=M=="\108\101\102\116"and k<e or M=="\114\105\103\104\116"and k>e if i then e=k if h(k)then T=true end end end end end a(alignmentDetails[k].records)a(alignmentDetails.mid.records)if T then local I=o.records local l=#I for o=1,l,1 do local Y=M=="\108\101\102\116"and I[(l+1)-o]or M=="\114\105\103\104\116"and I[o]if Y~=D and IconController.canShowIconOnTopbar(Y)then local o=t local I=(D:get("\105\099\111\110\083\105\122\101")).X.Offset if D.enabled then o+=t+I end local l=U(Y,k,o)local i=M=="\108\101\102\116"and l>=e or M=="\114\105\103\104\116"and l<=e if i then if not D.enabled then local o=D.instances.iconContainer local I=o.Position.Y local l=M=="\108\101\102\116"and-o.Size.X.Offset or 0 local t=U(Y,k,l)o.Position=UDim2.new(0,t,I.Scale,I.Offset)D:setEnabled(true)end if#Y.dropdownIcons>0 then Y._overflowConvertedToMenu=true local M=Y.isSelected Y:deselect()local o={}for M,I in pairs(Y.dropdownIcons)do table.insert(o,I)end for M,o in pairs(Y.dropdownIcons)do o:leave()end Y:setMenu(o)if M and D.isSelected then Y:select()end end Y:join(D,"\100\114\111\112\100\111\119\110")if#Y.menuIcons>0 and Y.menuOpen then Y:deselect()Y:select()D:select()end end break end end else local I,H local h=#D.dropdownIcons if not(P.enabled and(#o.records==1 and#i.records~=1))then for o,l in pairs(D.dropdownIcons)do local U=l:get("\111\114\100\101\114")if H==nil or M=="\108\101\102\116"and U<I or M=="\114\105\103\104\116"and U>I then I=U H=l end end end if H then local o=Y(H,true)local I=U(D,k)if h==1 then I=U(D,M,t-l)end local i=math.abs(e-I)-t*2 local P=o<i if P then if#D.dropdownIcons==1 then D:setEnabled(false)end local M=D.instances.iconContainer local o=M.Position.Y M.Position=UDim2.new(0,I,o.Scale,o.Offset)H:leave()if H._overflowConvertedToMenu then H._overflowConvertedToMenu=nil local M={}for o,I in pairs(H.menuIcons)do table.insert(M,I)end for M,o in pairs(H.menuIcons)do o:leave()end H:setDropdown(M)end end end end end end return true end))()end function IconController.setTopbarEnabled(M,o)if o==nil then o=true end local I=TopbarPlusGui.Indicator if o and not M then forceTopbarDisabled=true elseif o and M then forceTopbarDisabled=false end if IconController.controllerModeEnabled then if M then if TopbarPlusGui.TopbarContainer.Visible or forceTopbarDisabled or menuOpen or not checkTopbarEnabled()then return end if o then I.Visible=checkTopbarEnabled()else if hapticService:IsVibrationSupported(Enum.UserInputType.Gamepad1)and hapticService:IsMotorSupported(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small)then hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,1)delay(.2,function()pcall(function()hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,0)end)end)end TopbarPlusGui.TopbarContainer.Visible=true TopbarPlusGui.TopbarContainer:TweenPosition(UDim2.new(0,0,0,5+STUPID_CONTROLLER_OFFSET),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.1,true)local M local o=0 IconController:_updateSelectionGroup()runService.Heartbeat:Wait()local l=50 for I,U in pairs(topbarIcons)do if IconController.canShowIconOnTopbar(I)and(M==nil or I:get("\111\114\100\101\114")>M:get("\111\114\100\101\114"))then M=I end local Y=I.instances.iconContainer local D=(-27+Y.AbsoluteSize.Y)+l if D>o then o=D end end if guiService:GetEmotesMenuOpen()then guiService:SetEmotesMenuOpen(false)end if guiService:GetInspectMenuEnabled()then guiService:CloseInspectMenu()end local U=IconController._previousSelectedObject or M.instances.iconButton IconController._setControllerSelectedObject(U)I.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\053\050\055\056\049\053\049\048\055\049"I:TweenPosition(UDim2.new(.5,0,0,o+STUPID_CONTROLLER_OFFSET),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.1,true)end else if o then I.Visible=false else I.Visible=checkTopbarEnabled()end if not TopbarPlusGui.TopbarContainer.Visible then return end guiService.AutoSelectGuiEnabled=true IconController:_updateSelectionGroup(true)TopbarPlusGui.TopbarContainer:TweenPosition(UDim2.new(0,0,0,-TopbarPlusGui.TopbarContainer.Size.Y.Offset+STUPID_CONTROLLER_OFFSET),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.1,true,function()TopbarPlusGui.TopbarContainer.Visible=false end)I.Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\053\050\055\056\049\053\049\053\053\054"I:TweenPosition(UDim2.new(.5,0,0,5),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.1,true)end else local o=TopbarPlusGui.TopbarContainer if checkTopbarEnabled()then o.Visible=M else o.Visible=false end end end function IconController.setGap(M,o)local I=tonumber(M)or 12 local l=(tostring(o)):lower()if l=="\108\101\102\116"or l=="\109\105\100"or l=="\114\105\103\104\116"then IconController[l.."\071\097\112"]=I return end IconController.leftGap=I IconController.midGap=I IconController.rightGap=I IconController.updateTopbar()end

function IconController.updateTopbar(toggleTransitionInfo)
	local function getIncrement(otherIcon, alignment)
		--local container = otherIcon.instances.iconContainer
		--local sizeX = container.Size.X.Offset
		local iconSize = otherIcon:get("iconSize") or UDim2.new(0, 32, 0, 32)
		local sizeX = iconSize.X.Offset
		local alignmentGap = IconController[alignment.."Gap"]
		local iconWidthAndGap = (sizeX + alignmentGap)
		local increment = iconWidthAndGap
		local preOffset = 0
		if otherIcon._parentIcon == nil then
			local extendLeft, extendRight, additionalRight = IconController.getMenuOffset(otherIcon)
			preOffset += extendLeft
			increment += extendRight + additionalRight
		end
		return increment, preOffset
	end
	if topbarUpdating then -- This prevents the topbar updating and shifting icons more than it needs to
		return false
	end
	coroutine.wrap(function()
		topbarUpdating = true
		runService.Heartbeat:Wait()
		topbarUpdating = false
		
		for alignment, alignmentInfo in pairs(alignmentDetails) do
			alignmentInfo.records = {}
		end

		for otherIcon, _ in pairs(topbarIcons) do
			if IconController.canShowIconOnTopbar(otherIcon) then
				local alignment = otherIcon:get("alignment")
				table.insert(alignmentDetails[alignment].records, otherIcon)
			end
		end
		local viewportSize = workspace.CurrentCamera.ViewportSize
		for alignment, alignmentInfo in pairs(alignmentDetails) do
			local records = alignmentInfo.records
			if #records > 1 then
				if alignmentInfo.reverseSort then
					table.sort(records, function(a,b) return a:get("order") > b:get("order") end)
				else
					table.sort(records, function(a,b) return a:get("order") < b:get("order") end)
				end
			end
			local totalIconX = 0
			for i, otherIcon in pairs(records) do
				local increment = getIncrement(otherIcon, alignment)
				totalIconX = totalIconX + increment
			end
			local offsetX = alignmentInfo.getStartOffset(totalIconX, alignment)
			local preOffsetX = offsetX
			local containerX = TopbarPlusGui.TopbarContainer.AbsoluteSize.X
			for i, otherIcon in pairs(records) do
				local increment, preOffset = getIncrement(otherIcon, alignment)
				local newAbsoluteX = alignmentInfo.startScale*containerX + preOffsetX+preOffset
				preOffsetX = preOffsetX + increment
			end
			for i, otherIcon in pairs(records) do
				local container = otherIcon.instances.iconContainer
				local increment, preOffset = getIncrement(otherIcon, alignment)
				local topPadding = otherIcon.topPadding
				local newPositon = UDim2.new(alignmentInfo.startScale, offsetX+preOffset, topPadding.Scale, topPadding.Offset)
				local isAnOverflowIcon = string.match(otherIcon.name, "_overflowIcon-")
				if toggleTransitionInfo then
					tweenService:Create(container, toggleTransitionInfo, {Position = newPositon}):Play()
				else
					container.Position = newPositon
				end
				offsetX = offsetX + increment
				otherIcon.targetPosition = UDim2.new(0, (newPositon.X.Scale*viewportSize.X) + newPositon.X.Offset, 0, (newPositon.Y.Scale*viewportSize.Y) + newPositon.Y.Offset)
			end
		end

		-- OVERFLOW HANDLER
		--------
		local START_LEEWAY = 10 -- The additional offset where the end icon will be converted to ... without an apparant change in position
		local function getBoundaryX(iconToCheck, side, gap)
			local additionalGap = gap or 0
			local currentSize = iconToCheck:get("iconSize")
			local sizeX = currentSize.X.Offset
			local extendLeft, extendRight = IconController.getMenuOffset(iconToCheck)
			local boundaryXOffset = (side == "left" and (-additionalGap-extendLeft)) or (side == "right" and sizeX+additionalGap+extendRight)
			local boundaryX = iconToCheck.targetPosition.X.Offset + boundaryXOffset
			return boundaryX
		end
		local function getSizeX(iconToCheck, usePrevious)
			local currentSize, previousSize = iconToCheck:get("iconSize", nil, "beforeDropdown")
			local newSize = (usePrevious and previousSize) or currentSize
			local extendLeft, extendRight = IconController.getMenuOffset(iconToCheck)
			local sizeX = newSize.X.Offset + extendLeft + extendRight
			return sizeX
		end

		for alignment, alignmentInfo in pairs(alignmentDetails) do
			local overflowIcon = alignmentInfo.overflowIcon
			if overflowIcon then
				local alignmentGap = IconController[alignment.."Gap"]
				local oppositeAlignment = (alignment == "left" and "right") or "left"
				local oppositeAlignmentInfo = alignmentDetails[oppositeAlignment]
				local oppositeOverflowIcon = IconController.getIcon("_overflowIcon-"..oppositeAlignment)
				
				-- This determines whether any icons (from opposite or mid alignment) are overlapping with this alignment
				local overflowBoundaryX = getBoundaryX(overflowIcon, alignment)
				if overflowIcon.enabled then
					overflowBoundaryX = getBoundaryX(overflowIcon, oppositeAlignment, alignmentGap)
				end
				local function doesExceed(givenBoundaryX)
					local exceeds = (alignment == "left" and givenBoundaryX < overflowBoundaryX) or (alignment == "right" and givenBoundaryX > overflowBoundaryX)
					return exceeds
				end
				local alignmentOffset = oppositeAlignmentInfo.getOffset()
				if not overflowIcon.enabled then
					alignmentOffset += START_LEEWAY
				end
				local alignmentBorderX = (alignment == "left" and viewportSize.X - alignmentOffset) or (alignment == "right" and alignmentOffset)
				local closestBoundaryX = alignmentBorderX
				local exceededCriticalBoundary = doesExceed(closestBoundaryX)
				local function checkBoundaryExceeded(recordToCheck)
					local totalIcons = #recordToCheck
					for i = 1, totalIcons do
						local endIcon = recordToCheck[totalIcons+1 - i]
						if IconController.canShowIconOnTopbar(endIcon) then
							local isAnOverflowIcon = string.match(endIcon.name, "_overflowIcon-")
							if isAnOverflowIcon and totalIcons ~= 1 then --!!!
								break
							elseif isAnOverflowIcon and not endIcon.enabled then
								continue
							end
							local additionalMyX = 0
							if not overflowIcon.enabled then
								additionalMyX = START_LEEWAY
							end
							local myBoundaryX = getBoundaryX(endIcon, alignment, additionalMyX)
							local isNowClosest = (alignment == "left" and myBoundaryX < closestBoundaryX) or (alignment == "right" and myBoundaryX > closestBoundaryX)
							if isNowClosest then
								closestBoundaryX = myBoundaryX
								if doesExceed(myBoundaryX) then
									exceededCriticalBoundary = true
								end
							end
						end
					end
				end
				checkBoundaryExceeded(alignmentDetails[oppositeAlignment].records)
				checkBoundaryExceeded(alignmentDetails.mid.records)

				-- This determines which icons to give to the overflow if an overlap is present
				if exceededCriticalBoundary then
					local recordToCheck = alignmentInfo.records
					local totalIcons = #recordToCheck
					for i = 1, totalIcons do
						local endIcon = (alignment == "left" and recordToCheck[totalIcons+1 - i]) or (alignment == "right" and recordToCheck[i])
						if endIcon ~= overflowIcon and IconController.canShowIconOnTopbar(endIcon) then
							local additionalGap = alignmentGap
							local overflowIconSizeX = overflowIcon:get("iconSize").X.Offset
							if overflowIcon.enabled then
								additionalGap += alignmentGap + overflowIconSizeX
							end
							local myBoundaryXPlusGap = getBoundaryX(endIcon, oppositeAlignment, additionalGap)
							local exceeds = (alignment == "left" and myBoundaryXPlusGap >= closestBoundaryX) or (alignment == "right" and myBoundaryXPlusGap <= closestBoundaryX)
							if exceeds then
								if not overflowIcon.enabled then
									local overflowContainer = overflowIcon.instances.iconContainer
									local yPos = overflowContainer.Position.Y
									local appearXAdditional = (alignment == "left" and -overflowContainer.Size.X.Offset) or 0
									local appearX = getBoundaryX(endIcon, oppositeAlignment, appearXAdditional)
									overflowContainer.Position = UDim2.new(0, appearX, yPos.Scale, yPos.Offset)
									overflowIcon:setEnabled(true)
								end
								if #endIcon.dropdownIcons > 0 then
									endIcon._overflowConvertedToMenu = true
									local wasSelected = endIcon.isSelected
									endIcon:deselect()
									local iconsToConvert = {}
									for _, dIcon in pairs(endIcon.dropdownIcons) do
										table.insert(iconsToConvert, dIcon)
									end
									for _, dIcon in pairs(endIcon.dropdownIcons) do
										dIcon:leave()
									end
									endIcon:setMenu(iconsToConvert)
									if wasSelected and overflowIcon.isSelected then
										endIcon:select()
									end
								end
								endIcon:join(overflowIcon, "dropdown")
								if #endIcon.menuIcons > 0 and endIcon.menuOpen then
									endIcon:deselect()
									endIcon:select()
									overflowIcon:select()
								end
							end
							break
						end
					end
				
				else
					
					-- This checks to see if the lowest/highest (depending on left/right) ordered overlapping icon is no longer overlapping, removes from the dropdown, and repeats if valid
					local winningOrder, winningOverlappedIcon
					local totalOverlappingIcons = #overflowIcon.dropdownIcons
					if not (oppositeOverflowIcon.enabled and #alignmentInfo.records == 1 and #oppositeAlignmentInfo.records ~= 1) then
						for _, overlappedIcon in pairs(overflowIcon.dropdownIcons) do
							local iconOrder = overlappedIcon:get("order")
							if winningOverlappedIcon == nil or (alignment == "left" and iconOrder < winningOrder) or (alignment == "right" and iconOrder > winningOrder) then
								winningOrder = iconOrder
								winningOverlappedIcon = overlappedIcon
							end
						end
					end
					if winningOverlappedIcon then
						local sizeX = getSizeX(winningOverlappedIcon, true)
						local myForesightBoundaryX = getBoundaryX(overflowIcon, oppositeAlignment)
						if totalOverlappingIcons == 1 then
							myForesightBoundaryX = getBoundaryX(overflowIcon, alignment, alignmentGap-START_LEEWAY)
						end
						local availableGap = math.abs(closestBoundaryX - myForesightBoundaryX) - (alignmentGap*2)
						local noLongerExeeds = (sizeX < availableGap)
						if noLongerExeeds then
							if #overflowIcon.dropdownIcons == 1 then
								overflowIcon:setEnabled(false)
							end
							local overflowContainer = overflowIcon.instances.iconContainer
							local yPos = overflowContainer.Position.Y
							overflowContainer.Position = UDim2.new(0, myForesightBoundaryX, yPos.Scale, yPos.Offset)
							winningOverlappedIcon:leave()
							--
							if winningOverlappedIcon._overflowConvertedToMenu then
								winningOverlappedIcon._overflowConvertedToMenu = nil
								local iconsToConvert = {}
								for _, dIcon in pairs(winningOverlappedIcon.menuIcons) do
									table.insert(iconsToConvert, dIcon)
								end
								for _, dIcon in pairs(winningOverlappedIcon.menuIcons) do
									dIcon:leave()
								end
								winningOverlappedIcon:setDropdown(iconsToConvert)
							end
							--
						end
					end

				end
			end
		end
		--------
		return true
	end)()
end

function IconController.setTopbarEnabled(bool, forceBool)
	if forceBool == nil then
		forceBool = true
	end
	local indicator = TopbarPlusGui.Indicator
	if forceBool and not bool then
		forceTopbarDisabled = true
	elseif forceBool and bool then
		forceTopbarDisabled = false
	end
	if IconController.controllerModeEnabled then
		if bool then
			if TopbarPlusGui.TopbarContainer.Visible or forceTopbarDisabled or menuOpen or not checkTopbarEnabled() then return end
			if forceBool then
				indicator.Visible = checkTopbarEnabled()
			else
				if hapticService:IsVibrationSupported(Enum.UserInputType.Gamepad1) and hapticService:IsMotorSupported(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small) then
					hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,1)
					delay(0.2,function()
						pcall(function()
							hapticService:SetMotor(Enum.UserInputType.Gamepad1,Enum.VibrationMotor.Small,0)
						end)
					end)
				end
				TopbarPlusGui.TopbarContainer.Visible = true
				TopbarPlusGui.TopbarContainer:TweenPosition(
					UDim2.new(0,0,0,5 + STUPID_CONTROLLER_OFFSET),
					Enum.EasingDirection.Out,
					Enum.EasingStyle.Quad,
					0.1,
					true
				)
				
				
				local selectIcon
				local targetOffset = 0
				IconController:_updateSelectionGroup()
				runService.Heartbeat:Wait()
				local indicatorSizeTrip = 50 --indicator.AbsoluteSize.Y * 2
				for otherIcon, _ in pairs(topbarIcons) do
					if IconController.canShowIconOnTopbar(otherIcon) and (selectIcon == nil or otherIcon:get("order") > selectIcon:get("order")) then
						selectIcon = otherIcon
					end
					local container = otherIcon.instances.iconContainer
					local newTargetOffset = -27 + container.AbsoluteSize.Y + indicatorSizeTrip
					if newTargetOffset > targetOffset then
						targetOffset = newTargetOffset
					end
				end
				if guiService:GetEmotesMenuOpen() then
					guiService:SetEmotesMenuOpen(false)
				end
				if guiService:GetInspectMenuEnabled() then
					guiService:CloseInspectMenu()
				end
				local newSelectedObject = IconController._previousSelectedObject or selectIcon.instances.iconButton
				IconController._setControllerSelectedObject(newSelectedObject)
				indicator.Image = "rbxassetid://5278151071"
				indicator:TweenPosition(
					UDim2.new(0.5,0,0,targetOffset + STUPID_CONTROLLER_OFFSET),
					Enum.EasingDirection.Out,
					Enum.EasingStyle.Quad,
					0.1,
					true
				)
			end
		else
			if forceBool then
				indicator.Visible = false
			else
				indicator.Visible = checkTopbarEnabled()
			end
			if not TopbarPlusGui.TopbarContainer.Visible then return end
			guiService.AutoSelectGuiEnabled = true
			IconController:_updateSelectionGroup(true)
			TopbarPlusGui.TopbarContainer:TweenPosition(
				UDim2.new(0,0,0,-TopbarPlusGui.TopbarContainer.Size.Y.Offset + STUPID_CONTROLLER_OFFSET),
				Enum.EasingDirection.Out,
				Enum.EasingStyle.Quad,
				0.1,
				true,
				function()
					TopbarPlusGui.TopbarContainer.Visible = false
				end
			)
			indicator.Image = "rbxassetid://5278151556"
			indicator:TweenPosition(
				UDim2.new(0.5,0,0,5),
				Enum.EasingDirection.Out,
				Enum.EasingStyle.Quad,
				0.1,
				true
			)
		end
	else
		local topbarContainer = TopbarPlusGui.TopbarContainer
		if checkTopbarEnabled() then
			topbarContainer.Visible = bool
		else
			topbarContainer.Visible = false
		end
	end
end

function IconController.setGap(value, alignment)
	local newValue = tonumber(value) or 12
	local newAlignment = tostring(alignment):lower()
	if newAlignment == "left" or newAlignment == "mid" or newAlignment == "right" then
		IconController[newAlignment.."Gap"] = newValue
		return
	end
	IconController.leftGap = newValue
	IconController.midGap = newValue
	IconController.rightGap = newValue
	IconController.updateTopbar()
end


