2017-02-07 12:59:30 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-10-24 10:22:38 +08:00
|
|
|
|
|
2017-08-01 23:28:18 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Configuration;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2017-08-01 23:28:18 +08:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Testing;
|
2016-10-24 18:18:54 +08:00
|
|
|
|
using osu.Framework.Timing;
|
2017-07-14 18:54:37 +08:00
|
|
|
|
using osu.Game;
|
|
|
|
|
using osu.Game.Beatmaps;
|
2016-11-14 17:54:24 +08:00
|
|
|
|
using osu.Game.Overlays;
|
2016-10-24 10:22:38 +08:00
|
|
|
|
|
2016-11-14 17:54:24 +08:00
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
2016-10-24 10:22:38 +08:00
|
|
|
|
{
|
2017-03-07 09:59:19 +08:00
|
|
|
|
internal class TestCaseMusicController : TestCase
|
2016-10-24 10:22:38 +08:00
|
|
|
|
{
|
|
|
|
|
public override string Description => @"Tests music controller ui.";
|
|
|
|
|
|
2017-07-14 18:54:37 +08:00
|
|
|
|
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
|
|
|
|
|
2016-11-13 01:34:36 +08:00
|
|
|
|
public TestCaseMusicController()
|
2016-10-24 18:18:54 +08:00
|
|
|
|
{
|
2016-11-20 19:16:54 +08:00
|
|
|
|
Clock = new FramedClock();
|
2016-10-24 18:18:54 +08:00
|
|
|
|
|
2017-07-08 17:17:47 +08:00
|
|
|
|
var mc = new MusicController
|
2016-10-24 10:22:38 +08:00
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre
|
|
|
|
|
};
|
|
|
|
|
Add(mc);
|
2017-04-07 12:04:57 +08:00
|
|
|
|
|
|
|
|
|
AddToggleStep(@"toggle visibility", state => mc.State = state ? Visibility.Visible : Visibility.Hidden);
|
|
|
|
|
AddStep(@"show", () => mc.State = Visibility.Visible);
|
2017-07-14 18:54:37 +08:00
|
|
|
|
AddToggleStep(@"toggle beatmap lock", state => beatmapBacking.Disabled = state);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuGameBase game)
|
|
|
|
|
{
|
|
|
|
|
beatmapBacking.BindTo(game.Beatmap);
|
2016-10-24 10:22:38 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|