From 5a1750071edb99f0d37f0907023cb1ec2fc85cb9 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Aug 2025 19:32:54 +0900 Subject: [PATCH 1/3] Replace `OnUpdate()` usage with local update --- .../Overlays/Notifications/UserAvatarNotification.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Notifications/UserAvatarNotification.cs b/osu.Game/Overlays/Notifications/UserAvatarNotification.cs index 32a0e31e30..4fb9b08c89 100644 --- a/osu.Game/Overlays/Notifications/UserAvatarNotification.cs +++ b/osu.Game/Overlays/Notifications/UserAvatarNotification.cs @@ -31,7 +31,6 @@ namespace osu.Game.Overlays.Notifications IconContent.Masking = true; IconContent.CornerRadius = CORNER_RADIUS; IconContent.ChangeChildDepth(IconDrawable, float.MinValue); - IconContent.OnUpdate += _ => IconContent.Width = IconContent.BoundingBox.Height; LoadComponentAsync(Avatar = new DrawableAvatar(user) { @@ -39,5 +38,13 @@ namespace osu.Game.Overlays.Notifications }, IconContent.Add); } } + + protected override void Update() + { + base.Update(); + + if (user != null) + IconContent.Width = IconContent.DrawHeight; + } } } From 2750f5bb5390bf82177db5d3845f756dd4d9aada Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 15 Aug 2025 19:33:19 +0900 Subject: [PATCH 2/3] Make non-nullable member truly non-nullable --- .../Overlays/Notifications/UserAvatarNotification.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Notifications/UserAvatarNotification.cs b/osu.Game/Overlays/Notifications/UserAvatarNotification.cs index 4fb9b08c89..c283d36468 100644 --- a/osu.Game/Overlays/Notifications/UserAvatarNotification.cs +++ b/osu.Game/Overlays/Notifications/UserAvatarNotification.cs @@ -26,16 +26,17 @@ namespace osu.Game.Overlays.Notifications [BackgroundDependencyLoader] private void load() { + Avatar = new DrawableAvatar(user) + { + FillMode = FillMode.Fill, + }; + if (user != null) { IconContent.Masking = true; IconContent.CornerRadius = CORNER_RADIUS; IconContent.ChangeChildDepth(IconDrawable, float.MinValue); - - LoadComponentAsync(Avatar = new DrawableAvatar(user) - { - FillMode = FillMode.Fill, - }, IconContent.Add); + LoadComponentAsync(Avatar, IconContent.Add); } } From 01de2dc55b40c518c97c18dc331fd6f2f1bc4a8d Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Sat, 16 Aug 2025 16:03:47 +0900 Subject: [PATCH 3/3] Always add an icon --- .../Notifications/UserAvatarNotification.cs | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/Notifications/UserAvatarNotification.cs b/osu.Game/Overlays/Notifications/UserAvatarNotification.cs index c283d36468..7dbecbf11e 100644 --- a/osu.Game/Overlays/Notifications/UserAvatarNotification.cs +++ b/osu.Game/Overlays/Notifications/UserAvatarNotification.cs @@ -26,26 +26,20 @@ namespace osu.Game.Overlays.Notifications [BackgroundDependencyLoader] private void load() { - Avatar = new DrawableAvatar(user) + IconContent.Masking = true; + IconContent.CornerRadius = CORNER_RADIUS; + IconContent.ChangeChildDepth(IconDrawable, float.MinValue); + + LoadComponentAsync(Avatar = new DrawableAvatar(user) { FillMode = FillMode.Fill, - }; - - if (user != null) - { - IconContent.Masking = true; - IconContent.CornerRadius = CORNER_RADIUS; - IconContent.ChangeChildDepth(IconDrawable, float.MinValue); - LoadComponentAsync(Avatar, IconContent.Add); - } + }, IconContent.Add); } protected override void Update() { base.Update(); - - if (user != null) - IconContent.Width = IconContent.DrawHeight; + IconContent.Width = IconContent.DrawHeight; } } }