2018-04-13 18:19:50 +09:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using osu.Framework.Graphics;
|
2018-09-21 14:02:32 +09:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-04-13 18:19:50 +09:00
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
using osu.Game.Rulesets.Edit.Tools;
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2018-11-07 16:08:56 +09:00
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners;
|
2018-10-17 18:01:38 +09:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-04-13 18:19:50 +09:00
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
2018-10-17 18:01:38 +09:00
|
|
|
using osu.Game.Rulesets.UI;
|
2018-11-16 17:12:24 +09:00
|
|
|
using osu.Game.Screens.Edit.Compose.Components;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit
|
|
|
|
{
|
2018-10-17 18:01:38 +09:00
|
|
|
public class OsuHitObjectComposer : HitObjectComposer<OsuHitObject>
|
2018-04-13 18:19:50 +09:00
|
|
|
{
|
|
|
|
public OsuHitObjectComposer(Ruleset ruleset)
|
|
|
|
: base(ruleset)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-10-17 18:01:38 +09:00
|
|
|
protected override RulesetContainer<OsuHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
|
|
|
=> new OsuEditRulesetContainer(ruleset, beatmap);
|
2018-04-13 18:19:50 +09:00
|
|
|
|
2018-10-04 13:44:49 +09:00
|
|
|
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
2018-04-13 18:19:50 +09:00
|
|
|
{
|
2018-10-03 16:27:26 +09:00
|
|
|
new HitCircleCompositionTool(),
|
2018-10-04 13:44:49 +09:00
|
|
|
new SliderCompositionTool(),
|
2018-10-29 18:35:46 +09:00
|
|
|
new SpinnerCompositionTool()
|
2018-04-13 18:19:50 +09:00
|
|
|
};
|
|
|
|
|
2018-11-19 16:58:11 +09:00
|
|
|
public override SelectionHandler CreateSelectionHandler() => new OsuSelectionHandler();
|
2018-11-16 17:12:24 +09:00
|
|
|
|
2018-10-05 10:39:18 +09:00
|
|
|
protected override Container CreateLayerContainer() => new PlayfieldAdjustmentContainer { RelativeSizeAxes = Axes.Both };
|
2018-04-13 18:19:50 +09:00
|
|
|
|
2018-11-06 18:03:21 +09:00
|
|
|
public override SelectionBlueprint CreateBlueprintFor(DrawableHitObject hitObject)
|
2018-04-13 18:19:50 +09:00
|
|
|
{
|
|
|
|
switch (hitObject)
|
|
|
|
{
|
|
|
|
case DrawableHitCircle circle:
|
2018-11-06 17:56:04 +09:00
|
|
|
return new HitCircleSelectionBlueprint(circle);
|
2018-04-13 18:19:50 +09:00
|
|
|
case DrawableSlider slider:
|
2018-11-06 17:56:04 +09:00
|
|
|
return new SliderSelectionBlueprint(slider);
|
2018-10-29 18:23:23 +09:00
|
|
|
case DrawableSpinner spinner:
|
2018-11-06 17:56:04 +09:00
|
|
|
return new SpinnerSelectionBlueprint(spinner);
|
2018-04-13 18:19:50 +09:00
|
|
|
}
|
|
|
|
|
2018-11-06 18:03:21 +09:00
|
|
|
return base.CreateBlueprintFor(hitObject);
|
2018-04-13 18:19:50 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|