function Icon.new()local X={}setmetatable(X,Icon)local F=Maid.new()X._maid=F X._hoveringMaid=F:give(Maid.new())X._dropdownClippingMaid=F:give(Maid.new())X._menuClippingMaid=F:give(Maid.new())local e={}X.instances=e local D=F:give(iconTemplate:Clone())D.Visible=true D.Parent=topbarContainer e.iconContainer=D e.iconButton=D.IconButton e.iconImage=e.iconButton.IconImage e.iconLabel=e.iconButton.IconLabel e.iconGradient=e.iconButton.IconGradient e.iconCorner=e.iconButton.IconCorner e.iconOverlay=D.IconOverlay e.iconOverlayCorner=e.iconOverlay.IconOverlayCorner e.noticeFrame=e.iconButton.NoticeFrame e.noticeLabel=e.noticeFrame.NoticeLabel e.captionContainer=D.CaptionContainer e.captionFrame=e.captionContainer.CaptionFrame e.captionLabel=e.captionContainer.CaptionLabel e.captionCorner=e.captionFrame.CaptionCorner e.captionOverlineContainer=e.captionContainer.CaptionOverlineContainer e.captionOverline=e.captionOverlineContainer.CaptionOverline e.captionOverlineCorner=e.captionOverline.CaptionOverlineCorner e.captionVisibilityBlocker=e.captionFrame.CaptionVisibilityBlocker e.captionVisibilityCorner=e.captionVisibilityBlocker.CaptionVisibilityCorner e.tipFrame=D.TipFrame e.tipLabel=e.tipFrame.TipLabel e.tipCorner=e.tipFrame.TipCorner e.dropdownContainer=D.DropdownContainer e.dropdownFrame=e.dropdownContainer.DropdownFrame e.dropdownList=e.dropdownFrame.DropdownList e.menuContainer=D.MenuContainer e.menuFrame=e.menuContainer.MenuFrame e.menuList=e.menuFrame.MenuList e.clickSound=D.ClickSound X._settings={action={toggleTransitionInfo={},resizeInfo={},repositionInfo={};captionFadeInfo={},tipFadeInfo={};dropdownSlideInfo={},menuSlideInfo={}};toggleable={iconBackgroundColor={instanceNames={"\105\099\111\110\066\117\116\116\111\110"},propertyName="\066\097\099\107\103\114\111\117\110\100\067\111\108\111\114\051"};iconBackgroundTransparency={instanceNames={"\105\099\111\110\066\117\116\116\111\110"};propertyName="\066\097\099\107\103\114\111\117\110\100\084\114\097\110\115\112\097\114\101\110\099\121"},iconCornerRadius={instanceNames={"\105\099\111\110\067\111\114\110\101\114","\105\099\111\110\079\118\101\114\108\097\121\067\111\114\110\101\114"};propertyName="\067\111\114\110\101\114\082\097\100\105\117\115"},iconGradientColor={instanceNames={"\105\099\111\110\071\114\097\100\105\101\110\116"};propertyName="\067\111\108\111\114"},iconGradientRotation={instanceNames={"\105\099\111\110\071\114\097\100\105\101\110\116"};propertyName="\082\111\116\097\116\105\111\110"};iconImage={callMethods={X._updateIconSize};instanceNames={"\105\099\111\110\073\109\097\103\101"},propertyName="\073\109\097\103\101"};iconImageColor={instanceNames={"\105\099\111\110\073\109\097\103\101"};propertyName="\073\109\097\103\101\067\111\108\111\114\051"};iconImageTransparency={instanceNames={"\105\099\111\110\073\109\097\103\101"};propertyName="\073\109\097\103\101\084\114\097\110\115\112\097\114\101\110\099\121"};iconScale={instanceNames={"\105\099\111\110\066\117\116\116\111\110"};propertyName="\083\105\122\101"};forcedIconSize={},iconSize={callSignals={X.updated},callMethods={X._updateIconSize};instanceNames={"\105\099\111\110\067\111\110\116\097\105\110\101\114"},propertyName="\083\105\122\101";tweenAction="\114\101\115\105\122\101\073\110\102\111"},iconOffset={instanceNames={"\105\099\111\110\066\117\116\116\111\110"};propertyName="\080\111\115\105\116\105\111\110"},iconText={callMethods={X._updateIconSize};instanceNames={"\105\099\111\110\076\097\098\101\108"},propertyName="\084\101\120\116"};iconTextColor={instanceNames={"\105\099\111\110\076\097\098\101\108"},propertyName="\084\101\120\116\067\111\108\111\114\051"};iconFont={instanceNames={"\105\099\111\110\076\097\098\101\108"};propertyName="\070\111\110\116"};iconImageYScale={callMethods={X._updateIconSize}},iconImageRatio={callMethods={X._updateIconSize}},iconLabelYScale={callMethods={X._updateIconSize}};noticeCircleColor={instanceNames={"\110\111\116\105\099\101\070\114\097\109\101"};propertyName="\073\109\097\103\101\067\111\108\111\114\051"};noticeCircleImage={instanceNames={"\110\111\116\105\099\101\070\114\097\109\101"};propertyName="\073\109\097\103\101"};noticeTextColor={instanceNames={"\110\111\116\105\099\101\076\097\098\101\108"};propertyName="\084\101\120\116\067\111\108\111\114\051"},noticeImageTransparency={instanceNames={"\110\111\116\105\099\101\070\114\097\109\101"},propertyName="\073\109\097\103\101\084\114\097\110\115\112\097\114\101\110\099\121"},noticeTextTransparency={instanceNames={"\110\111\116\105\099\101\076\097\098\101\108"};propertyName="\084\101\120\116\084\114\097\110\115\112\097\114\101\110\099\121"},baseZIndex={callMethods={X._updateBaseZIndex}},order={callSignals={X.updated};instanceNames={"\105\099\111\110\067\111\110\116\097\105\110\101\114"},propertyName="\076\097\121\111\117\116\079\114\100\101\114"},alignment={callSignals={X.updated},callMethods={X._updateDropdown}};iconImageVisible={instanceNames={"\105\099\111\110\073\109\097\103\101"};propertyName="\086\105\115\105\098\108\101"};iconImageAnchorPoint={instanceNames={"\105\099\111\110\073\109\097\103\101"};propertyName="\065\110\099\104\111\114\080\111\105\110\116"};iconImagePosition={instanceNames={"\105\099\111\110\073\109\097\103\101"},propertyName="\080\111\115\105\116\105\111\110",tweenAction="\114\101\115\105\122\101\073\110\102\111"};iconImageSize={instanceNames={"\105\099\111\110\073\109\097\103\101"};propertyName="\083\105\122\101";tweenAction="\114\101\115\105\122\101\073\110\102\111"},iconImageTextXAlignment={instanceNames={"\105\099\111\110\073\109\097\103\101"},propertyName="\084\101\120\116\088\065\108\105\103\110\109\101\110\116"},iconLabelVisible={instanceNames={"\105\099\111\110\076\097\098\101\108"};propertyName="\086\105\115\105\098\108\101"},iconLabelAnchorPoint={instanceNames={"\105\099\111\110\076\097\098\101\108"},propertyName="\065\110\099\104\111\114\080\111\105\110\116"},iconLabelPosition={instanceNames={"\105\099\111\110\076\097\098\101\108"},propertyName="\080\111\115\105\116\105\111\110",tweenAction="\114\101\115\105\122\101\073\110\102\111"};iconLabelSize={instanceNames={"\105\099\111\110\076\097\098\101\108"};propertyName="\083\105\122\101";tweenAction="\114\101\115\105\122\101\073\110\102\111"};iconLabelTextXAlignment={instanceNames={"\105\099\111\110\076\097\098\101\108"},propertyName="\084\101\120\116\088\065\108\105\103\110\109\101\110\116"},iconLabelTextSize={instanceNames={"\105\099\111\110\076\097\098\101\108"};propertyName="\084\101\120\116\083\105\122\101"};noticeFramePosition={instanceNames={"\110\111\116\105\099\101\070\114\097\109\101"},propertyName="\080\111\115\105\116\105\111\110"};clickSoundId={instanceNames={"\099\108\105\099\107\083\111\117\110\100"};propertyName="\083\111\117\110\100\073\100"};clickVolume={instanceNames={"\099\108\105\099\107\083\111\117\110\100"};propertyName="\086\111\108\117\109\101"},clickPlaybackSpeed={instanceNames={"\099\108\105\099\107\083\111\117\110\100"},propertyName="\080\108\097\121\098\097\099\107\083\112\101\101\100"},clickTimePosition={instanceNames={"\099\108\105\099\107\083\111\117\110\100"},propertyName="\084\105\109\101\080\111\115\105\116\105\111\110"};iconRectOffset={instanceNames={"\105\099\111\110\073\109\097\103\101"},propertyName="\073\109\097\103\101\082\101\099\116\079\102\102\115\101\116"};iconRectSize={instanceNames={"\105\099\111\110\073\109\097\103\101"},propertyName="\073\109\097\103\101\082\101\099\116\083\105\122\101"}},other={captionBackgroundColor={instanceNames={"\099\097\112\116\105\111\110\070\114\097\109\101"},propertyName="\066\097\099\107\103\114\111\117\110\100\067\111\108\111\114\051"},captionBackgroundTransparency={instanceNames={"\099\097\112\116\105\111\110\070\114\097\109\101"},propertyName="\066\097\099\107\103\114\111\117\110\100\084\114\097\110\115\112\097\114\101\110\099\121",group="\099\097\112\116\105\111\110"},captionBlockerTransparency={instanceNames={"\099\097\112\116\105\111\110\086\105\115\105\098\105\108\105\116\121\066\108\111\099\107\101\114"},propertyName="\066\097\099\107\103\114\111\117\110\100\084\114\097\110\115\112\097\114\101\110\099\121",group="\099\097\112\116\105\111\110"},captionOverlineColor={instanceNames={"\099\097\112\116\105\111\110\079\118\101\114\108\105\110\101"},propertyName="\066\097\099\107\103\114\111\117\110\100\067\111\108\111\114\051"};captionOverlineTransparency={instanceNames={"\099\097\112\116\105\111\110\079\118\101\114\108\105\110\101"},propertyName="\066\097\099\107\103\114\111\117\110\100\084\114\097\110\115\112\097\114\101\110\099\121",group="\099\097\112\116\105\111\110"};captionTextColor={instanceNames={"\099\097\112\116\105\111\110\076\097\098\101\108"};propertyName="\084\101\120\116\067\111\108\111\114\051"};captionTextTransparency={instanceNames={"\099\097\112\116\105\111\110\076\097\098\101\108"};propertyName="\084\101\120\116\084\114\097\110\115\112\097\114\101\110\099\121",group="\099\097\112\116\105\111\110"},captionFont={instanceNames={"\099\097\112\116\105\111\110\076\097\098\101\108"},propertyName="\070\111\110\116"},captionCornerRadius={instanceNames={"\099\097\112\116\105\111\110\067\111\114\110\101\114";"\099\097\112\116\105\111\110\079\118\101\114\108\105\110\101\067\111\114\110\101\114","\099\097\112\116\105\111\110\086\105\115\105\098\105\108\105\116\121\067\111\114\110\101\114"};propertyName="\067\111\114\110\101\114\082\097\100\105\117\115"},tipBackgroundColor={instanceNames={"\116\105\112\070\114\097\109\101"},propertyName="\066\097\099\107\103\114\111\117\110\100\067\111\108\111\114\051"},tipBackgroundTransparency={instanceNames={"\116\105\112\070\114\097\109\101"};propertyName="\066\097\099\107\103\114\111\117\110\100\084\114\097\110\115\112\097\114\101\110\099\121",group="\116\105\112"};tipTextColor={instanceNames={"\116\105\112\076\097\098\101\108"};propertyName="\084\101\120\116\067\111\108\111\114\051"};tipTextTransparency={instanceNames={"\116\105\112\076\097\098\101\108"},propertyName="\084\101\120\116\084\114\097\110\115\112\097\114\101\110\099\121",group="\116\105\112"};tipFont={instanceNames={"\116\105\112\076\097\098\101\108"};propertyName="\070\111\110\116"};tipCornerRadius={instanceNames={"\116\105\112\067\111\114\110\101\114"},propertyName="\067\111\114\110\101\114\082\097\100\105\117\115"},dropdownSize={instanceNames={"\100\114\111\112\100\111\119\110\067\111\110\116\097\105\110\101\114"},propertyName="\083\105\122\101";unique="\100\114\111\112\100\111\119\110"};dropdownCanvasSize={instanceNames={"\100\114\111\112\100\111\119\110\070\114\097\109\101"},propertyName="\067\097\110\118\097\115\083\105\122\101"},dropdownMaxIconsBeforeScroll={callMethods={X._updateDropdown}},dropdownMinWidth={callMethods={X._updateDropdown}},dropdownSquareCorners={callMethods={X._updateDropdown}};dropdownBindToggleToIcon={};dropdownToggleOnLongPress={},dropdownToggleOnRightClick={},dropdownCloseOnTapAway={};dropdownHidePlayerlistOnOverlap={},dropdownListPadding={callMethods={X._updateDropdown},instanceNames={"\100\114\111\112\100\111\119\110\076\105\115\116"},propertyName="\080\097\100\100\105\110\103"},dropdownAlignment={callMethods={X._updateDropdown}},dropdownScrollBarColor={instanceNames={"\100\114\111\112\100\111\119\110\070\114\097\109\101"};propertyName="\083\099\114\111\108\108\066\097\114\073\109\097\103\101\067\111\108\111\114\051"};dropdownScrollBarTransparency={instanceNames={"\100\114\111\112\100\111\119\110\070\114\097\109\101"};propertyName="\083\099\114\111\108\108\066\097\114\073\109\097\103\101\084\114\097\110\115\112\097\114\101\110\099\121"};dropdownScrollBarThickness={instanceNames={"\100\114\111\112\100\111\119\110\070\114\097\109\101"};propertyName="\083\099\114\111\108\108\066\097\114\084\104\105\099\107\110\101\115\115"};dropdownIgnoreClipping={callMethods={X._dropdownIgnoreClipping}},menuSize={instanceNames={"\109\101\110\117\067\111\110\116\097\105\110\101\114"};propertyName="\083\105\122\101";unique="\109\101\110\117"},menuCanvasSize={instanceNames={"\109\101\110\117\070\114\097\109\101"},propertyName="\067\097\110\118\097\115\083\105\122\101"},menuMaxIconsBeforeScroll={callMethods={X._updateMenu}};menuBindToggleToIcon={},menuToggleOnLongPress={},menuToggleOnRightClick={},menuCloseOnTapAway={},menuListPadding={callMethods={X._updateMenu},instanceNames={"\109\101\110\117\076\105\115\116"};propertyName="\080\097\100\100\105\110\103"},menuDirection={callMethods={X._updateMenu}},menuScrollBarColor={instanceNames={"\109\101\110\117\070\114\097\109\101"};propertyName="\083\099\114\111\108\108\066\097\114\073\109\097\103\101\067\111\108\111\114\051"},menuScrollBarTransparency={instanceNames={"\109\101\110\117\070\114\097\109\101"};propertyName="\083\099\114\111\108\108\066\097\114\073\109\097\103\101\084\114\097\110\115\112\097\114\101\110\099\121"};menuScrollBarThickness={instanceNames={"\109\101\110\117\070\114\097\109\101"};propertyName="\083\099\114\111\108\108\066\097\114\084\104\105\099\107\110\101\115\115"};menuIgnoreClipping={callMethods={X._menuIgnoreClipping}}}}X._groupSettings={}for F,e in pairs(X._settings)do for F,e in pairs(e)do local D=e.group if D then local j=X._groupSettings[D]if not j then j={}X._groupSettings[D]=j end table.insert(j,F)e.forcedGroupValue=DEFAULT_FORCED_GROUP_VALUES[D]e.useForcedGroupValue=true end end end X._settingsDictionary={}X._uniqueSettings={}X._uniqueSettingsDictionary={}X.uniqueValues={}local j={dropdown=function(F,e,D,j)local w=X:get("\100\114\111\112\100\111\119\110\083\108\105\100\101\073\110\102\111")local A=X:get("\100\114\111\112\100\111\119\110\066\105\110\100\084\111\103\103\108\101\084\111\073\099\111\110")local E=X:get("\100\114\111\112\100\111\119\110\072\105\100\101\080\108\097\121\101\114\108\105\115\116\079\110\079\118\101\114\108\097\112")==true and X:get("\097\108\105\103\110\109\101\110\116")=="\114\105\103\104\116"local R=X.instances.dropdownContainer local Z=X.instances.dropdownFrame local H=j local a=true local q=not X.isSelected if A==false then q=not X.dropdownOpen end local n=X._longPressing or X._rightClicking if X._tappingAway or q and not n or n and X.dropdownOpen then local F=X:get("\100\114\111\112\100\111\119\110\083\105\122\101")local e=F and F.X.Offset/1 or 0 H=UDim2.new(0,e,0,0)a=false end if#X.dropdownIcons>0 and(a and E)then if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)then starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false)end IconController._bringBackPlayerlist=IconController._bringBackPlayerlist and IconController._bringBackPlayerlist+1 or 1 X._bringBackPlayerlist=true elseif X._bringBackPlayerlist and(not a and IconController._bringBackPlayerlist)then IconController._bringBackPlayerlist-=1 if IconController._bringBackPlayerlist<=0 then IconController._bringBackPlayerlist=nil starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,true)end X._bringBackPlayerlist=nil end local t=tweenService:Create(e,w,{[D]=H})local U U=t.Completed:Connect(function()U:Disconnect()end)t:Play()if a then Z.CanvasPosition=X._dropdownCanvasPos else X._dropdownCanvasPos=Z.CanvasPosition end X.dropdownOpen=a X:_decideToCallSignal("\100\114\111\112\100\111\119\110")end;menu=function(F,e,D,j)local w=X:get("\109\101\110\117\083\108\105\100\101\073\110\102\111")local A=X:get("\109\101\110\117\066\105\110\100\084\111\103\103\108\101\084\111\073\099\111\110")local E=X.instances.menuContainer local R=X.instances.menuFrame local Z=j local H=true local a=not X.isSelected if A==false then a=not X.menuOpen end local q=X._longPressing or X._rightClicking if X._tappingAway or a and not q or q and X.menuOpen then local F=X:get("\109\101\110\117\083\105\122\101")local e=F and F.Y.Offset/1 or 0 Z=UDim2.new(0,0,0,e)H=false end if H~=X.menuOpen then X.updated:Fire()end if H and w.EasingDirection==Enum.EasingDirection.Out then w=TweenInfo.new(w.Time,w.EasingStyle,Enum.EasingDirection.In)end local n=tweenService:Create(e,w,{[D]=Z})local t t=n.Completed:Connect(function()t:Disconnect()end)n:Play()if H then if X._menuCanvasPos then R.CanvasPosition=X._menuCanvasPos end else X._menuCanvasPos=R.CanvasPosition end X.menuOpen=H X:_decideToCallSignal("\109\101\110\117")end}for F,e in pairs(X._settings)do for e,D in pairs(e)do if F=="\116\111\103\103\108\101\097\098\108\101"then D.values=D.values or{deselected=nil;selected=nil}else D.value=nil end D.additionalValues={}D.type=F X._settingsDictionary[e]=D local w=D.unique if w then local F=X._uniqueSettings[w]or{}table.insert(F,e)X._uniqueSettings[w]=F X._uniqueSettingsDictionary[e]=j[w]end end end X.updated=F:give(Signal.new())X.selected=F:give(Signal.new())X.deselected=F:give(Signal.new())X.toggled=F:give(Signal.new())X.hoverStarted=F:give(Signal.new())X.hoverEnded=F:give(Signal.new())X.dropdownOpened=F:give(Signal.new())X.dropdownClosed=F:give(Signal.new())X.menuOpened=F:give(Signal.new())X.menuClosed=F:give(Signal.new())X.notified=F:give(Signal.new())X._endNotices=F:give(Signal.new())X._ignoreClippingChanged=F:give(Signal.new())local function w(F,e)local D=X._parentIcon X:set(F.."\073\103\110\111\114\101\067\108\105\112\112\105\110\103",e)if e==true and D then local e=D._ignoreClippingChanged:Connect(function(e,D)X:set(F.."\073\103\110\111\114\101\067\108\105\112\112\105\110\103",D)end)local j j=X[F.."\067\108\111\115\101\100"]:Connect(function()j:Disconnect()e:Disconnect()end)end end X.dropdownOpened:Connect(function()w("\100\114\111\112\100\111\119\110",true)end)X.dropdownClosed:Connect(function()w("\100\114\111\112\100\111\119\110",false)end)X.menuOpened:Connect(function()w("\109\101\110\117",true)end)X.menuClosed:Connect(function()w("\109\101\110\117",false)end)X.deselectWhenOtherIconSelected=true X.name=""X.isSelected=false X.presentOnTopbar=true X.accountForWhenDisabled=false X.enabled=true X.hovering=false X.tipText=nil X.captionText=nil X.totalNotices=0 X.notices={}X.dropdownIcons={}X.menuIcons={}X.dropdownOpen=false X.menuOpen=false X.locked=false X.topPadding=UDim.new(0,4)X.targetPosition=nil X.toggleItems={}X.lockedSettings={}X._draggingFinger=false X._updatingIconSize=true X._previousDropdownOpen=false X._previousMenuOpen=false X._bindedToggleKeys={}X._bindedEvents={}X:setName("\085\110\110\097\109\101\100\073\099\111\110")X:setTheme(DEFAULT_THEME,true)e.iconButton.MouseButton1Click:Connect(function()if X._draggingFinger then return false elseif X.isSelected then X:deselect()return true end X:select()end)e.iconButton.MouseButton2Click:Connect(function()X._rightClicking=true if X:get("\100\114\111\112\100\111\119\110\084\111\103\103\108\101\079\110\082\105\103\104\116\067\108\105\099\107")==true then X:_update("\100\114\111\112\100\111\119\110\083\105\122\101")end if X:get("\109\101\110\117\084\111\103\103\108\101\079\110\082\105\103\104\116\067\108\105\099\107")==true then X:_update("\109\101\110\117\083\105\122\101")end X._rightClicking=false end)e.iconButton.MouseButton1Down:Connect(function()if X.locked then return end X:_updateStateOverlay(.7,Color3.new(0,0,0))end)e.iconButton.MouseButton1Up:Connect(function()if X.locked then return end X:_updateStateOverlay(.9,Color3.new(1,1,1))end)userInputService.InputBegan:Connect(function(F,e)local D={[Enum.UserInputType.MouseButton1]=true,[Enum.UserInputType.MouseButton2]=true,[Enum.UserInputType.MouseButton3]=true;[Enum.UserInputType.Touch]=true}if not e and D[F.UserInputType]then X._tappingAway=true if X.dropdownOpen and X:get("\100\114\111\112\100\111\119\110\067\108\111\115\101\079\110\084\097\112\065\119\097\121")==true then X:_update("\100\114\111\112\100\111\119\110\083\105\122\101")end if X.menuOpen and X:get("\109\101\110\117\067\108\111\115\101\079\110\084\097\112\065\119\097\121")==true then X:_update("\109\101\110\117\083\105\122\101")end X._tappingAway=false end if X._bindedToggleKeys[F.KeyCode]and not e then if X.isSelected then X:deselect()else X:select()end end end)X.hoverStarted:Connect(function(F,e)X.hovering=true if not X.locked then X:_updateStateOverlay(.9,Color3.fromRGB(255,255,255))end X:_updateHovering()end)X.hoverEnded:Connect(function()X.hovering=false X:_updateStateOverlay(1)X._hoveringMaid:clean()X:_updateHovering()end)e.iconButton.MouseEnter:Connect(function(F,e)X.hoverStarted:Fire(F,e)end)e.iconButton.MouseLeave:Connect(function()X.hoverEnded:Fire()end)e.iconButton.SelectionGained:Connect(function()X.hoverStarted:Fire()end)e.iconButton.SelectionLost:Connect(function()X.hoverEnded:Fire()end)e.iconButton.MouseButton1Down:Connect(function()if X._draggingFinger then X.hoverStarted:Fire()end local F local D local j=.7 local w=tick()+j F=runService.Heartbeat:Connect(function()if tick()>=w then D:Disconnect()F:Disconnect()X._longPressing=true if X:get("\100\114\111\112\100\111\119\110\084\111\103\103\108\101\079\110\076\111\110\103\080\114\101\115\115")==true then X:_update("\100\114\111\112\100\111\119\110\083\105\122\101")end if X:get("\109\101\110\117\084\111\103\103\108\101\079\110\076\111\110\103\080\114\101\115\115")==true then X:_update("\109\101\110\117\083\105\122\101")end X._longPressing=false end end)D=e.iconButton.MouseButton1Up:Connect(function()D:Disconnect()F:Disconnect()end)end)if userInputService.TouchEnabled then e.iconButton.MouseButton1Up:Connect(function()if X.hovering then X.hoverEnded:Fire()end end)local F=0 userInputService.TouchMoved:Connect(function(F,e)if e then return end X._draggingFinger=true end)userInputService.TouchEnded:Connect(function()X._draggingFinger=false end)end X._updatingIconSize=false X:_updateIconSize()IconController.iconAdded:Fire(X)return X end

function Icon.new()
	local self = {}
	setmetatable(self, Icon)

	-- Maids (for autocleanup)
	local maid = Maid.new()
	self._maid = maid
	self._hoveringMaid = maid:give(Maid.new())
	self._dropdownClippingMaid = maid:give(Maid.new())
	self._menuClippingMaid = maid:give(Maid.new())

	-- These are the GuiObjects that make up the icon
	local instances = {}
	self.instances = instances
	local iconContainer = maid:give(iconTemplate:Clone())
	iconContainer.Visible = true
	iconContainer.Parent = topbarContainer
	instances["iconContainer"] = iconContainer
	instances["iconButton"] = iconContainer.IconButton
	instances["iconImage"] = instances.iconButton.IconImage
	instances["iconLabel"] = instances.iconButton.IconLabel
	instances["iconGradient"] = instances.iconButton.IconGradient
	instances["iconCorner"] = instances.iconButton.IconCorner
	instances["iconOverlay"] = iconContainer.IconOverlay
	instances["iconOverlayCorner"] = instances.iconOverlay.IconOverlayCorner
	instances["noticeFrame"] = instances.iconButton.NoticeFrame
	instances["noticeLabel"] = instances.noticeFrame.NoticeLabel
	instances["captionContainer"] = iconContainer.CaptionContainer
	instances["captionFrame"] = instances.captionContainer.CaptionFrame
	instances["captionLabel"] = instances.captionContainer.CaptionLabel
	instances["captionCorner"] = instances.captionFrame.CaptionCorner
	instances["captionOverlineContainer"] = instances.captionContainer.CaptionOverlineContainer
	instances["captionOverline"] = instances.captionOverlineContainer.CaptionOverline
	instances["captionOverlineCorner"] = instances.captionOverline.CaptionOverlineCorner
	instances["captionVisibilityBlocker"] = instances.captionFrame.CaptionVisibilityBlocker
	instances["captionVisibilityCorner"] = instances.captionVisibilityBlocker.CaptionVisibilityCorner
	instances["tipFrame"] = iconContainer.TipFrame
	instances["tipLabel"] = instances.tipFrame.TipLabel
	instances["tipCorner"] = instances.tipFrame.TipCorner
	instances["dropdownContainer"] = iconContainer.DropdownContainer
	instances["dropdownFrame"] = instances.dropdownContainer.DropdownFrame
	instances["dropdownList"] = instances.dropdownFrame.DropdownList
	instances["menuContainer"] = iconContainer.MenuContainer
	instances["menuFrame"] = instances.menuContainer.MenuFrame
	instances["menuList"] = instances.menuFrame.MenuList
	instances["clickSound"] = iconContainer.ClickSound

	-- These determine and describe how instances behave and appear
	self._settings = {
		action = {
			["toggleTransitionInfo"] = {},
			["resizeInfo"] = {},
			["repositionInfo"] = {},
			["captionFadeInfo"] = {},
			["tipFadeInfo"] = {},
			["dropdownSlideInfo"] = {},
			["menuSlideInfo"] = {},
		},
		toggleable = {
			["iconBackgroundColor"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundColor3"},
			["iconBackgroundTransparency"] = {instanceNames = {"iconButton"}, propertyName = "BackgroundTransparency"},
			["iconCornerRadius"] = {instanceNames = {"iconCorner", "iconOverlayCorner"}, propertyName = "CornerRadius"},
			["iconGradientColor"] = {instanceNames = {"iconGradient"}, propertyName = "Color"},
			["iconGradientRotation"] = {instanceNames = {"iconGradient"}, propertyName = "Rotation"},
			["iconImage"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconImage"}, propertyName = "Image"},
			["iconImageColor"] = {instanceNames = {"iconImage"}, propertyName = "ImageColor3"},
			["iconImageTransparency"] = {instanceNames = {"iconImage"}, propertyName = "ImageTransparency"},
			["iconScale"] = {instanceNames = {"iconButton"}, propertyName = "Size"},
			["forcedIconSize"] = {},
			["iconSize"] = {callSignals = {self.updated}, callMethods = {self._updateIconSize}, instanceNames = {"iconContainer"}, propertyName = "Size", tweenAction = "resizeInfo"},
			["iconOffset"] = {instanceNames = {"iconButton"}, propertyName = "Position"},
			["iconText"] = {callMethods = {self._updateIconSize}, instanceNames = {"iconLabel"}, propertyName = "Text"},
			["iconTextColor"] = {instanceNames = {"iconLabel"}, propertyName = "TextColor3"},
			["iconFont"] = {instanceNames = {"iconLabel"}, propertyName = "Font"},
			["iconImageYScale"] = {callMethods = {self._updateIconSize}},
			["iconImageRatio"] = {callMethods = {self._updateIconSize}},
			["iconLabelYScale"] = {callMethods = {self._updateIconSize}},
			["noticeCircleColor"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageColor3"},
			["noticeCircleImage"] = {instanceNames = {"noticeFrame"}, propertyName = "Image"},
			["noticeTextColor"] = {instanceNames = {"noticeLabel"}, propertyName = "TextColor3"},
			["noticeImageTransparency"] = {instanceNames = {"noticeFrame"}, propertyName = "ImageTransparency"},
			["noticeTextTransparency"] = {instanceNames = {"noticeLabel"}, propertyName = "TextTransparency"},
			["baseZIndex"] = {callMethods = {self._updateBaseZIndex}},
			["order"] = {callSignals = {self.updated}, instanceNames = {"iconContainer"}, propertyName = "LayoutOrder"},
			["alignment"] = {callSignals = {self.updated}, callMethods = {self._updateDropdown}},
			["iconImageVisible"] = {instanceNames = {"iconImage"}, propertyName = "Visible"},
			["iconImageAnchorPoint"] = {instanceNames = {"iconImage"}, propertyName = "AnchorPoint"},
			["iconImagePosition"] = {instanceNames = {"iconImage"}, propertyName = "Position", tweenAction = "resizeInfo"},
			["iconImageSize"] = {instanceNames = {"iconImage"}, propertyName = "Size", tweenAction = "resizeInfo"},
			["iconImageTextXAlignment"] = {instanceNames = {"iconImage"}, propertyName = "TextXAlignment"},
			["iconLabelVisible"] = {instanceNames = {"iconLabel"}, propertyName = "Visible"},
			["iconLabelAnchorPoint"] = {instanceNames = {"iconLabel"}, propertyName = "AnchorPoint"},
			["iconLabelPosition"] = {instanceNames = {"iconLabel"}, propertyName = "Position", tweenAction = "resizeInfo"},
			["iconLabelSize"] = {instanceNames = {"iconLabel"}, propertyName = "Size", tweenAction = "resizeInfo"},
			["iconLabelTextXAlignment"] = {instanceNames = {"iconLabel"}, propertyName = "TextXAlignment"},
			["iconLabelTextSize"] = {instanceNames = {"iconLabel"}, propertyName = "TextSize"},
			["noticeFramePosition"] = {instanceNames = {"noticeFrame"}, propertyName = "Position"},
			["clickSoundId"] = {instanceNames = {"clickSound"}, propertyName = "SoundId"},
			["clickVolume"] = {instanceNames = {"clickSound"}, propertyName = "Volume"},
			["clickPlaybackSpeed"] = {instanceNames = {"clickSound"}, propertyName = "PlaybackSpeed"},
			["clickTimePosition"] = {instanceNames = {"clickSound"}, propertyName = "TimePosition"},
			-- 0_1195
			["iconRectOffset"] = {instanceNames = {"iconImage"}, propertyName = "ImageRectOffset"},
			["iconRectSize"] = {instanceNames = {"iconImage"}, propertyName = "ImageRectSize"},
		},
		other = {
			["captionBackgroundColor"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundColor3"},
			["captionBackgroundTransparency"] = {instanceNames = {"captionFrame"}, propertyName = "BackgroundTransparency", group = "caption"},
			["captionBlockerTransparency"] = {instanceNames = {"captionVisibilityBlocker"}, propertyName = "BackgroundTransparency", group = "caption"},
			["captionOverlineColor"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundColor3"},
			["captionOverlineTransparency"] = {instanceNames = {"captionOverline"}, propertyName = "BackgroundTransparency", group = "caption"},
			["captionTextColor"] = {instanceNames = {"captionLabel"}, propertyName = "TextColor3"},
			["captionTextTransparency"] = {instanceNames = {"captionLabel"}, propertyName = "TextTransparency", group = "caption"},
			["captionFont"] = {instanceNames = {"captionLabel"}, propertyName = "Font"},
			["captionCornerRadius"] = {instanceNames = {"captionCorner", "captionOverlineCorner", "captionVisibilityCorner"}, propertyName = "CornerRadius"},
			["tipBackgroundColor"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundColor3"},
			["tipBackgroundTransparency"] = {instanceNames = {"tipFrame"}, propertyName = "BackgroundTransparency", group = "tip"},
			["tipTextColor"] = {instanceNames = {"tipLabel"}, propertyName = "TextColor3"},
			["tipTextTransparency"] = {instanceNames = {"tipLabel"}, propertyName = "TextTransparency", group = "tip"},
			["tipFont"] = {instanceNames = {"tipLabel"}, propertyName = "Font"},
			["tipCornerRadius"] = {instanceNames = {"tipCorner"}, propertyName = "CornerRadius"},
			["dropdownSize"] = {instanceNames = {"dropdownContainer"}, propertyName = "Size", unique = "dropdown"},
			["dropdownCanvasSize"] = {instanceNames = {"dropdownFrame"}, propertyName = "CanvasSize"},
			["dropdownMaxIconsBeforeScroll"] = {callMethods = {self._updateDropdown}},
			["dropdownMinWidth"] = {callMethods = {self._updateDropdown}},
			["dropdownSquareCorners"] = {callMethods = {self._updateDropdown}},
			["dropdownBindToggleToIcon"] = {},
			["dropdownToggleOnLongPress"] = {},
			["dropdownToggleOnRightClick"] = {},
			["dropdownCloseOnTapAway"] = {},
			["dropdownHidePlayerlistOnOverlap"] = {},
			["dropdownListPadding"] = {callMethods = {self._updateDropdown}, instanceNames = {"dropdownList"}, propertyName = "Padding"},
			["dropdownAlignment"] = {callMethods = {self._updateDropdown}},
			["dropdownScrollBarColor"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageColor3"},
			["dropdownScrollBarTransparency"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarImageTransparency"},
			["dropdownScrollBarThickness"] = {instanceNames = {"dropdownFrame"}, propertyName = "ScrollBarThickness"},
			["dropdownIgnoreClipping"] = {callMethods = {self._dropdownIgnoreClipping}},
			["menuSize"] = {instanceNames = {"menuContainer"}, propertyName = "Size", unique = "menu"},
			["menuCanvasSize"] = {instanceNames = {"menuFrame"}, propertyName = "CanvasSize"},
			["menuMaxIconsBeforeScroll"] = {callMethods = {self._updateMenu}},
			["menuBindToggleToIcon"] = {},
			["menuToggleOnLongPress"] = {},
			["menuToggleOnRightClick"] = {},
			["menuCloseOnTapAway"] = {},
			["menuListPadding"] = {callMethods = {self._updateMenu}, instanceNames = {"menuList"}, propertyName = "Padding"},
			["menuDirection"] = {callMethods = {self._updateMenu}},
			["menuScrollBarColor"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageColor3"},
			["menuScrollBarTransparency"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarImageTransparency"},
			["menuScrollBarThickness"] = {instanceNames = {"menuFrame"}, propertyName = "ScrollBarThickness"},
			["menuIgnoreClipping"] = {callMethods = {self._menuIgnoreClipping}},
		}
	}

	---------------------------------
	self._groupSettings = {}
	for _, settingsDetails in pairs(self._settings) do
		for settingName, settingDetail in pairs(settingsDetails) do
			local group = settingDetail.group
			if group then
				local groupSettings = self._groupSettings[group]
				if not groupSettings then
					groupSettings = {}
					self._groupSettings[group] = groupSettings
				end
				table.insert(groupSettings, settingName)
				settingDetail.forcedGroupValue = DEFAULT_FORCED_GROUP_VALUES[group]
				settingDetail.useForcedGroupValue = true
			end
		end
	end
	---------------------------------

	-- The setting values themselves will be set within _settings
	-- Setup a dictionary to make it quick and easy to reference setting by name
	self._settingsDictionary = {}
	-- Some instances require unique behaviours. These are defined with the 'unique' key
	-- for instance, we only want caption transparency effects to be applied on hovering
	self._uniqueSettings = {}
	self._uniqueSettingsDictionary = {}
	self.uniqueValues = {}
	local uniqueBehaviours = {
		["dropdown"] = function(settingName, instance, propertyName, value)
			local tweenInfo = self:get("dropdownSlideInfo")
			local bindToggleToIcon = self:get("dropdownBindToggleToIcon")
			local hidePlayerlist = self:get("dropdownHidePlayerlistOnOverlap") == true and self:get("alignment") == "right"
			local dropdownContainer = self.instances.dropdownContainer
			local dropdownFrame = self.instances.dropdownFrame
			local newValue = value
			local isOpen = true
			local isDeselected = not self.isSelected
			if bindToggleToIcon == false then
				isDeselected = not self.dropdownOpen
			end
			local isSpecialPressing = self._longPressing or self._rightClicking
			if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.dropdownOpen) then 
				local dropdownSize = self:get("dropdownSize")
				local XOffset = (dropdownSize and dropdownSize.X.Offset/1) or 0
				newValue = UDim2.new(0, XOffset, 0, 0)
				isOpen = false
			end
			if #self.dropdownIcons > 0 and isOpen and hidePlayerlist then
				if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) then
					starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
				end
				IconController._bringBackPlayerlist = (IconController._bringBackPlayerlist and IconController._bringBackPlayerlist + 1) or 1
				self._bringBackPlayerlist = true
			elseif self._bringBackPlayerlist and not isOpen and IconController._bringBackPlayerlist then
				IconController._bringBackPlayerlist -= 1
				if IconController._bringBackPlayerlist <= 0 then
					IconController._bringBackPlayerlist = nil
					starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
				end
				self._bringBackPlayerlist = nil
			end
			local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue})
			local connection
			connection = tween.Completed:Connect(function()
				connection:Disconnect()
				--dropdownContainer.ClipsDescendants = not self.dropdownOpen
			end)
			tween:Play()
			if isOpen then
				dropdownFrame.CanvasPosition = self._dropdownCanvasPos
			else
				self._dropdownCanvasPos = dropdownFrame.CanvasPosition
			end
			self.dropdownOpen = isOpen
			self:_decideToCallSignal("dropdown")
		end,
		["menu"] = function(settingName, instance, propertyName, value)
			local tweenInfo = self:get("menuSlideInfo")
			local bindToggleToIcon = self:get("menuBindToggleToIcon")
			local menuContainer = self.instances.menuContainer
			local menuFrame = self.instances.menuFrame
			local newValue = value
			local isOpen = true
			local isDeselected = not self.isSelected
			if bindToggleToIcon == false then
				isDeselected = not self.menuOpen
			end
			local isSpecialPressing = self._longPressing or self._rightClicking
			if self._tappingAway or (isDeselected and not isSpecialPressing) or (isSpecialPressing and self.menuOpen) then 
				local menuSize = self:get("menuSize")
				local YOffset = (menuSize and menuSize.Y.Offset/1) or 0
				newValue = UDim2.new(0, 0, 0, YOffset)
				isOpen = false
			end
			if isOpen ~= self.menuOpen then
				self.updated:Fire()
			end
			if isOpen and tweenInfo.EasingDirection == Enum.EasingDirection.Out then
				tweenInfo = TweenInfo.new(tweenInfo.Time, tweenInfo.EasingStyle, Enum.EasingDirection.In)
			end
			local tween = tweenService:Create(instance, tweenInfo, {[propertyName] = newValue})
			local connection
			connection = tween.Completed:Connect(function()
				connection:Disconnect()
				--menuContainer.ClipsDescendants = not self.menuOpen
			end)
			tween:Play()
			if isOpen then
				if self._menuCanvasPos then
					menuFrame.CanvasPosition = self._menuCanvasPos
				end
			else
				self._menuCanvasPos = menuFrame.CanvasPosition
			end
			self.menuOpen = isOpen
			self:_decideToCallSignal("menu")
		end,
	}
	for settingsType, settingsDetails in pairs(self._settings) do
		for settingName, settingDetail in pairs(settingsDetails) do
			if settingsType == "toggleable" then
				settingDetail.values = settingDetail.values or {
					deselected = nil,
					selected = nil,
				}
			else
				settingDetail.value = nil
			end
			settingDetail.additionalValues = {}
			settingDetail.type = settingsType
			self._settingsDictionary[settingName] = settingDetail
			--
			local uniqueCat = settingDetail.unique
			if uniqueCat then
				local uniqueCatArray = self._uniqueSettings[uniqueCat] or {}
				table.insert(uniqueCatArray, settingName)
				self._uniqueSettings[uniqueCat] = uniqueCatArray
				self._uniqueSettingsDictionary[settingName] = uniqueBehaviours[uniqueCat]
			end
			--
		end
	end
	
	-- Signals (events)
	self.updated = maid:give(Signal.new())
	self.selected = maid:give(Signal.new())
    self.deselected = maid:give(Signal.new())
    self.toggled = maid:give(Signal.new())
	self.hoverStarted = maid:give(Signal.new())
	self.hoverEnded = maid:give(Signal.new())
	self.dropdownOpened = maid:give(Signal.new())
	self.dropdownClosed = maid:give(Signal.new())
	self.menuOpened = maid:give(Signal.new())
	self.menuClosed = maid:give(Signal.new())
	self.notified = maid:give(Signal.new())
	self._endNotices = maid:give(Signal.new())
	self._ignoreClippingChanged = maid:give(Signal.new())
	
	-- Connections
	-- This enables us to chain icons and features like menus and dropdowns together without them being hidden by parent frame with ClipsDescendants enabled
	local function setFeatureChange(featureName, value)
		local parentIcon = self._parentIcon
		self:set(featureName.."IgnoreClipping", value)
		if value == true and parentIcon then
			local connection = parentIcon._ignoreClippingChanged:Connect(function(_, value)
				self:set(featureName.."IgnoreClipping", value)
			end)
			local endConnection
			endConnection = self[featureName.."Closed"]:Connect(function()
				endConnection:Disconnect()
				connection:Disconnect()
			end)
		end
	end
	self.dropdownOpened:Connect(function()
		setFeatureChange("dropdown", true)
	end)
	self.dropdownClosed:Connect(function()
		setFeatureChange("dropdown", false)
	end)
	self.menuOpened:Connect(function()
		setFeatureChange("menu", true)
	end)
	self.menuClosed:Connect(function()
		setFeatureChange("menu", false)
	end)
	--]]

	-- Properties
	self.deselectWhenOtherIconSelected = true
	self.name = ""
	self.isSelected = false
	self.presentOnTopbar = true
	self.accountForWhenDisabled = false
	self.enabled = true
	self.hovering = false
	self.tipText = nil
	self.captionText = nil
	self.totalNotices = 0
	self.notices = {}
	self.dropdownIcons = {}
	self.menuIcons = {}
	self.dropdownOpen = false
	self.menuOpen = false
	self.locked = false
	self.topPadding = UDim.new(0, 4)
	self.targetPosition = nil
	self.toggleItems = {}
	self.lockedSettings = {}
	
	-- Private Properties
	self._draggingFinger = false
	self._updatingIconSize = true
	self._previousDropdownOpen = false
	self._previousMenuOpen = false
	self._bindedToggleKeys = {}
	self._bindedEvents = {}
	
	-- Apply start values
	self:setName("UnnamedIcon")
	self:setTheme(DEFAULT_THEME, true)

	-- Input handlers
	-- Calls deselect/select when the icon is clicked
	instances.iconButton.MouseButton1Click:Connect(function()
		if self._draggingFinger then
			return false
		elseif self.isSelected then
			self:deselect()
			return true
		end
		self:select()
	end)
	instances.iconButton.MouseButton2Click:Connect(function()
		self._rightClicking = true
		if self:get("dropdownToggleOnRightClick") == true then
			self:_update("dropdownSize")
		end
		if self:get("menuToggleOnRightClick") == true then
			self:_update("menuSize")
		end
		self._rightClicking = false
	end)

	-- Shows/hides the dark overlay when the icon is presssed/released
	instances.iconButton.MouseButton1Down:Connect(function()
		if self.locked then return end
		self:_updateStateOverlay(0.7, Color3.new(0, 0, 0))
	end)
	instances.iconButton.MouseButton1Up:Connect(function()
		if self.locked then return end
		self:_updateStateOverlay(0.9, Color3.new(1, 1, 1))
	end)

	-- Tap away + KeyCode toggles
	userInputService.InputBegan:Connect(function(input, touchingAnObject)
		local validTapAwayInputs = {
			[Enum.UserInputType.MouseButton1] = true,
			[Enum.UserInputType.MouseButton2] = true,
			[Enum.UserInputType.MouseButton3] = true,
			[Enum.UserInputType.Touch] = true,
		}
		if not touchingAnObject and validTapAwayInputs[input.UserInputType] then
			self._tappingAway = true
			if self.dropdownOpen and self:get("dropdownCloseOnTapAway") == true then
				self:_update("dropdownSize")
			end
			if self.menuOpen and self:get("menuCloseOnTapAway") == true then
				self:_update("menuSize")
			end
			self._tappingAway = false
		end
		--
		if self._bindedToggleKeys[input.KeyCode] and not touchingAnObject then
			if self.isSelected then
				self:deselect()
			else
				self:select()
			end
		end
		--
	end)
	
	-- hoverStarted and hoverEnded triggers and actions
	-- these are triggered when a mouse enters/leaves the icon with a mouse, is highlighted with
	-- a controller selection box, or dragged over with a touchpad
	self.hoverStarted:Connect(function(x, y)
		self.hovering = true
		if not self.locked then
			self:_updateStateOverlay(0.9, Color3.fromRGB(255, 255, 255))
		end
		self:_updateHovering()
	end)
	self.hoverEnded:Connect(function()
		self.hovering = false
		self:_updateStateOverlay(1)
		self._hoveringMaid:clean()
		self:_updateHovering()
	end)
	instances.iconButton.MouseEnter:Connect(function(x, y) -- Mouse (started)
		self.hoverStarted:Fire(x, y)
	end)
	instances.iconButton.MouseLeave:Connect(function() -- Mouse (ended)
		self.hoverEnded:Fire()
	end)
	instances.iconButton.SelectionGained:Connect(function() -- Controller (started)
		self.hoverStarted:Fire()
	end)
	instances.iconButton.SelectionLost:Connect(function() -- Controller (ended)
		self.hoverEnded:Fire()
	end)
	instances.iconButton.MouseButton1Down:Connect(function() -- TouchPad (started)
		if self._draggingFinger then
			self.hoverStarted:Fire()
		end
		-- Long press check
		local heartbeatConnection
		local releaseConnection
		local longPressTime = 0.7
		local endTick = tick() + longPressTime
		heartbeatConnection = runService.Heartbeat:Connect(function()
			if tick() >= endTick then
				releaseConnection:Disconnect()
				heartbeatConnection:Disconnect()
				self._longPressing = true
				if self:get("dropdownToggleOnLongPress") == true then
					self:_update("dropdownSize")
				end
				if self:get("menuToggleOnLongPress") == true then
					self:_update("menuSize")
				end
				self._longPressing = false
			end
		end)
		releaseConnection = instances.iconButton.MouseButton1Up:Connect(function()
			releaseConnection:Disconnect()
			heartbeatConnection:Disconnect()
		end)
	end)
	if userInputService.TouchEnabled then
		instances.iconButton.MouseButton1Up:Connect(function() -- TouchPad (ended), this was originally enabled for non-touchpads too
			if self.hovering then
				self.hoverEnded:Fire()
			end
		end)
		-- This is used to highlight when a mobile/touch device is dragging their finger accross the screen
		-- this is important for determining the hoverStarted and hoverEnded events on mobile
		local dragCount = 0
		userInputService.TouchMoved:Connect(function(touch, touchingAnObject)
			if touchingAnObject then
				return
			end
			self._draggingFinger = true
		end)
		userInputService.TouchEnded:Connect(function()
			self._draggingFinger = false
		end)
	end

	-- Finish
	self._updatingIconSize = false
	self:_updateIconSize()
	IconController.iconAdded:Fire(self)
	
	return self
end
