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