1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 01:42:59 +08:00

Reset top score avatar before updating it

This commit is contained in:
HoLLy 2019-06-21 16:47:19 +02:00
parent 1204c56d2d
commit fafec00667
2 changed files with 15 additions and 0 deletions

View File

@ -116,6 +116,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{
set
{
avatar.Reset();
avatar.User = value.User;
flag.Country = value.User.Country;
date.Text = $@"achieved {value.Date.Humanize()}";

View File

@ -52,6 +52,20 @@ namespace osu.Game.Users.Drawables
User = user;
}
/// <summary>
/// Fades and expires the <see cref="ModelBackedDrawable{T}.DisplayedDrawable"/>, and sets the
/// <see cref="ModelBackedDrawable{T}.Model"/> to null.
/// </summary>
/// <remarks>
/// Can be used when the <see cref="ModelBackedDrawable{T}.DisplayedDrawable"/> needs to be removed instantly.
/// </remarks>
public void Reset()
{
DisplayedDrawable?.FadeOut().Expire();
User = null;
}
protected override Drawable CreateDrawable(User user)
{
if (user == null && !ShowGuestOnNull)