1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Fix skins not being displayed correctly in the editor

This commit is contained in:
Dean Herbert 2019-10-08 12:52:34 +09:00
parent 438408161c
commit 24269c0384
2 changed files with 13 additions and 2 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.Logging;
using osu.Game.Rulesets.Edit;
using osu.Game.Screens.Edit.Compose.Components;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osu.Game.Skinning;
using osuTK.Graphics;
namespace osu.Game.Screens.Edit.Compose
@ -115,7 +116,17 @@ namespace osu.Game.Screens.Edit.Compose
return;
}
composerContainer.Child = composer;
var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);
// the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation
// full access to all skin sources.
var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider));
// load the skinning hierarchy first.
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
composerContainer.Add(
beatmapSkinProvider.WithChild(
rulesetSkinProvider.WithChild(composer)));
}
}
}

View File

@ -53,7 +53,7 @@ namespace osu.Game.Skinning
if (AllowTextureLookup(componentName) && (sourceTexture = skin?.GetTexture(componentName)) != null)
return sourceTexture;
return fallbackSource.GetTexture(componentName);
return fallbackSource?.GetTexture(componentName);
}
public SampleChannel GetSample(ISampleInfo sampleInfo)