mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 05:33:07 +08:00
Add null-checks and fallbacks to make display work with current API version.
This commit is contained in:
parent
1ae4c2dfbb
commit
775a86e798
@ -116,7 +116,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = height;
|
Height = height;
|
||||||
|
|
||||||
var flag = Score.User.Region.CreateDrawable();
|
var flag = Score.User?.Region.CreateDrawable() ?? new DrawableFlag();
|
||||||
flag.Width = 30;
|
flag.Width = 30;
|
||||||
flag.RelativeSizeAxes = Axes.Y;
|
flag.RelativeSizeAxes = Axes.Y;
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
{
|
{
|
||||||
nameLabel = new OsuSpriteText
|
nameLabel = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Score.User?.Username,
|
Text = Score.User?.Username ?? Score.Username,
|
||||||
Font = @"Exo2.0-BoldItalic",
|
Font = @"Exo2.0-BoldItalic",
|
||||||
TextSize = 23,
|
TextSize = 23,
|
||||||
},
|
},
|
||||||
@ -248,10 +248,13 @@ namespace osu.Game.Screens.Select.Leaderboards
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (Mod mod in Score.Mods)
|
if (Score.Mods != null)
|
||||||
{
|
{
|
||||||
// TODO: Get actual mod colours
|
foreach (Mod mod in Score.Mods)
|
||||||
modsContainer.Add(new ScoreModIcon(mod.Icon, OsuColour.FromHex(@"ffcc22")));
|
{
|
||||||
|
// TODO: Get actual mod colours
|
||||||
|
modsContainer.Add(new ScoreModIcon(mod.Icon, OsuColour.FromHex(@"ffcc22")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user