mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:25:04 +08:00
Move non-bank samples logic to LegacySkin
This commit is contained in:
parent
87f3184fcc
commit
66d8440167
@ -212,7 +212,19 @@ namespace osu.Game.Skinning
|
||||
return texture;
|
||||
}
|
||||
|
||||
public override SampleChannel GetSample(string sampleName) => Samples.Get(sampleName);
|
||||
public override SampleChannel GetSample(string sampleName)
|
||||
{
|
||||
var sample = Samples.Get(sampleName);
|
||||
|
||||
if (sample == null)
|
||||
{
|
||||
// Try fallback to non-bank samples.
|
||||
var bank = sampleName.Split('/').Last().Split('-')[0] + '-';
|
||||
sample = Samples.Get($"Gameplay/{sampleName.Replace(bank, "")}");
|
||||
}
|
||||
|
||||
return sample;
|
||||
}
|
||||
|
||||
private bool hasFont(string fontName) => GetTexture($"{fontName}-0") != null;
|
||||
|
||||
|
@ -55,16 +55,8 @@ namespace osu.Game.Skinning
|
||||
foreach (var lookup in info.LookupNames)
|
||||
{
|
||||
var ch = getSampleFunction($"Gameplay/{lookup}");
|
||||
|
||||
if (ch == null)
|
||||
{
|
||||
// Try fallback to non-bank samples.
|
||||
var bank = lookup.Split('/').Last().Split('-')[0] + '-';
|
||||
ch = getSampleFunction($"Gameplay/{lookup.Replace(bank, "")}");
|
||||
|
||||
if (ch == null)
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
|
||||
ch.Volume.Value = info.Volume / 100.0;
|
||||
return ch;
|
||||
|
Loading…
Reference in New Issue
Block a user