2017-05-27 23:37:15 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-11-08 05:50:45 +08:00
|
|
|
|
using System;
|
2017-05-27 23:37:15 +08:00
|
|
|
|
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(TextureStore textures)
|
|
|
|
|
{
|
2017-11-08 05:50:45 +08:00
|
|
|
|
if (textures == null)
|
|
|
|
|
throw new ArgumentNullException(nameof(textures));
|
|
|
|
|
|
2017-05-27 23:37:15 +08:00
|
|
|
|
if (!string.IsNullOrEmpty(user.CoverUrl))
|
|
|
|
|
Texture = textures.Get(user.CoverUrl);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|