1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 15:43:18 +08:00

Don't include empty namespace in sample lookup

This commit is contained in:
smoogipoo 2018-07-02 14:35:03 +09:00
parent 7f832e34c0
commit 189194ee8d

View File

@ -34,11 +34,16 @@ namespace osu.Game.Audio
/// </summary> /// </summary>
public int Volume; public int Volume;
public virtual IEnumerable<string> LookupNames => new[] public virtual IEnumerable<string> LookupNames
{ {
$"{Namespace}/{Bank}-{Name}", get
$"{Bank}-{Name}" // Without namespace as a fallback {
}; if (!string.IsNullOrEmpty(Namespace))
yield return $"{Namespace}/{Bank}-{Name}";
yield return $"{Bank}-{Name}"; // Without namespace as a fallback even when we have a namespace
}
}
public SampleInfo Clone() => (SampleInfo)MemberwiseClone(); public SampleInfo Clone() => (SampleInfo)MemberwiseClone();
} }