mirror of
https://github.com/ppy/osu
synced 2025-01-11 08:39:31 +00:00
Fix skins not being displayed correctly in the editor
This commit is contained in:
parent
438408161c
commit
24269c0384
@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user