Move fallback to non-bank samples to centralise hackery

This commit is contained in:
Bartłomiej Dach 2020-07-30 22:07:07 +02:00
parent 2bb436fd3c
commit 971eafde2b

View File

@ -356,10 +356,6 @@ namespace osu.Game.Skinning
return sample;
}
if (sampleInfo is HitSampleInfo hsi)
// Try fallback to non-bank samples.
return Samples?.Get(hsi.Name);
return null;
}
@ -383,6 +379,11 @@ namespace osu.Game.Skinning
// (see LegacyTaikoSampleInfo for an example of one - prioritising the taiko prefix should still apply, but the sample bank should not).
lookupNames = hitSample.LookupNames.Where(name => !name.EndsWith(hitSample.Suffix));
// 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,
// which is why this is done locally here.
lookupNames = lookupNames.Append(hitSample.Name);
return lookupNames;
}
}