1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 14:27:31 +08:00
osu-lazer/osu.Game/Users/UserCoverBackground.cs
2018-08-27 17:26:44 +09:00

32 lines
863 B
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Threading.Tasks;
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 async Task load(TextureStore textures)
{
if (textures == null)
throw new ArgumentNullException(nameof(textures));
if (!string.IsNullOrEmpty(user.CoverUrl))
Texture = await textures.GetAsync(user.CoverUrl);
}
}
}