osu/osu.Game.Rulesets.Mania.Tests/Skinning/ManiaHitObjectTestScene.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

75 lines
2.7 KiB
C#
Raw Normal View History

2020-03-30 14:02:07 +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.
2022-06-17 07:37:17 +00:00
#nullable disable
2020-11-13 13:31:07 +00:00
using NUnit.Framework;
2020-03-30 14:02:07 +00:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.UI.Scrolling;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Mania.Tests.Skinning
{
/// <summary>
/// A test scene for a mania hitobject.
/// </summary>
public abstract class ManiaHitObjectTestScene : ManiaSkinnableTestScene
{
2020-11-13 13:31:07 +00:00
[SetUp]
public void SetUp() => Schedule(() =>
2020-03-30 14:02:07 +00:00
{
SetContents(_ => new FillFlowContainer
2020-03-30 14:02:07 +00:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Height = 0.7f,
Direction = FillDirection.Horizontal,
Children = new Drawable[]
{
new ColumnTestContainer(0, ManiaAction.Key1, true)
2020-03-30 14:02:07 +00:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Y,
Width = 80,
Child = new ScrollingHitObjectContainer
{
RelativeSizeAxes = Axes.Both,
}.With(c =>
{
2020-04-02 07:36:57 +00:00
c.Add(CreateHitObject().With(h =>
{
2021-09-15 06:22:27 +00:00
h.HitObject.StartTime = Time.Current + 5000;
2020-04-02 07:36:57 +00:00
h.AccentColour.Value = Color4.Orange;
}));
2020-03-30 14:02:07 +00:00
})
},
new ColumnTestContainer(1, ManiaAction.Key2, true)
2020-03-30 14:02:07 +00:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Y,
Width = 80,
Child = new ScrollingHitObjectContainer
{
RelativeSizeAxes = Axes.Both,
}.With(c =>
{
2020-04-02 07:36:57 +00:00
c.Add(CreateHitObject().With(h =>
{
2021-09-15 06:22:27 +00:00
h.HitObject.StartTime = Time.Current + 5000;
2020-04-02 07:36:57 +00:00
h.AccentColour.Value = Color4.Orange;
}));
2020-03-30 14:02:07 +00:00
})
},
}
});
2020-11-13 13:31:07 +00:00
});
2020-03-30 14:02:07 +00:00
protected abstract DrawableManiaHitObject CreateHitObject();
}
}