1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Simplify instantiation

This commit is contained in:
Dean Herbert 2021-06-28 14:51:27 +09:00
parent e8e9fdd533
commit f777741ca7

View File

@ -96,12 +96,14 @@ namespace osu.Game.Skinning
{
int defaultSkinIndex = SkinSources.IndexOf(skinManager.DefaultSkin);
var rulesetResources = new ResourcesSkin(resources, host, audio);
if (defaultSkinIndex >= 0)
SkinSources.Insert(defaultSkinIndex, new ResourcesSkin(resources, host, audio));
SkinSources.Insert(defaultSkinIndex, rulesetResources);
else
{
// Tests may potentially override the SkinManager with another source that doesn't include it in AllSources.
SkinSources.Add(new ResourcesSkin(resources, host, audio));
SkinSources.Add(rulesetResources);
}
}
}