1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

Move non-bank samples logic to LegacySkin

This commit is contained in:
iiSaLMaN 2019-08-22 12:50:47 +03:00
parent 87f3184fcc
commit 66d8440167
2 changed files with 14 additions and 10 deletions

View File

@ -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;

View File

@ -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;
}
ch.Volume.Value = info.Volume / 100.0;
return ch;