mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Make work in editor
This commit is contained in:
@ -3,17 +3,21 @@
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Screens.Edit.Compose.Components.Timeline;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Compose
|
||||
{
|
||||
public class ComposeScreen : EditorScreenWithTimeline
|
||||
{
|
||||
private HitObjectComposer composer;
|
||||
|
||||
protected override Drawable CreateMainContent()
|
||||
{
|
||||
var ruleset = Beatmap.Value.BeatmapInfo.Ruleset?.CreateInstance();
|
||||
|
||||
var composer = ruleset?.CreateHitObjectComposer();
|
||||
composer = ruleset?.CreateHitObjectComposer();
|
||||
|
||||
if (composer != null)
|
||||
{
|
||||
@ -25,10 +29,15 @@ namespace osu.Game.Screens.Edit.Compose
|
||||
|
||||
// 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(ruleset.CreateHitObjectComposer()));
|
||||
return beatmapSkinProvider.WithChild(rulesetSkinProvider.WithChild(composer));
|
||||
}
|
||||
|
||||
return new ScreenWhiteBox.UnderConstructionMessage(ruleset == null ? "This beatmap" : $"{ruleset.Description}'s composer");
|
||||
}
|
||||
|
||||
protected override Drawable CreateTimelineContent() => new TimelineHitObjectDisplay(composer.EditorBeatmap)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user