2019-01-24 17:43:03 +09: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-11-12 19:41:06 +09:00
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2019-04-10 17:54:57 +09:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
2018-11-12 19:41:06 +09:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Timing;
|
2020-05-21 14:25:37 +09:00
|
|
|
using osu.Game.Rulesets.Edit;
|
2022-10-05 19:14:31 +09:00
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
2018-11-12 19:41:06 +09:00
|
|
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2019-04-10 17:54:57 +09:00
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-11-12 19:41:06 +09:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
|
|
|
using osu.Game.Tests.Visual;
|
2018-11-26 10:44:48 +09:00
|
|
|
using osuTK.Graphics;
|
2018-11-12 19:41:06 +09:00
|
|
|
|
2020-09-25 18:48:04 +09:00
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Editor
|
2018-11-12 19:41:06 +09:00
|
|
|
{
|
2020-05-27 23:15:16 +09:00
|
|
|
public abstract partial class ManiaPlacementBlueprintTestScene : PlacementBlueprintTestScene
|
2018-11-12 19:41:06 +09:00
|
|
|
{
|
|
|
|
private readonly Column column;
|
|
|
|
|
2019-04-10 17:54:57 +09:00
|
|
|
[Cached(typeof(IReadOnlyList<Mod>))]
|
|
|
|
private IReadOnlyList<Mod> mods { get; set; } = Array.Empty<Mod>();
|
|
|
|
|
2019-10-03 18:21:00 +09:00
|
|
|
[Cached(typeof(IScrollingInfo))]
|
|
|
|
private IScrollingInfo scrollingInfo;
|
|
|
|
|
2022-10-05 19:14:31 +09:00
|
|
|
[Cached]
|
|
|
|
private readonly StageDefinition stage = new StageDefinition(5);
|
|
|
|
|
2019-05-14 22:37:25 +03:00
|
|
|
protected ManiaPlacementBlueprintTestScene()
|
2018-11-12 19:41:06 +09:00
|
|
|
{
|
2019-10-03 18:21:00 +09:00
|
|
|
scrollingInfo = ((ScrollingTestContainer)HitObjectContainer).ScrollingInfo;
|
|
|
|
|
2022-10-04 18:24:49 +09:00
|
|
|
Add(column = new Column(0, false)
|
2018-11-12 19:41:06 +09:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2022-10-05 20:02:02 +09:00
|
|
|
AccentColour = { Value = Color4.OrangeRed },
|
2018-11-12 19:41:06 +09:00
|
|
|
Clock = new FramedClock(new StopwatchClock()), // No scroll
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-05-21 14:25:37 +09:00
|
|
|
protected override SnapResult SnapForBlueprint(PlacementBlueprint blueprint)
|
|
|
|
{
|
2021-10-27 13:04:41 +09:00
|
|
|
double time = column.TimeAtScreenSpacePosition(InputManager.CurrentState.Mouse.Position);
|
2020-05-21 14:25:37 +09:00
|
|
|
var pos = column.ScreenSpacePositionAtTime(time);
|
|
|
|
|
2020-05-25 19:21:53 +09:00
|
|
|
return new SnapResult(pos, time, column);
|
2020-05-21 14:25:37 +09:00
|
|
|
}
|
|
|
|
|
2018-11-12 19:41:06 +09:00
|
|
|
protected override Container CreateHitObjectContainer() => new ScrollingTestContainer(ScrollingDirection.Down) { RelativeSizeAxes = Axes.Both };
|
|
|
|
|
|
|
|
protected override void AddHitObject(DrawableHitObject hitObject) => column.Add((DrawableManiaHitObject)hitObject);
|
|
|
|
|
2020-05-22 11:35:26 +09:00
|
|
|
public ManiaPlayfield Playfield => null;
|
2018-11-12 19:41:06 +09:00
|
|
|
}
|
|
|
|
}
|