2021-06-22 09:05:29 +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.
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
2021-07-07 15:10:24 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
2021-06-22 11:47:24 +08:00
|
|
|
using osu.Game.Beatmaps;
|
2021-06-22 09:05:29 +08:00
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
using osu.Game.Rulesets.Edit.Tools;
|
2021-06-22 11:47:24 +08:00
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osu.Game.Rulesets.UI;
|
2021-06-22 09:39:32 +08:00
|
|
|
using osu.Game.Screens.Edit.Compose.Components;
|
|
|
|
using osuTK;
|
2021-06-22 09:05:29 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Edit
|
|
|
|
{
|
|
|
|
public class CatchHitObjectComposer : HitObjectComposer<CatchHitObject>
|
|
|
|
{
|
|
|
|
public CatchHitObjectComposer(CatchRuleset ruleset)
|
|
|
|
: base(ruleset)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-07 15:10:24 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
LayerBelowRuleset.Add(new PlayfieldBorder
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
PlayfieldBorderStyle = { Value = PlayfieldBorderStyle.Corners }
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-06-22 11:47:24 +08:00
|
|
|
protected override DrawableRuleset<CatchHitObject> CreateDrawableRuleset(Ruleset ruleset, IBeatmap beatmap, IReadOnlyList<Mod> mods = null) =>
|
|
|
|
new DrawableCatchEditorRuleset(ruleset, beatmap, mods);
|
|
|
|
|
2021-06-22 11:10:16 +08:00
|
|
|
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
|
|
|
{
|
|
|
|
new FruitCompositionTool(),
|
2021-07-22 14:20:33 +08:00
|
|
|
new JuiceStreamCompositionTool(),
|
2021-06-22 11:30:09 +08:00
|
|
|
new BananaShowerCompositionTool()
|
2021-06-22 11:10:16 +08:00
|
|
|
};
|
2021-06-22 09:39:32 +08:00
|
|
|
|
|
|
|
public override SnapResult SnapScreenSpacePositionToValidTime(Vector2 screenSpacePosition)
|
|
|
|
{
|
|
|
|
var result = base.SnapScreenSpacePositionToValidTime(screenSpacePosition);
|
|
|
|
// TODO: implement position snap
|
|
|
|
result.ScreenSpacePosition.X = screenSpacePosition.X;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override ComposeBlueprintContainer CreateBlueprintContainer() => new CatchBlueprintContainer(this);
|
2021-06-22 09:05:29 +08:00
|
|
|
}
|
|
|
|
}
|