2019-01-24 08:43:03 +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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-07-03 09:18:04 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Colour;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Screens.Menu;
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2019-03-24 16:02:36 +00:00
|
|
|
|
namespace osu.Game.Tests.Visual.UserInterface
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestCaseButtonSystem : OsuTestCase
|
|
|
|
|
{
|
2018-07-03 09:18:04 +00:00
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(ButtonSystem),
|
|
|
|
|
typeof(ButtonArea),
|
|
|
|
|
typeof(Button)
|
|
|
|
|
};
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
public TestCaseButtonSystem()
|
|
|
|
|
{
|
|
|
|
|
OsuLogo logo;
|
|
|
|
|
ButtonSystem buttons;
|
|
|
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
Colour = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
},
|
|
|
|
|
buttons = new ButtonSystem(),
|
2019-04-08 06:24:09 +00:00
|
|
|
|
logo = new OsuLogo { RelativePositionAxes = Axes.Both }
|
2018-04-13 09:19:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buttons.SetOsuLogo(logo);
|
2018-07-03 09:18:04 +00:00
|
|
|
|
|
|
|
|
|
foreach (var s in Enum.GetValues(typeof(ButtonSystemState)).OfType<ButtonSystemState>().Skip(1))
|
|
|
|
|
AddStep($"State to {s}", () => buttons.State = s);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|