2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
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]
|
2018-09-09 01:41:47 +08:00
|
|
|
|
private void load(LargeTextureStore textures)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
if (textures == null)
|
|
|
|
|
throw new ArgumentNullException(nameof(textures));
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(user.CoverUrl))
|
2018-08-31 06:04:40 +08:00
|
|
|
|
Texture = textures.Get(user.CoverUrl);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|