mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 16:52:55 +08:00
Add a testcase
This commit is contained in:
parent
0c48aec265
commit
8dea191998
48
osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs
Normal file
48
osu.Game.Tests/Visual/Online/TestSceneGamemodeControl.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// 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 osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Overlays.Profile.Header.Components;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Online
|
||||||
|
{
|
||||||
|
public class TestSceneGamemodeControl : OsuTestScene
|
||||||
|
{
|
||||||
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
|
{
|
||||||
|
typeof(GamemodeControl),
|
||||||
|
typeof(GamemodeTabItem),
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly GamemodeControl control;
|
||||||
|
|
||||||
|
public TestSceneGamemodeControl()
|
||||||
|
{
|
||||||
|
Child = control = new GamemodeControl
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
};
|
||||||
|
|
||||||
|
AddStep("set osu! as default", () => control.SetDefaultGamemode("osu"));
|
||||||
|
AddStep("set mania as default", () => control.SetDefaultGamemode("mania"));
|
||||||
|
AddStep("set taiko as default", () => control.SetDefaultGamemode("taiko"));
|
||||||
|
AddStep("set catch as default", () => control.SetDefaultGamemode("fruits"));
|
||||||
|
AddStep("select default gamemode", () => control.SelectDefaultGamemode());
|
||||||
|
|
||||||
|
AddStep("set random colour", () => control.AccentColour = new Color4(RNG.NextSingle(), RNG.NextSingle(), RNG.NextSingle(), 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours)
|
||||||
|
{
|
||||||
|
control.AccentColour = colours.Seafoam;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user