1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Add prioritised user lookups for default skin

This allows user resources to be consumed before falling back to the
game bundled assets.
This commit is contained in:
Dean Herbert 2022-03-23 15:10:26 +09:00
parent 6b9f5812a5
commit 3a16483214

View File

@ -46,13 +46,13 @@ namespace osu.Game.Skinning
this.resources = resources;
}
public override Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => null;
public override Texture GetTexture(string componentName, WrapMode wrapModeS, WrapMode wrapModeT) => Textures?.Get(componentName, wrapModeS, wrapModeT);
public override ISample GetSample(ISampleInfo sampleInfo)
{
foreach (string lookup in sampleInfo.LookupNames)
{
var sample = resources.AudioManager.Samples.Get(lookup);
var sample = Samples?.Get(lookup) ?? resources.AudioManager.Samples.Get(lookup);
if (sample != null)
return sample;
}