mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 10:12:54 +08:00
Add ability to change background colour in song progress test scene
This commit is contained in:
parent
024a64e52c
commit
c9f9569e4a
@ -7,12 +7,15 @@ using NUnit.Framework;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Rulesets.Osu;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
@ -21,6 +24,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
private GameplayClockContainer gameplayClockContainer = null!;
|
||||
|
||||
private Box background = null!;
|
||||
|
||||
private const double skip_target_time = -2000;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -30,12 +35,21 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
FrameStabilityContainer frameStabilityContainer;
|
||||
|
||||
Add(gameplayClockContainer = new MasterGameplayClockContainer(Beatmap.Value, skip_target_time)
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
background = new Box
|
||||
{
|
||||
Colour = Color4.Black,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Depth = float.MaxValue
|
||||
},
|
||||
gameplayClockContainer = new MasterGameplayClockContainer(Beatmap.Value, skip_target_time)
|
||||
{
|
||||
Child = frameStabilityContainer = new FrameStabilityContainer
|
||||
{
|
||||
MaxCatchUpFrames = 1
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Dependencies.CacheAs<IGameplayClock>(gameplayClockContainer);
|
||||
@ -71,6 +85,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
applyToArgonProgress(s => s.ShowGraph.Value = b);
|
||||
});
|
||||
|
||||
AddStep("set white background", () => background.FadeColour(Color4.White, 200, Easing.OutQuint));
|
||||
AddStep("randomise background colour", () => background.FadeColour(new Colour4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1), 200, Easing.OutQuint));
|
||||
|
||||
AddStep("stop", gameplayClockContainer.Stop);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user