osu/osu.Game/Screens/Select/Leaderboards/DrawableRank.cs

40 lines
1.1 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Game.Modes;
using osu.Framework.Extensions;
namespace osu.Game.Screens.Select.Leaderboards
{
public class DrawableRank : Container
{
private readonly Sprite sprite;
2017-03-21 23:32:28 +00:00
public ScoreRank Rank { get; private set; }
[BackgroundDependencyLoader]
2017-03-21 23:32:28 +00:00
private void load(TextureStore textures)
{
2017-03-21 23:32:28 +00:00
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{Rank.GetDescription()}");
}
public DrawableRank(ScoreRank rank)
{
2017-03-21 23:32:28 +00:00
Rank = rank;
Children = new Drawable[]
{
sprite = new Sprite
{
RelativeSizeAxes = Axes.Both,
},
};
}
}
}