1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Fix seeding screen crashing on seedings with null mod

This commit is contained in:
Bartłomiej Dach 2021-07-17 17:53:58 +02:00
parent 9a2fb8ca6c
commit 714255e6d4

View File

@ -179,44 +179,48 @@ namespace osu.Game.Tournament.Screens.TeamIntro
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
FillFlowContainer row;
InternalChildren = new Drawable[]
{
new FillFlowContainer
row = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Spacing = new Vector2(5),
Children = new Drawable[]
{
new Sprite
{
Texture = textures.Get($"mods/{mods.ToLower()}"),
Scale = new Vector2(0.5f)
},
new Container
{
Size = new Vector2(50, 16),
CornerRadius = 10,
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = TournamentGame.ELEMENT_BACKGROUND_COLOUR,
},
new TournamentSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = seeding.ToString("#,0"),
Colour = TournamentGame.ELEMENT_FOREGROUND_COLOUR
},
}
},
}
},
};
if (!string.IsNullOrEmpty(mods))
{
row.Add(new Sprite
{
Texture = textures.Get($"mods/{mods.ToLower()}"),
Scale = new Vector2(0.5f)
});
}
row.Add(new Container
{
Size = new Vector2(50, 16),
CornerRadius = 10,
Masking = true,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = TournamentGame.ELEMENT_BACKGROUND_COLOUR,
},
new TournamentSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = seeding.ToString("#,0"),
Colour = TournamentGame.ELEMENT_FOREGROUND_COLOUR
},
}
});
}
}
}