mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 05:52:55 +08:00
Make DrawableRank safer.
This commit is contained in:
parent
8983bbcaad
commit
1699daaf7f
@ -14,30 +14,18 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
public class DrawableRank : Container
|
||||
{
|
||||
private Sprite sprite;
|
||||
private TextureStore textures;
|
||||
|
||||
private ScoreRank rank;
|
||||
public ScoreRank Rank
|
||||
{
|
||||
get { return rank; }
|
||||
set
|
||||
{
|
||||
if (value == rank) return;
|
||||
rank = value;
|
||||
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{rank.GetDescription()}");
|
||||
}
|
||||
}
|
||||
public ScoreRank Rank { get; private set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore ts)
|
||||
private void load(TextureStore textures)
|
||||
{
|
||||
textures = ts;
|
||||
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{rank.GetDescription()}");
|
||||
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{Rank.GetDescription()}");
|
||||
}
|
||||
|
||||
public DrawableRank(ScoreRank rank)
|
||||
{
|
||||
this.rank = rank;
|
||||
Rank = rank;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user