2019-01-24 16:43:03 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-10-08 11:52:34 +08:00
|
|
|
using osu.Game.Skinning;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2018-11-06 17:28:22 +08:00
|
|
|
namespace osu.Game.Screens.Edit.Compose
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2019-10-09 15:05:55 +08:00
|
|
|
public class ComposeScreen : EditorScreenWithTimeline
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2019-10-09 15:05:55 +08:00
|
|
|
protected override Drawable CreateMainContent()
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();
|
2019-04-01 11:16:05 +08:00
|
|
|
|
2019-10-09 15:05:55 +08:00
|
|
|
var composer = ruleset?.CreateHitObjectComposer();
|
2019-04-01 11:16:05 +08:00
|
|
|
|
2019-10-08 13:23:13 +08:00
|
|
|
if (composer != null)
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2019-10-08 13:23:13 +08:00
|
|
|
var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2019-10-08 13:23:13 +08:00
|
|
|
// 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));
|
2019-10-08 11:52:34 +08:00
|
|
|
|
2019-10-08 13:23:13 +08:00
|
|
|
// 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.
|
2019-10-09 15:05:55 +08:00
|
|
|
return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(ruleset.CreateHitObjectComposer()));
|
2019-10-08 13:23:13 +08:00
|
|
|
}
|
2019-10-08 11:52:34 +08:00
|
|
|
|
2019-10-09 15:05:55 +08:00
|
|
|
return new ScreenWhiteBox.UnderConstructionMessage($"{ruleset.Description}'s composer");
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|