mirror of
https://github.com/ppy/osu.git
synced 2025-02-22 03:52:54 +08:00
Wrap gameplay content within a RulesetSkinProvidingContainer
This commit is contained in:
parent
33a9cac398
commit
e30f6581b3
@ -73,15 +73,7 @@ namespace osu.Game.Screens.Edit.Compose
|
|||||||
{
|
{
|
||||||
Debug.Assert(ruleset != null);
|
Debug.Assert(ruleset != null);
|
||||||
|
|
||||||
var beatmapSkinProvider = new BeatmapSkinProvidingContainer(beatmap.Value.Skin);
|
return new RulesetSkinProvidingContainer(ruleset, EditorBeatmap.PlayableBeatmap, beatmap.Value.Skin).WithChild(content);
|
||||||
|
|
||||||
// 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, EditorBeatmap.PlayableBeatmap));
|
|
||||||
|
|
||||||
// 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.
|
|
||||||
return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(content));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Input Handling
|
#region Input Handling
|
||||||
|
@ -234,29 +234,23 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
dependencies.CacheAs(GameplayBeatmap);
|
dependencies.CacheAs(GameplayBeatmap);
|
||||||
|
|
||||||
var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);
|
var rulesetSkinProvider = new RulesetSkinProvidingContainer(GameplayRuleset, playableBeatmap, 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(GameplayRuleset.CreateLegacySkinProvider(beatmapSkinProvider, playableBeatmap));
|
|
||||||
|
|
||||||
// load the skinning hierarchy first.
|
// 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.
|
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
|
||||||
GameplayClockContainer.Add(beatmapSkinProvider.WithChild(rulesetSkinProvider));
|
GameplayClockContainer.Add(rulesetSkinProvider);
|
||||||
|
|
||||||
rulesetSkinProvider.AddRange(new[]
|
rulesetSkinProvider.AddRange(new[]
|
||||||
{
|
{
|
||||||
// underlay and gameplay should have access the to skinning sources.
|
// underlay and gameplay should have access to the skinning sources.
|
||||||
createUnderlayComponents(),
|
createUnderlayComponents(),
|
||||||
createGameplayComponents(Beatmap.Value, playableBeatmap)
|
createGameplayComponents(Beatmap.Value, playableBeatmap)
|
||||||
});
|
});
|
||||||
|
|
||||||
// also give the HUD a ruleset container to allow rulesets to potentially override HUD elements (used to disable combo counters etc.)
|
// also give the HUD a ruleset container to allow rulesets to potentially override HUD elements (used to disable combo counters etc.)
|
||||||
// we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there.
|
// we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there.
|
||||||
var hudRulesetContainer = new SkinProvidingContainer(GameplayRuleset.CreateLegacySkinProvider(beatmapSkinProvider, playableBeatmap));
|
|
||||||
|
|
||||||
// add the overlay components as a separate step as they proxy some elements from the above underlay/gameplay components.
|
// add the overlay components as a separate step as they proxy some elements from the above underlay/gameplay components.
|
||||||
GameplayClockContainer.Add(hudRulesetContainer.WithChild(createOverlayComponents(Beatmap.Value)));
|
rulesetSkinProvider.Add(createOverlayComponents(Beatmap.Value));
|
||||||
|
|
||||||
if (!DrawableRuleset.AllowGameplayOverlays)
|
if (!DrawableRuleset.AllowGameplayOverlays)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user