mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Remove suffix hackery
This commit is contained in:
parent
00d564d29c
commit
44981431c5
@ -420,24 +420,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
customSampleBank = value;
|
||||
|
||||
// A 0 custom sample bank should cause LegacyBeatmapSkin to always fall back to the user skin. This is done by giving a null suffix.
|
||||
if (value > 0)
|
||||
if (value >= 2)
|
||||
Suffix = value.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<string> LookupNames
|
||||
{
|
||||
get
|
||||
{
|
||||
// The lookup should only contain the suffix for custom sample bank 2 and beyond.
|
||||
// For custom sample bank 1 and 0, the lookup should not contain the suffix as only the lookup source (beatmap or user skin) is changed.
|
||||
if (CustomSampleBank >= 2)
|
||||
yield return $"{Bank}-{Name}{Suffix}";
|
||||
|
||||
yield return $"{Bank}-{Name}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class FileHitSampleInfo : LegacyHitSampleInfo
|
||||
|
@ -7,6 +7,7 @@ using osu.Framework.Bindables;
|
||||
using osu.Framework.IO.Stores;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets.Objects.Legacy;
|
||||
|
||||
namespace osu.Game.Skinning
|
||||
{
|
||||
@ -37,9 +38,9 @@ namespace osu.Game.Skinning
|
||||
|
||||
public override SampleChannel GetSample(ISampleInfo sampleInfo)
|
||||
{
|
||||
if (sampleInfo is HitSampleInfo hsi && string.IsNullOrEmpty(hsi.Suffix))
|
||||
if (sampleInfo is ConvertHitObjectParser.LegacyHitSampleInfo legacy && legacy.CustomSampleBank == 0)
|
||||
{
|
||||
// When no custom sample set is provided, always fall-back to the default samples.
|
||||
// When no custom sample bank is provided, always fall-back to the default samples.
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user