diff --git a/osu.Game/Overlays/Chat/ChannelControl/ControlItem.cs b/osu.Game/Overlays/Chat/ChannelControl/ControlItem.cs index df857a6dce..a388ebc52f 100644 --- a/osu.Game/Overlays/Chat/ChannelControl/ControlItem.cs +++ b/osu.Game/Overlays/Chat/ChannelControl/ControlItem.cs @@ -4,6 +4,7 @@ #nullable enable using System; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -14,6 +15,8 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osu.Game.Online.Chat; +using osu.Game.Users.Drawables; +using osuTK; namespace osu.Game.Overlays.Chat.ChannelControl { @@ -154,10 +157,14 @@ namespace osu.Game.Overlays.Chat.ChannelControl if (channel.Type != ChannelType.PM) return Drawable.Empty(); - return new ControlItemAvatar(channel) + return new UpdateableAvatar(channel.Users.First(), false, false, true) { + Size = new Vector2(20), + Margin = new MarginPadding { Right = 5 }, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, + CornerRadius = 10, + Masking = true, }; } } diff --git a/osu.Game/Overlays/Chat/ChannelControl/ControlItemAvatar.cs b/osu.Game/Overlays/Chat/ChannelControl/ControlItemAvatar.cs deleted file mode 100644 index bb3109ec1f..0000000000 --- a/osu.Game/Overlays/Chat/ChannelControl/ControlItemAvatar.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -#nullable enable - -using System.Linq; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Sprites; -using osu.Game.Online.Chat; -using osu.Game.Users.Drawables; -using osuTK; - -namespace osu.Game.Overlays.Chat.ChannelControl -{ - public class ControlItemAvatar : CircularContainer - { - private readonly Channel channel; - - private SpriteIcon? placeholder; - private DrawableAvatar? avatar; - - public ControlItemAvatar(Channel channel) - { - this.channel = channel; - } - - [BackgroundDependencyLoader] - private void load() - { - Size = new Vector2(20); - Margin = new MarginPadding { Right = 5 }; - Masking = true; - - Children = new Drawable[] - { - placeholder = new SpriteIcon - { - Icon = FontAwesome.Solid.At, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Colour = Colour4.White, - RelativeSizeAxes = Axes.Both, - Alpha = 0.5f, - }, - new DelayedLoadWrapper(avatar = new DrawableAvatar(channel.Users.First()) - { - RelativeSizeAxes = Axes.Both, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }), - }; - } - - protected override void LoadComplete() - { - base.LoadComplete(); - avatar!.OnLoadComplete += _ => placeholder!.FadeOut(250); - } - } -}