mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Make DrawableRank safer.
This commit is contained in:
@ -14,30 +14,18 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
public class DrawableRank : Container
|
public class DrawableRank : Container
|
||||||
{
|
{
|
||||||
private Sprite sprite;
|
private Sprite sprite;
|
||||||
private TextureStore textures;
|
|
||||||
|
|
||||||
private ScoreRank rank;
|
public ScoreRank Rank { get; private set; }
|
||||||
public ScoreRank Rank
|
|
||||||
{
|
|
||||||
get { return rank; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == rank) return;
|
|
||||||
rank = value;
|
|
||||||
sprite.Texture = textures.Get($@"Badges/ScoreRanks/{rank.GetDescription()}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[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)
|
public DrawableRank(ScoreRank rank)
|
||||||
{
|
{
|
||||||
this.rank = rank;
|
Rank = rank;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user