2017-05-17 16:58:34 +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
|
|
|
|
|
|
2017-05-19 03:15:49 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Allocation;
|
2017-05-17 16:58:34 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Testing;
|
2017-05-19 03:15:49 +08:00
|
|
|
|
using osu.Game.Database;
|
2017-05-17 16:58:34 +08:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
using osu.Game.Overlays.Dialog;
|
2017-05-19 04:43:39 +08:00
|
|
|
|
using osu.Game.Overlays.Direct;
|
2017-05-17 16:58:34 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Desktop.VisualTests.Tests
|
|
|
|
|
{
|
|
|
|
|
public class TestCaseDirect : TestCase
|
|
|
|
|
{
|
|
|
|
|
public override string Description => @"osu!direct overlay";
|
|
|
|
|
|
|
|
|
|
private DirectOverlay direct;
|
2017-05-19 03:15:49 +08:00
|
|
|
|
private RulesetDatabase rulesets;
|
2017-05-17 16:58:34 +08:00
|
|
|
|
|
|
|
|
|
public override void Reset()
|
|
|
|
|
{
|
|
|
|
|
base.Reset();
|
|
|
|
|
|
|
|
|
|
Add(direct = new DirectOverlay());
|
2017-05-19 03:15:49 +08:00
|
|
|
|
newBeatmaps();
|
2017-05-19 04:43:39 +08:00
|
|
|
|
direct.ResultCounts = new ResultCounts(1, 432, 3);
|
2017-05-17 16:58:34 +08:00
|
|
|
|
|
|
|
|
|
AddStep(@"Toggle", direct.ToggleVisibility);
|
|
|
|
|
}
|
2017-05-19 03:15:49 +08:00
|
|
|
|
|
2017-05-19 04:43:39 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(RulesetDatabase rulesets)
|
2017-05-19 03:15:49 +08:00
|
|
|
|
{
|
|
|
|
|
this.rulesets = rulesets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void newBeatmaps()
|
|
|
|
|
{
|
|
|
|
|
var setInfo = new BeatmapSetInfo
|
|
|
|
|
{
|
|
|
|
|
Metadata = new BeatmapMetadata
|
|
|
|
|
{
|
|
|
|
|
Title = @"Platina",
|
|
|
|
|
Artist = @"Maaya Sakamoto",
|
|
|
|
|
Author = @"TicClick",
|
|
|
|
|
Source = @"Cardcaptor Sakura",
|
|
|
|
|
},
|
|
|
|
|
Beatmaps = new List<BeatmapInfo>(),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
setInfo.Beatmaps.Add(new BeatmapInfo
|
|
|
|
|
{
|
|
|
|
|
Ruleset = rulesets.GetRuleset(i),
|
|
|
|
|
StarDifficulty = i + 1,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var s = new List<BeatmapSetInfo>();
|
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
|
|
|
s.Add(setInfo);
|
|
|
|
|
|
|
|
|
|
direct.BeatmapSets = s;
|
|
|
|
|
}
|
2017-05-17 16:58:34 +08:00
|
|
|
|
}
|
|
|
|
|
}
|