function Icon.new()local p={}setmetatable(p,Icon)local J=Maid.new()p._maid=J p._hoveringMaid=J:give(Maid.new())p._dropdownClippingMaid=J:give(Maid.new())p._menuClippingMaid=J:give(Maid.new())local v={}p.instances=v local A=J:give(iconTemplate:Clone())A.Visible=true A.Parent=topbarContainer v.iconContainer=A v.iconButton=A.IconButton v.iconImage=v.iconButton.IconImage v.iconLabel=v.iconButton.IconLabel v.iconGradient=v.iconButton.IconGradient v.iconCorner=v.iconButton.IconCorner v.iconOverlay=A.IconOverlay v.iconOverlayCorner=v.iconOverlay.IconOverlayCorner v.noticeFrame=v.iconButton.NoticeFrame v.noticeLabel=v.noticeFrame.NoticeLabel v.captionContainer=A.CaptionContainer v.captionFrame=v.captionContainer.CaptionFrame v.captionLabel=v.captionContainer.CaptionLabel v.captionCorner=v.captionFrame.CaptionCorner v.captionOverlineContainer=v.captionContainer.CaptionOverlineContainer v.captionOverline=v.captionOverlineContainer.CaptionOverline v.captionOverlineCorner=v.captionOverline.CaptionOverlineCorner v.captionVisibilityBlocker=v.captionFrame.CaptionVisibilityBlocker v.captionVisibilityCorner=v.captionVisibilityBlocker.CaptionVisibilityCorner v.tipFrame=A.TipFrame v.tipLabel=v.tipFrame.TipLabel v.tipCorner=v.tipFrame.TipCorner v.dropdownContainer=A.DropdownContainer v.dropdownFrame=v.dropdownContainer.DropdownFrame v.dropdownList=v.dropdownFrame.DropdownList v.menuContainer=A.MenuContainer v.menuFrame=v.menuContainer.MenuFrame v.menuList=v.menuFrame.MenuList v.clickSound=A.ClickSound p._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={p._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"},forcedIconSizeX={};forcedIconSizeY={},iconSize={callSignals={p.updated},callMethods={p._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={p._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={callMethods={p._updateIconSize};instanceNames={"\105\099\111\110\076\097\098\101\108"},propertyName="\070\111\110\116"},iconImageYScale={callMethods={p._updateIconSize}};iconImageRatio={callMethods={p._updateIconSize}},iconLabelYScale={callMethods={p._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={p._updateBaseZIndex}};order={callSignals={p.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={p.updated},callMethods={p._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"}};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={p._updateDropdown}},dropdownMinWidth={callMethods={p._updateDropdown}},dropdownSquareCorners={callMethods={p._updateDropdown}},dropdownBindToggleToIcon={};dropdownToggleOnLongPress={};dropdownToggleOnRightClick={},dropdownCloseOnTapAway={};dropdownHidePlayerlistOnOverlap={};dropdownListPadding={callMethods={p._updateDropdown};instanceNames={"\100\114\111\112\100\111\119\110\076\105\115\116"};propertyName="\080\097\100\100\105\110\103"};dropdownAlignment={callMethods={p._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={p._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={p._updateMenu}},menuBindToggleToIcon={};menuToggleOnLongPress={};menuToggleOnRightClick={};menuCloseOnTapAway={},menuListPadding={callMethods={p._updateMenu};instanceNames={"\109\101\110\117\076\105\115\116"},propertyName="\080\097\100\100\105\110\103"};menuDirection={callMethods={p._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={p._menuIgnoreClipping}}}}p._groupSettings={}for J,v in pairs(p._settings)do for J,v in pairs(v)do local A=v.group if A then local d=p._groupSettings[A]if not d then d={}p._groupSettings[A]=d end table.insert(d,J)v.forcedGroupValue=DEFAULT_FORCED_GROUP_VALUES[A]v.useForcedGroupValue=true end end end p._settingsDictionary={}p._uniqueSettings={}p._uniqueSettingsDictionary={}p.uniqueValues={}local d={dropdown=function(J,v,A,d)local g=p:get("\100\114\111\112\100\111\119\110\083\108\105\100\101\073\110\102\111")local X=p: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 M=p: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 p:get("\097\108\105\103\110\109\101\110\116")=="\114\105\103\104\116"local t=p.instances.dropdownContainer local D=p.instances.dropdownFrame local V=d local O=true local c=not p.isSelected if X==false then c=not p.dropdownOpen end local P=p._longPressing or p._rightClicking if p._tappingAway or c and not P or P and p.dropdownOpen then local J=p:get("\100\114\111\112\100\111\119\110\083\105\122\101")local v=J and J.X.Offset/1 or 0 V=UDim2.new(0,v,0,0)O=false end if#p.dropdownIcons>0 and(O and M)then if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList)then IconController._bringBackPlayerlist=IconController._bringBackPlayerlist and IconController._bringBackPlayerlist+1 or 1 p._bringBackPlayerlist=true starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false)end elseif p._bringBackPlayerlist and(not O and IconController._bringBackPlayerlist)then IconController._bringBackPlayerlist-=1 if IconController._bringBackPlayerlist<=0 then IconController._bringBackPlayerlist=nil starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,true)end p._bringBackPlayerlist=nil end local Q=tweenService:Create(v,g,{[A]=V})local i i=Q.Completed:Connect(function()i:Disconnect()end)Q:Play()if O then else p._dropdownCanvasPos=D.CanvasPosition end D.ScrollingEnabled=O p.dropdownOpen=O p:_decideToCallSignal("\100\114\111\112\100\111\119\110")end;menu=function(J,v,A,d)local g=p:get("\109\101\110\117\083\108\105\100\101\073\110\102\111")local X=p:get("\109\101\110\117\066\105\110\100\084\111\103\103\108\101\084\111\073\099\111\110")local M=p.instances.menuContainer local t=p.instances.menuFrame local D=d local V=true local O=not p.isSelected if X==false then O=not p.menuOpen end local c=p._longPressing or p._rightClicking if p._tappingAway or O and not c or c and p.menuOpen then local J=p:get("\109\101\110\117\083\105\122\101")local v=J and J.Y.Offset/1 or 0 D=UDim2.new(0,0,0,v)V=false end if V~=p.menuOpen then p.updated:Fire()end if V and g.EasingDirection==Enum.EasingDirection.Out then g=TweenInfo.new(g.Time,g.EasingStyle,Enum.EasingDirection.In)end local P=tweenService:Create(v,g,{[A]=D})local Q Q=P.Completed:Connect(function()Q:Disconnect()end)P:Play()if V then if p._menuCanvasPos then t.CanvasPosition=p._menuCanvasPos end else p._menuCanvasPos=t.CanvasPosition end t.ScrollingEnabled=V p.menuOpen=V p:_decideToCallSignal("\109\101\110\117")end}for J,v in pairs(p._settings)do for v,A in pairs(v)do if J=="\116\111\103\103\108\101\097\098\108\101"then A.values=A.values or{deselected=nil,selected=nil}else A.value=nil end A.additionalValues={}A.type=J p._settingsDictionary[v]=A local g=A.unique if g then local J=p._uniqueSettings[g]or{}table.insert(J,v)p._uniqueSettings[g]=J p._uniqueSettingsDictionary[v]=d[g]end end end p.updated=J:give(Signal.new())p.selected=J:give(Signal.new())p.deselected=J:give(Signal.new())p.toggled=J:give(Signal.new())p.userSelected=J:give(Signal.new())p.userDeselected=J:give(Signal.new())p.userToggled=J:give(Signal.new())p.hoverStarted=J:give(Signal.new())p.hoverEnded=J:give(Signal.new())p.dropdownOpened=J:give(Signal.new())p.dropdownClosed=J:give(Signal.new())p.menuOpened=J:give(Signal.new())p.menuClosed=J:give(Signal.new())p.notified=J:give(Signal.new())p._endNotices=J:give(Signal.new())p._ignoreClippingChanged=J:give(Signal.new())local function g(J,v)local A=p._parentIcon p:set(J.."\073\103\110\111\114\101\067\108\105\112\112\105\110\103",v)if v==true and A then local v=A._ignoreClippingChanged:Connect(function(v,A)p:set(J.."\073\103\110\111\114\101\067\108\105\112\112\105\110\103",A)end)local d d=p[J.."\067\108\111\115\101\100"]:Connect(function()d:Disconnect()v:Disconnect()end)end end p.dropdownOpened:Connect(function()g("\100\114\111\112\100\111\119\110",true)end)p.dropdownClosed:Connect(function()g("\100\114\111\112\100\111\119\110",false)end)p.menuOpened:Connect(function()g("\109\101\110\117",true)end)p.menuClosed:Connect(function()g("\109\101\110\117",false)end)p.deselectWhenOtherIconSelected=true p.name=""p.isSelected=false p.presentOnTopbar=true p.accountForWhenDisabled=false p.enabled=true p.hovering=false p.tipText=nil p.captionText=nil p.totalNotices=0 p.notices={}p.dropdownIcons={}p.menuIcons={}p.dropdownOpen=false p.menuOpen=false p.locked=false p.topPadding=UDim.new(0,4)p.targetPosition=nil p.toggleItems={}p.lockedSettings={}p.UID=httpService:GenerateGUID(true)p.blockBackBehaviourChecks={}p._draggingFinger=false p._updatingIconSize=true p._previousDropdownOpen=false p._previousMenuOpen=false p._bindedToggleKeys={}p._bindedEvents={}p:setName("\085\110\110\097\109\101\100\073\099\111\110")p:setTheme(DEFAULT_THEME,true)v.iconButton.MouseButton1Click:Connect(function()if p.locked then return end if p.isSelected then p:deselect()p.userDeselected:Fire()p.userToggled:Fire(false)return true end p:select()p.userSelected:Fire()p.userToggled:Fire(true)end)v.iconButton.MouseButton2Click:Connect(function()p._rightClicking=true if p: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 p:_update("\100\114\111\112\100\111\119\110\083\105\122\101")end if p: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 p:_update("\109\101\110\117\083\105\122\101")end p._rightClicking=false end)v.iconButton.MouseButton1Down:Connect(function()if p.locked then return end p:_updateStateOverlay(.7,Color3.new(0,0,0))end)v.iconButton.MouseButton1Up:Connect(function()if p.overlayLocked then return end p:_updateStateOverlay(.9,Color3.new(1,1,1))end)userInputService.InputBegan:Connect(function(J,v)local A={[Enum.UserInputType.MouseButton1]=true,[Enum.UserInputType.MouseButton2]=true,[Enum.UserInputType.MouseButton3]=true;[Enum.UserInputType.Touch]=true}if not v and A[J.UserInputType]then p._tappingAway=true if p.dropdownOpen and p: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 p:_update("\100\114\111\112\100\111\119\110\083\105\122\101")end if p.menuOpen and p:get("\109\101\110\117\067\108\111\115\101\079\110\084\097\112\065\119\097\121")==true then p:_update("\109\101\110\117\083\105\122\101")end p._tappingAway=false end if p._bindedToggleKeys[J.KeyCode]and(not v and not p.locked)then if p.isSelected then p:deselect()p.userDeselected:Fire()p.userToggled:Fire(false)else p:select()p.userSelected:Fire()p.userToggled:Fire(true)end end end)p.hoverStarted:Connect(function(J,v)p.hovering=true if not p.locked then p:_updateStateOverlay(.9,Color3.fromRGB(255,255,255))end p:_updateHovering()end)p.hoverEnded:Connect(function()p.hovering=false p:_updateStateOverlay(1)p._hoveringMaid:clean()p:_updateHovering()end)v.iconButton.MouseEnter:Connect(function(J,v)p.hoverStarted:Fire(J,v)end)v.iconButton.MouseLeave:Connect(function()p.hoverEnded:Fire()end)v.iconButton.SelectionGained:Connect(function()p.hoverStarted:Fire()end)v.iconButton.SelectionLost:Connect(function()p.hoverEnded:Fire()end)v.iconButton.MouseButton1Down:Connect(function()if p._draggingFinger then p.hoverStarted:Fire()end local J local A local d=.7 local g=tick()+d J=runService.Heartbeat:Connect(function()if tick()>=g then A:Disconnect()J:Disconnect()p._longPressing=true if p: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 p:_update("\100\114\111\112\100\111\119\110\083\105\122\101")end if p:get("\109\101\110\117\084\111\103\103\108\101\079\110\076\111\110\103\080\114\101\115\115")==true then p:_update("\109\101\110\117\083\105\122\101")end p._longPressing=false end end)A=v.iconButton.MouseButton1Up:Connect(function()A:Disconnect()J:Disconnect()end)end)if userInputService.TouchEnabled then v.iconButton.MouseButton1Up:Connect(function()if p.hovering then p.hoverEnded:Fire()end end)local J=0 userInputService.TouchMoved:Connect(function(J,v)if v then return end p._draggingFinger=true end)userInputService.TouchEnded:Connect(function()p._draggingFinger=false end)end p._updatingIconSize=false p:_updateIconSize()IconController.iconAdded:Fire(p)return p 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"},
			["forcedIconSizeX"] = {},
			["forcedIconSizeY"] = {},
			["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"] = {callMethods = {self._updateIconSize}, 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"},
		},
		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 and self._parentIcon == nil and self._bringBackPlayerlist == nil then
			if #self.dropdownIcons > 0 and isOpen and hidePlayerlist then
				if starterGui:GetCoreGuiEnabled(Enum.CoreGuiType.PlayerList) then
					IconController._bringBackPlayerlist = (IconController._bringBackPlayerlist and IconController._bringBackPlayerlist + 1) or 1
					self._bringBackPlayerlist = true
					starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
				end
			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
			dropdownFrame.ScrollingEnabled = isOpen -- It's important scrolling is only enabled when the dropdown is visible otherwise it could block the scrolling behaviour of other icons
			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
			menuFrame.ScrollingEnabled = isOpen -- It's important scrolling is only enabled when the menu is visible otherwise it could block the scrolling behaviour of other icons
			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.userSelected = maid:give(Signal.new())
	self.userDeselected = maid:give(Signal.new())
	self.userToggled = 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 = {}
	self.UID = httpService:GenerateGUID(true)
	self.blockBackBehaviourChecks = {}
	
	-- 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.locked then return end
		if self._draggingFinger then
			return false
		elseif self.isSelected then
			self:deselect()
			return true
		end
		self:select()
	end)--]]
	instances.iconButton.MouseButton1Click:Connect(function()
		if self.locked then return end
		if self.isSelected then
			self:deselect()
			self.userDeselected:Fire()
			self.userToggled:Fire(false)
			return true
		end
		self:select()
		self.userSelected:Fire()
		self.userToggled:Fire(true)
	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.overlayLocked 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 and not self.locked then
			if self.isSelected then
				self:deselect()
				self.userDeselected:Fire()
				self.userToggled:Fire(false)
			else
				self:select()
				self.userSelected:Fire()
				self.userToggled:Fire(true)
			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
