2021-08-26 14:44:53 +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;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Testing;
|
2022-08-31 13:07:55 +08:00
|
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2021-11-29 16:57:17 +08:00
|
|
|
|
using osu.Game.Database;
|
2022-05-25 05:14:28 +08:00
|
|
|
|
using osu.Game.Overlays;
|
2021-08-26 14:44:53 +08:00
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
|
|
|
|
using osu.Game.Screens.Edit;
|
|
|
|
|
using osu.Game.Screens.Edit.Compose;
|
|
|
|
|
using osu.Game.Skinning;
|
|
|
|
|
using osu.Game.Tests.Visual;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Editor
|
|
|
|
|
{
|
|
|
|
|
public partial class TestSceneManiaComposeScreen : EditorClockTestScene
|
|
|
|
|
{
|
|
|
|
|
[Resolved]
|
|
|
|
|
private SkinManager skins { get; set; } = null!;
|
|
|
|
|
|
2021-11-10 19:36:23 +08:00
|
|
|
|
[Cached]
|
|
|
|
|
private EditorClipboard clipboard = new EditorClipboard();
|
2021-11-08 22:27:11 +08:00
|
|
|
|
|
2021-08-26 14:44:53 +08:00
|
|
|
|
[SetUpSteps]
|
|
|
|
|
public void SetUpSteps()
|
|
|
|
|
{
|
|
|
|
|
AddStep("setup compose screen", () =>
|
|
|
|
|
{
|
2022-10-05 18:14:31 +08:00
|
|
|
|
var beatmap = new ManiaBeatmap(new StageDefinition(4))
|
2021-08-26 14:44:53 +08:00
|
|
|
|
{
|
|
|
|
|
BeatmapInfo = { Ruleset = new ManiaRuleset().RulesetInfo },
|
2022-08-31 13:07:55 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
beatmap.ControlPointInfo.Add(0, new TimingControlPoint());
|
|
|
|
|
|
|
|
|
|
var editorBeatmap = new EditorBeatmap(beatmap, new LegacyBeatmapSkin(beatmap.BeatmapInfo, null));
|
2021-08-26 14:44:53 +08:00
|
|
|
|
|
|
|
|
|
Beatmap.Value = CreateWorkingBeatmap(editorBeatmap.PlayableBeatmap);
|
|
|
|
|
|
|
|
|
|
Child = new DependencyProvidingContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
CachedDependencies = new (Type, object)[]
|
|
|
|
|
{
|
|
|
|
|
(typeof(EditorBeatmap), editorBeatmap),
|
|
|
|
|
(typeof(IBeatSnapProvider), editorBeatmap),
|
2022-05-25 05:14:28 +08:00
|
|
|
|
(typeof(OverlayColourProvider), new OverlayColourProvider(OverlayColourScheme.Green)),
|
2021-08-26 14:44:53 +08:00
|
|
|
|
},
|
2022-08-31 13:07:55 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
editorBeatmap,
|
|
|
|
|
new ComposeScreen { State = { Value = Visibility.Visible } },
|
|
|
|
|
}
|
2021-08-26 14:44:53 +08:00
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AddUntilStep("wait for composer", () => this.ChildrenOfType<HitObjectComposer>().SingleOrDefault()?.IsLoaded == true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestDefaultSkin()
|
|
|
|
|
{
|
2022-09-17 23:14:49 +08:00
|
|
|
|
AddStep("set default skin", () => skins.CurrentSkinInfo.Value = TrianglesSkin.CreateInfo().ToLiveUnmanaged());
|
2021-08-26 14:44:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void TestLegacySkin()
|
|
|
|
|
{
|
2021-12-14 13:21:23 +08:00
|
|
|
|
AddStep("set legacy skin", () => skins.CurrentSkinInfo.Value = DefaultLegacySkin.CreateInfo().ToLiveUnmanaged());
|
2021-08-26 14:44:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|