2018-04-13 17:19:50 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2018-07-03 17:18:04 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Colour;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Screens.Menu;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestCaseButtonSystem : OsuTestCase
|
|
|
|
|
{
|
2018-07-03 17:18:04 +08:00
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(ButtonSystem),
|
|
|
|
|
typeof(ButtonArea),
|
|
|
|
|
typeof(Button)
|
|
|
|
|
};
|
|
|
|
|
|
2018-04-13 17:19:50 +08: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(),
|
|
|
|
|
logo = new OsuLogo()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
buttons.SetOsuLogo(logo);
|
2018-07-03 17:18:04 +08:00
|
|
|
|
|
|
|
|
|
foreach (var s in Enum.GetValues(typeof(ButtonSystemState)).OfType<ButtonSystemState>().Skip(1))
|
|
|
|
|
AddStep($"State to {s}", () => buttons.State = s);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|