1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-16 07:32:34 +08:00
Files
osu-lazer/osu.Game/Overlays/Notifications/UserAvatarNotification.cs
T
2025-08-16 16:03:47 +09:00

46 lines
1.3 KiB
C#

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Users.Drawables;
namespace osu.Game.Overlays.Notifications
{
public abstract partial class UserAvatarNotification : SimpleNotification
{
private readonly APIUser? user;
protected DrawableAvatar Avatar { get; private set; } = null!;
protected UserAvatarNotification(APIUser? user, LocalisableString text = default)
{
this.user = user;
Icon = default;
Text = text;
}
[BackgroundDependencyLoader]
private void load()
{
IconContent.Masking = true;
IconContent.CornerRadius = CORNER_RADIUS;
IconContent.ChangeChildDepth(IconDrawable, float.MinValue);
LoadComponentAsync(Avatar = new DrawableAvatar(user)
{
FillMode = FillMode.Fill,
}, IconContent.Add);
}
protected override void Update()
{
base.Update();
IconContent.Width = IconContent.DrawHeight;
}
}
}