1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 05:32:54 +08:00

Tidy up nesting

This commit is contained in:
Dean Herbert 2021-01-26 19:16:38 +09:00
parent 64a3c712aa
commit 81ab82fafe

View File

@ -32,9 +32,9 @@ namespace osu.Game.Tournament.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(TextureStore textures, LadderInfo ladderInfo) private void load(TextureStore textures, LadderInfo ladderInfo)
{ {
var texture = textures.Get($"mods/{modAcronym}"); var customTexture = textures.Get($"mods/{modAcronym}");
if (texture != null) if (customTexture != null)
{ {
AddInternal(new Sprite AddInternal(new Sprite
{ {
@ -42,24 +42,24 @@ namespace osu.Game.Tournament.Components
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Texture = texture Texture = customTexture
}); });
return;
} }
else
var ruleset = rulesets.GetRuleset(ladderInfo.Ruleset.Value?.ID ?? 0);
var modIcon = ruleset?.CreateInstance().GetAllMods().FirstOrDefault(mod => mod.Acronym == modAcronym);
if (modIcon == null)
return;
AddInternal(new ModIcon(modIcon, false)
{ {
var ruleset = rulesets.GetRuleset(ladderInfo.Ruleset.Value?.ID ?? 0); Anchor = Anchor.Centre,
var modIcon = ruleset?.CreateInstance().GetAllMods().FirstOrDefault(mod => mod.Acronym == modAcronym); Origin = Anchor.Centre,
Scale = new Vector2(0.5f)
if (modIcon == null) });
return;
AddInternal(new ModIcon(modIcon, false)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Scale = new Vector2(0.5f)
});
}
} }
} }
} }