1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 00:53:19 +08:00

Simplify sample lookup

This commit is contained in:
Dean Herbert 2020-10-30 22:33:05 +09:00
parent b906736b85
commit bc69ed3870

View File

@ -446,20 +446,11 @@ namespace osu.Game.Skinning
// for compatibility with stable, exclude the lookup names with the custom sample bank suffix, if they are not valid for use in this skin. // for compatibility with stable, exclude the lookup names with the custom sample bank suffix, if they are not valid for use in this skin.
// using .EndsWith() is intentional as it ensures parity in all edge cases // using .EndsWith() is intentional as it ensures parity in all edge cases
// (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not). // (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not).
foreach (var l in lookupNames) lookupNames = lookupNames.Where(name => !name.EndsWith(hitSample.Suffix, StringComparison.Ordinal));
{
if (!l.EndsWith(hitSample.Suffix, StringComparison.Ordinal))
{
foreach (var n in getFallbackNames(l))
yield return n;
} }
}
}
else
{
foreach (var l in lookupNames) foreach (var l in lookupNames)
yield return l; yield return l;
}
// also for compatibility, try falling back to non-bank samples (so-called "universal" samples) as the last resort. // also for compatibility, try falling back to non-bank samples (so-called "universal" samples) as the last resort.
// going forward specifying banks shall always be required, even for elements that wouldn't require it on stable, // going forward specifying banks shall always be required, even for elements that wouldn't require it on stable,