mirror of
https://github.com/ppy/osu.git
synced 2024-11-08 12:17:43 +08:00
31 lines
820 B
C#
31 lines
820 B
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 System;
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Graphics.Sprites;
|
|
using osu.Framework.Graphics.Textures;
|
|
|
|
namespace osu.Game.Users
|
|
{
|
|
public class UserCoverBackground : Sprite
|
|
{
|
|
private readonly User user;
|
|
|
|
public UserCoverBackground(User user)
|
|
{
|
|
this.user = user;
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(LargeTextureStore textures)
|
|
{
|
|
if (textures == null)
|
|
throw new ArgumentNullException(nameof(textures));
|
|
|
|
if (!string.IsNullOrEmpty(user.CoverUrl))
|
|
Texture = textures.Get(user.CoverUrl);
|
|
}
|
|
}
|
|
}
|