2021-07-08 06:42:29 +00: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.
|
|
|
|
|
|
2021-07-19 13:33:03 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2021-07-08 06:42:29 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-07-19 13:33:03 +00:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2021-07-08 06:42:29 +00:00
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2021-07-19 13:33:03 +00:00
|
|
|
|
using osu.Game.Screens.Edit;
|
2021-07-08 06:42:29 +00:00
|
|
|
|
using osu.Game.Tests.Visual;
|
2021-07-19 13:33:03 +00:00
|
|
|
|
using osuTK;
|
2021-07-08 06:42:29 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Tests.Editor
|
|
|
|
|
{
|
|
|
|
|
public abstract partial class CatchSelectionBlueprintTestScene : SelectionBlueprintTestScene
|
|
|
|
|
{
|
|
|
|
|
protected ScrollingHitObjectContainer HitObjectContainer => contentContainer.Playfield.HitObjectContainer;
|
|
|
|
|
|
|
|
|
|
protected override Container<Drawable> Content => contentContainer;
|
|
|
|
|
|
2021-07-19 13:33:03 +00:00
|
|
|
|
[Cached(typeof(EditorBeatmap))]
|
|
|
|
|
[Cached(typeof(IBeatSnapProvider))]
|
|
|
|
|
protected readonly EditorBeatmap EditorBeatmap;
|
|
|
|
|
|
2021-07-08 06:42:29 +00:00
|
|
|
|
private readonly CatchEditorTestSceneContainer contentContainer;
|
|
|
|
|
|
|
|
|
|
protected CatchSelectionBlueprintTestScene()
|
|
|
|
|
{
|
2022-05-02 13:51:28 +00:00
|
|
|
|
var catchBeatmap = new CatchBeatmap
|
2022-01-12 14:17:35 +00:00
|
|
|
|
{
|
|
|
|
|
BeatmapInfo =
|
|
|
|
|
{
|
|
|
|
|
Ruleset = new CatchRuleset().RulesetInfo,
|
|
|
|
|
}
|
2022-05-02 13:51:28 +00:00
|
|
|
|
};
|
|
|
|
|
EditorBeatmap = new EditorBeatmap(catchBeatmap) { Difficulty = { CircleSize = 0 } };
|
2021-07-19 13:33:03 +00:00
|
|
|
|
EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint
|
|
|
|
|
{
|
|
|
|
|
BeatLength = 100
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
base.Content.Add(new EditorBeatmapDependencyContainer(EditorBeatmap, new BindableBeatDivisor())
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
EditorBeatmap,
|
|
|
|
|
contentContainer = new CatchEditorTestSceneContainer()
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void AddMouseMoveStep(double time, float x) => AddStep($"move to time={time}, x={x}", () =>
|
|
|
|
|
{
|
|
|
|
|
float y = HitObjectContainer.PositionAtTime(time);
|
|
|
|
|
Vector2 pos = HitObjectContainer.ToScreenSpace(new Vector2(x, y + HitObjectContainer.DrawHeight));
|
|
|
|
|
InputManager.MoveMouseTo(pos);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
private partial class EditorBeatmapDependencyContainer : Container
|
|
|
|
|
{
|
|
|
|
|
[Cached]
|
|
|
|
|
private readonly EditorClock editorClock;
|
|
|
|
|
|
|
|
|
|
[Cached]
|
|
|
|
|
private readonly BindableBeatDivisor beatDivisor;
|
|
|
|
|
|
2022-08-17 06:40:01 +00:00
|
|
|
|
protected override Container<Drawable> Content { get; } = new Container { RelativeSizeAxes = Axes.Both };
|
|
|
|
|
|
2021-07-19 13:33:03 +00:00
|
|
|
|
public EditorBeatmapDependencyContainer(IBeatmap beatmap, BindableBeatDivisor beatDivisor)
|
|
|
|
|
{
|
|
|
|
|
this.beatDivisor = beatDivisor;
|
2022-08-17 06:40:01 +00:00
|
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
editorClock = new EditorClock(beatmap, beatDivisor),
|
|
|
|
|
Content,
|
|
|
|
|
};
|
2021-07-19 13:33:03 +00:00
|
|
|
|
}
|
2021-07-08 06:42:29 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|