2019-09-11 17:12:43 +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.Collections.Generic;
|
2020-04-01 18:19:32 +08:00
|
|
|
using System.Linq;
|
2019-09-11 17:12:43 +08:00
|
|
|
using NUnit.Framework;
|
2020-04-01 18:19:32 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
2019-09-11 17:12:43 +08:00
|
|
|
using osu.Framework.Graphics;
|
2020-04-01 18:19:32 +08:00
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-09-11 17:12:43 +08:00
|
|
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
|
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2020-04-01 18:19:32 +08:00
|
|
|
using osu.Game.Skinning;
|
2019-09-11 17:12:43 +08:00
|
|
|
using osuTK;
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
2020-04-01 18:19:32 +08:00
|
|
|
namespace osu.Game.Rulesets.Mania.Tests.Skinning
|
2019-09-11 17:12:43 +08:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2020-04-01 18:19:32 +08:00
|
|
|
public class TestSceneHitExplosion : ManiaSkinnableTestScene
|
2019-09-11 17:12:43 +08:00
|
|
|
{
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
{
|
|
|
|
typeof(DrawableNote),
|
|
|
|
typeof(DrawableManiaHitObject),
|
|
|
|
};
|
|
|
|
|
2020-04-01 18:19:32 +08:00
|
|
|
public TestSceneHitExplosion()
|
2019-09-11 17:12:43 +08:00
|
|
|
{
|
|
|
|
int runcount = 0;
|
|
|
|
|
|
|
|
AddRepeatStep("explode", () =>
|
|
|
|
{
|
|
|
|
runcount++;
|
|
|
|
|
|
|
|
if (runcount % 15 > 12)
|
|
|
|
return;
|
|
|
|
|
2020-04-01 18:19:32 +08:00
|
|
|
CreatedDrawables.OfType<Container>().ForEach(c =>
|
2019-09-11 17:12:43 +08:00
|
|
|
{
|
2020-04-02 17:39:49 +08:00
|
|
|
c.Add(new SkinnableDrawable(new ManiaSkinComponent(ManiaSkinComponents.HitExplosion, 0),
|
2020-04-01 18:19:32 +08:00
|
|
|
_ => new DefaultHitExplosion((runcount / 15) % 2 == 0 ? new Color4(94, 0, 57, 255) : new Color4(6, 84, 0, 255), runcount % 6 != 0)
|
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
}));
|
2019-09-11 17:12:43 +08:00
|
|
|
});
|
|
|
|
}, 100);
|
|
|
|
}
|
2020-04-01 18:19:32 +08:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
2020-04-02 11:01:07 +08:00
|
|
|
SetContents(() => new ColumnTestContainer(0, ManiaAction.Key1)
|
2020-04-01 18:19:32 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
RelativePositionAxes = Axes.Y,
|
|
|
|
Y = -0.25f,
|
|
|
|
Size = new Vector2(Column.COLUMN_WIDTH, DefaultNotePiece.NOTE_HEIGHT),
|
|
|
|
});
|
|
|
|
}
|
2019-09-11 17:12:43 +08:00
|
|
|
}
|
|
|
|
}
|