osu/osu.Game.Tests/Visual/TestCaseIntroSequence.cs

55 lines
1.6 KiB
C#
Raw Normal View History

2018-01-05 11:21:19 +00:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
2017-10-26 11:42:23 +00:00
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-11-01 08:07:03 +00:00
using System;
using System.Collections.Generic;
2018-03-02 06:34:31 +00:00
using NUnit.Framework;
2017-10-26 11:42:23 +00:00
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Timing;
using osu.Game.Screens.Menu;
namespace osu.Game.Tests.Visual
{
2018-03-02 06:34:31 +00:00
[TestFixture]
2017-11-03 08:54:35 +00:00
public class TestCaseIntroSequence : OsuTestCase
2017-10-26 11:42:23 +00:00
{
2017-11-01 08:07:03 +00:00
public override IReadOnlyList<Type> RequiredTypes => new[]
{
2017-11-03 08:54:35 +00:00
typeof(OsuLogo),
2017-11-01 08:07:03 +00:00
};
2017-11-03 08:54:35 +00:00
public TestCaseIntroSequence()
2017-10-26 11:42:23 +00:00
{
2017-11-03 08:54:35 +00:00
OsuLogo logo;
2017-10-26 11:42:23 +00:00
var rateAdjustClock = new StopwatchClock(true);
var framedClock = new FramedClock(rateAdjustClock);
framedClock.ProcessFrame();
Add(new Container
{
RelativeSizeAxes = Axes.Both,
Clock = framedClock,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
2017-11-03 08:54:35 +00:00
logo = new OsuLogo
{
Anchor = Anchor.Centre,
}
2017-10-26 11:42:23 +00:00
}
});
2017-11-03 08:54:35 +00:00
AddStep(@"Restart", logo.PlayIntro);
2017-10-26 11:42:23 +00:00
AddSliderStep("Playback speed", 0.0, 2.0, 1, v => rateAdjustClock.Rate = v);
}
}
}