1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 06:52:55 +08:00

Merge branch 'master' into settingsoverlay-scrollto

This commit is contained in:
Thomas Müller 2017-07-08 12:26:08 +03:00 committed by GitHub
commit d1ae12b4f7
44 changed files with 174 additions and 246 deletions

@ -1 +1 @@
Subproject commit cd2b351de37f17b6d91d1fc062627208a09c3834 Subproject commit af9ffbd8b945e526801c469dd55464363e502962

View File

@ -12,10 +12,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Beatmap details in song select"; public override string Description => @"Beatmap details in song select";
public override void Reset() public TestCaseBeatmapDetailArea()
{ {
base.Reset();
Add(new BeatmapDetailArea Add(new BeatmapDetailArea
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -13,12 +13,10 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => "BeatmapDetails tab of BeatmapDetailArea"; public override string Description => "BeatmapDetails tab of BeatmapDetailArea";
private BeatmapDetails details; private readonly BeatmapDetails details;
public override void Reset() public TestCaseBeatmapDetails()
{ {
base.Reset();
Add(details = new BeatmapDetails Add(details = new BeatmapDetails
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Beatmap options in song select"; public override string Description => @"Beatmap options in song select";
public override void Reset() public TestCaseBeatmapOptionsOverlay()
{ {
base.Reset();
var overlay = new BeatmapOptionsOverlay(); var overlay = new BeatmapOptionsOverlay();
overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1); overlay.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, Color4.Purple, null, Key.Number1);

View File

@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"breadcrumb > control"; public override string Description => @"breadcrumb > control";
public override void Reset() public TestCaseBreadcrumbs()
{ {
base.Reset();
BreadcrumbControl<BreadcrumbTab> c; BreadcrumbControl<BreadcrumbTab> c;
Add(c = new BreadcrumbControl<BreadcrumbTab> Add(c = new BreadcrumbControl<BreadcrumbTab>
{ {

View File

@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Testing chat api and overlay"; public override string Description => @"Testing chat api and overlay";
public override void Reset() public TestCaseChatDisplay()
{ {
base.Reset();
Add(new ChatOverlay Add(new ChatOverlay
{ {
State = Visibility.Visible State = Visibility.Visible

View File

@ -21,11 +21,9 @@ namespace osu.Desktop.VisualTests.Tests
private const int start_time = 0; private const int start_time = 0;
private const int duration = 1000; private const int duration = 1000;
private MyContextMenuContainer container; public TestCaseContextMenu()
public override void Reset()
{ {
base.Reset(); MyContextMenuContainer container;
Add(container = new MyContextMenuContainer Add(container = new MyContextMenuContainer
{ {

View File

@ -12,11 +12,9 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Display dialogs"; public override string Description => @"Display dialogs";
private DialogOverlay overlay; public TestCaseDialogOverlay()
public override void Reset()
{ {
base.Reset(); DialogOverlay overlay;
Add(overlay = new DialogOverlay()); Add(overlay = new DialogOverlay());

View File

@ -16,9 +16,9 @@ namespace osu.Desktop.VisualTests.Tests
private DirectOverlay direct; private DirectOverlay direct;
private RulesetDatabase rulesets; private RulesetDatabase rulesets;
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
Add(direct = new DirectOverlay()); Add(direct = new DirectOverlay());
newBeatmaps(); newBeatmaps();

View File

@ -15,9 +15,9 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Select your favourite room"; public override string Description => @"Select your favourite room";
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
DrawableRoom first; DrawableRoom first;
DrawableRoom second; DrawableRoom second;

View File

@ -12,10 +12,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => "Tournament drawings"; public override string Description => "Tournament drawings";
public override void Reset() public TestCaseDrawings()
{ {
base.Reset();
Add(new Drawings Add(new Drawings
{ {
TeamList = new TestTeamList(), TeamList = new TestTeamList(),

View File

@ -34,9 +34,9 @@ namespace osu.Desktop.VisualTests.Tests
this.rulesets = rulesets; this.rulesets = rulesets;
} }
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
List<HitObject> objects = new List<HitObject>(); List<HitObject> objects = new List<HitObject>();

View File

@ -13,11 +13,9 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => "graph"; public override string Description => "graph";
private BarGraph graph; public TestCaseGraph()
public override void Reset()
{ {
base.Reset(); BarGraph graph;
Children = new[] Children = new[]
{ {

View File

@ -29,15 +29,58 @@ namespace osu.Desktop.VisualTests.Tests
var rateAdjustClock = new StopwatchClock(true); var rateAdjustClock = new StopwatchClock(true);
framedClock = new FramedClock(rateAdjustClock); framedClock = new FramedClock(rateAdjustClock);
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; }; playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
playbackSpeed.TriggerChange();
AddStep(@"circles", () => loadHitobjects(HitObjectType.Circle));
AddStep(@"slider", () => loadHitobjects(HitObjectType.Slider));
AddStep(@"spinner", () => loadHitobjects(HitObjectType.Spinner));
AddToggleStep(@"auto", state => { auto = state; loadHitobjects(mode); });
BasicSliderBar<double> sliderBar;
Add(new Container
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new SpriteText { Text = "Playback Speed" },
sliderBar = new BasicSliderBar<double>
{
Width = 150,
Height = 10,
SelectionColor = Color4.Orange,
}
}
});
sliderBar.Current.BindTo(playbackSpeed);
framedClock.ProcessFrame();
var clockAdjustContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Clock = framedClock,
Children = new[]
{
playfieldContainer = new Container { RelativeSizeAxes = Axes.Both },
approachContainer = new Container { RelativeSizeAxes = Axes.Both }
}
};
Add(clockAdjustContainer);
} }
private HitObjectType mode = HitObjectType.Slider; private HitObjectType mode = HitObjectType.Slider;
private readonly BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 }; private readonly BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 };
private Container playfieldContainer; private readonly Container playfieldContainer;
private Container approachContainer; private readonly Container approachContainer;
private void load(HitObjectType mode) private void loadHitobjects(HitObjectType mode)
{ {
this.mode = mode; this.mode = mode;
@ -83,54 +126,6 @@ namespace osu.Desktop.VisualTests.Tests
} }
} }
public override void Reset()
{
base.Reset();
playbackSpeed.TriggerChange();
AddStep(@"circles", () => load(HitObjectType.Circle));
AddStep(@"slider", () => load(HitObjectType.Slider));
AddStep(@"spinner", () => load(HitObjectType.Spinner));
AddToggleStep(@"auto", state => { auto = state; load(mode); });
BasicSliderBar<double> sliderBar;
Add(new Container
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new SpriteText { Text = "Playback Speed" },
sliderBar = new BasicSliderBar<double>
{
Width = 150,
Height = 10,
SelectionColor = Color4.Orange,
}
}
});
sliderBar.Current.BindTo(playbackSpeed);
framedClock.ProcessFrame();
var clockAdjustContainer = new Container
{
RelativeSizeAxes = Axes.Both,
Clock = framedClock,
Children = new[]
{
playfieldContainer = new Container { RelativeSizeAxes = Axes.Both },
approachContainer = new Container { RelativeSizeAxes = Axes.Both }
}
};
Add(clockAdjustContainer);
}
private int depth; private int depth;
private void add(DrawableOsuHitObject h) private void add(DrawableOsuHitObject h)

View File

@ -20,10 +20,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Tests key counter"; public override string Description => @"Tests key counter";
public override void Reset() public TestCaseKeyCounter()
{ {
base.Reset();
KeyCounterCollection kc = new KeyCounterCollection KeyCounterCollection kc = new KeyCounterCollection
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -16,7 +16,7 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"From song select"; public override string Description => @"From song select";
private Leaderboard leaderboard; private readonly Leaderboard leaderboard;
private void newScores() private void newScores()
{ {
@ -207,10 +207,8 @@ namespace osu.Desktop.VisualTests.Tests
leaderboard.Scores = scores; leaderboard.Scores = scores;
} }
public override void Reset() public TestCaseLeaderboard()
{ {
base.Reset();
Add(leaderboard = new Leaderboard Add(leaderboard = new Leaderboard
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
internal class TestCaseManiaHitObjects : TestCase internal class TestCaseManiaHitObjects : TestCase
{ {
public override void Reset() public TestCaseManiaHitObjects()
{ {
base.Reset();
Add(new FillFlowContainer Add(new FillFlowContainer
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,

View File

@ -25,10 +25,8 @@ namespace osu.Desktop.VisualTests.Tests
protected override double TimePerAction => 200; protected override double TimePerAction => 200;
public override void Reset() public TestCaseManiaPlayfield()
{ {
base.Reset();
Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) => Action<int, SpecialColumnPosition> createPlayfield = (cols, pos) =>
{ {
Clear(); Clear();

View File

@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Main menu button system"; public override string Description => @"Main menu button system";
public override void Reset() public TestCaseMenuButtonSystem()
{ {
base.Reset();
Add(new Box Add(new Box
{ {
ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke), ColourInfo = ColourInfo.GradientVertical(Color4.Gray, Color4.WhiteSmoke),

View File

@ -12,15 +12,12 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Tests pause and fail overlays"; public override string Description => @"Tests pause and fail overlays";
private PauseContainer.PauseOverlay pauseOverlay; public TestCaseMenuOverlays()
private FailOverlay failOverlay;
private int retryCount;
public override void Reset()
{ {
base.Reset(); FailOverlay failOverlay;
PauseContainer.PauseOverlay pauseOverlay;
retryCount = 0; var retryCount = 0;
Add(pauseOverlay = new PauseContainer.PauseOverlay Add(pauseOverlay = new PauseContainer.PauseOverlay
{ {
@ -34,14 +31,16 @@ namespace osu.Desktop.VisualTests.Tests
OnQuit = () => Logger.Log(@"Quit"), OnQuit = () => Logger.Log(@"Quit"),
}); });
AddStep(@"Pause", delegate { AddStep(@"Pause", delegate
{
if (failOverlay.State == Visibility.Visible) if (failOverlay.State == Visibility.Visible)
{ {
failOverlay.Hide(); failOverlay.Hide();
} }
pauseOverlay.Show(); pauseOverlay.Show();
}); });
AddStep("Fail", delegate { AddStep("Fail", delegate
{
if (pauseOverlay.State == Visibility.Visible) if (pauseOverlay.State == Visibility.Visible)
{ {
pauseOverlay.Hide(); pauseOverlay.Hide();

View File

@ -27,9 +27,9 @@ namespace osu.Desktop.VisualTests.Tests
this.rulesets = rulesets; this.rulesets = rulesets;
} }
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
Add(modSelect = new ModSelectOverlay Add(modSelect = new ModSelectOverlay
{ {

View File

@ -13,18 +13,11 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Tests music controller ui."; public override string Description => @"Tests music controller ui.";
private MusicController mc;
public TestCaseMusicController() public TestCaseMusicController()
{ {
Clock = new FramedClock(); Clock = new FramedClock();
}
public override void Reset() var mc = new MusicController
{
base.Reset();
Clock.ProcessFrame();
mc = new MusicController
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre Anchor = Anchor.Centre

View File

@ -16,12 +16,10 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"I handle notifications"; public override string Description => @"I handle notifications";
private NotificationManager manager; private readonly NotificationManager manager;
public override void Reset() public TestCaseNotificationManager()
{ {
base.Reset();
progressingNotifications.Clear(); progressingNotifications.Clear();
Content.Add(manager = new NotificationManager Content.Add(manager = new NotificationManager

View File

@ -15,9 +15,9 @@ namespace osu.Desktop.VisualTests.Tests
public override string Description => @"Make it easier to see setting changes"; public override string Description => @"Make it easier to see setting changes";
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
Add(new OnScreenDisplay()); Add(new OnScreenDisplay());

View File

@ -13,20 +13,19 @@ namespace osu.Desktop.VisualTests.Tests
{ {
internal class TestCasePlaySongSelect : TestCase internal class TestCasePlaySongSelect : TestCase
{ {
private BeatmapDatabase db; private readonly BeatmapDatabase db;
private TestStorage storage;
private PlaySongSelect songSelect;
public override string Description => @"with fake data"; public override string Description => @"with fake data";
private RulesetDatabase rulesets; private readonly RulesetDatabase rulesets;
public override void Reset() public TestCasePlaySongSelect()
{ {
base.Reset(); PlaySongSelect songSelect;
if (db == null) if (db == null)
{ {
storage = new TestStorage(@"TestCasePlaySongSelect"); var storage = new TestStorage(@"TestCasePlaySongSelect");
var backingDatabase = storage.GetDatabase(@"client"); var backingDatabase = storage.GetDatabase(@"client");

View File

@ -2,7 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Testing; using osu.Framework.Testing;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
@ -21,30 +20,20 @@ namespace osu.Desktop.VisualTests.Tests
internal class TestCasePlayer : TestCase internal class TestCasePlayer : TestCase
{ {
protected Player Player; protected Player Player;
private BeatmapDatabase db;
private RulesetDatabase rulesets; private RulesetDatabase rulesets;
public override string Description => @"Showing everything to play the game."; public override string Description => @"Showing everything to play the game.";
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(BeatmapDatabase db, RulesetDatabase rulesets) private void load(RulesetDatabase rulesets)
{ {
this.rulesets = rulesets; this.rulesets = rulesets;
this.db = db;
} }
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
WorkingBeatmap beatmap = null;
var beatmapInfo = db.Query<BeatmapInfo>().FirstOrDefault(b => b.RulesetID == 0);
if (beatmapInfo != null)
beatmap = db.GetWorkingBeatmap(beatmapInfo);
if (beatmap?.Track == null)
{
var objects = new List<HitObject>(); var objects = new List<HitObject>();
int time = 1500; int time = 1500;
@ -77,8 +66,7 @@ namespace osu.Desktop.VisualTests.Tests
} }
}; };
beatmap = new TestWorkingBeatmap(b); WorkingBeatmap beatmap = new TestWorkingBeatmap(b);
}
Add(new Box Add(new Box
{ {

View File

@ -13,13 +13,11 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Settings visible in replay/auto"; public override string Description => @"Settings visible in replay/auto";
private ExampleContainer container; public TestCaseReplaySettingsOverlay()
public override void Reset()
{ {
base.Reset(); ExampleContainer container;
Add(new ReplaySettingsOverlay() Add(new ReplaySettingsOverlay
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,

View File

@ -28,9 +28,9 @@ namespace osu.Desktop.VisualTests.Tests
private WorkingBeatmap beatmap; private WorkingBeatmap beatmap;
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
if (beatmap == null) if (beatmap == null)
{ {
@ -39,8 +39,6 @@ namespace osu.Desktop.VisualTests.Tests
beatmap = db.GetWorkingBeatmap(beatmapInfo); beatmap = db.GetWorkingBeatmap(beatmapInfo);
} }
base.Reset();
Add(new Results(new Score Add(new Results(new Score
{ {
TotalScore = 2845370, TotalScore = 2845370,

View File

@ -17,9 +17,9 @@ namespace osu.Desktop.VisualTests.Tests
private RulesetDatabase rulesets; private RulesetDatabase rulesets;
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
var room = new Room var room = new Room
{ {

View File

@ -15,10 +15,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Tests multiple counters"; public override string Description => @"Tests multiple counters";
public override void Reset() public TestCaseScoreCounter()
{ {
base.Reset();
int numerator = 0, denominator = 0; int numerator = 0, denominator = 0;
ScoreCounter score = new ScoreCounter(7) ScoreCounter score = new ScoreCounter(7)

View File

@ -21,16 +21,15 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => "SpeedAdjustmentContainer/DrawableTimingSection"; public override string Description => "SpeedAdjustmentContainer/DrawableTimingSection";
private SpeedAdjustmentCollection adjustmentCollection; private readonly BindableDouble timeRangeBindable;
private readonly OsuSpriteText bottomLabel;
private readonly SpriteText topTime;
private readonly SpriteText bottomTime;
private BindableDouble timeRangeBindable; public TestCaseScrollingHitObjects()
private OsuSpriteText timeRangeText;
private OsuSpriteText bottomLabel;
private SpriteText topTime, bottomTime;
public override void Reset()
{ {
base.Reset(); OsuSpriteText timeRangeText;
SpeedAdjustmentCollection adjustmentCollection;
timeRangeBindable = new BindableDouble(2000) timeRangeBindable = new BindableDouble(2000)
{ {

View File

@ -10,13 +10,16 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Tests the settings overlay"; public override string Description => @"Tests the settings overlay";
private SettingsOverlay settings; private readonly SettingsOverlay settings;
public override void Reset() public TestCaseSettings()
{ {
base.Reset();
Children = new[] { settings = new SettingsOverlay() }; Children = new[] { settings = new SettingsOverlay() };
}
protected override void LoadComplete()
{
base.LoadComplete();
settings.ToggleVisibility(); settings.ToggleVisibility();
} }
} }

View File

@ -10,9 +10,10 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Skip skip skippediskip"; public override string Description => @"Skip skip skippediskip";
public override void Reset() protected override void LoadComplete()
{ {
base.Reset(); base.LoadComplete();
Add(new SkipButton(Clock.CurrentTime + 5000)); Add(new SkipButton(Clock.CurrentTime + 5000));
} }
} }

View File

@ -11,10 +11,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"social browser overlay"; public override string Description => @"social browser overlay";
public override void Reset() public TestCaseSocial()
{ {
base.Reset();
SocialOverlay s = new SocialOverlay SocialOverlay s = new SocialOverlay
{ {
Users = new[] Users = new[]

View File

@ -15,15 +15,13 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"With fake data"; public override string Description => @"With fake data";
private SongProgress progress; private readonly SongProgress progress;
private SongProgressGraph graph; private readonly SongProgressGraph graph;
private StopwatchClock clock; private readonly StopwatchClock clock;
public override void Reset() public TestCaseSongProgress()
{ {
base.Reset();
clock = new StopwatchClock(true); clock = new StopwatchClock(true);
Add(progress = new SongProgress Add(progress = new SongProgress

View File

@ -14,10 +14,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Filter for song select"; public override string Description => @"Filter for song select";
public override void Reset() public TestCaseTabControl()
{ {
base.Reset();
OsuSpriteText text; OsuSpriteText text;
OsuTabControl<GroupMode> filter; OsuTabControl<GroupMode> filter;
Add(filter = new OsuTabControl<GroupMode> Add(filter = new OsuTabControl<GroupMode>

View File

@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
private bool kiai; private bool kiai;
public override void Reset() public TestCaseTaikoHitObjects()
{ {
base.Reset();
AddToggleStep("Kiai", b => AddToggleStep("Kiai", b =>
{ {
kiai = !kiai; kiai = !kiai;

View File

@ -26,13 +26,11 @@ namespace osu.Desktop.VisualTests.Tests
protected override double TimePerAction => default_duration * 2; protected override double TimePerAction => default_duration * 2;
private readonly Random rng = new Random(1337); private readonly Random rng = new Random(1337);
private TaikoPlayfield playfield; private readonly TaikoPlayfield playfield;
private Container playfieldContainer; private readonly Container playfieldContainer;
public override void Reset() public TestCaseTaikoPlayfield()
{ {
base.Reset();
AddStep("Hit!", addHitJudgement); AddStep("Hit!", addHitJudgement);
AddStep("Miss :(", addMissJudgement); AddStep("Miss :(", addMissJudgement);
AddStep("DrumRoll", () => addDrumRoll(false)); AddStep("DrumRoll", () => addDrumRoll(false));

View File

@ -16,10 +16,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Tests display of icons"; public override string Description => @"Tests display of icons";
public override void Reset() public TestCaseTextAwesome()
{ {
base.Reset();
FillFlowContainer flow; FillFlowContainer flow;
Add(flow = new FillFlowContainer Add(flow = new FillFlowContainer

View File

@ -10,10 +10,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Mostly back button"; public override string Description => @"Mostly back button";
public override void Reset() public TestCaseTwoLayerButton()
{ {
base.Reset();
Add(new BackButton()); Add(new BackButton());
} }
} }

View File

@ -13,10 +13,8 @@ namespace osu.Desktop.VisualTests.Tests
{ {
public override string Description => @"Panels for displaying a user's status"; public override string Description => @"Panels for displaying a user's status";
public override void Reset() public TestCaseUserPanel()
{ {
base.Reset();
UserPanel flyte; UserPanel flyte;
UserPanel peppy; UserPanel peppy;
Add(new FillFlowContainer Add(new FillFlowContainer

View File

@ -148,7 +148,7 @@ namespace osu.Game.Rulesets.UI
// Check if the beatmap can be converted // Check if the beatmap can be converted
if (!converter.CanConvert(beatmap.Beatmap)) if (!converter.CanConvert(beatmap.Beatmap))
throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can't be converted for the current ruleset."); throw new BeatmapInvalidForRulesetException($"{nameof(Beatmap)} can not be converted for the current ruleset (converter: {converter}).");
// Convert the beatmap // Convert the beatmap
Beatmap = converter.Convert(beatmap.Beatmap, isForCurrentRuleset); Beatmap = converter.Convert(beatmap.Beatmap, isForCurrentRuleset);

View File

@ -19,6 +19,10 @@ namespace osu.Game.Screens.Play
objects = value; objects = value;
const int granularity = 200; const int granularity = 200;
Values = new int[granularity];
if (!objects.Any())
return;
var firstHit = objects.First().StartTime; var firstHit = objects.First().StartTime;
var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0; var lastHit = (objects.Last() as IHasEndTime)?.EndTime ?? 0;
@ -28,8 +32,6 @@ namespace osu.Game.Screens.Play
var interval = (lastHit - firstHit + 1) / granularity; var interval = (lastHit - firstHit + 1) / granularity;
var values = new int[granularity];
foreach (var h in objects) foreach (var h in objects)
{ {
IHasEndTime end = h as IHasEndTime; IHasEndTime end = h as IHasEndTime;
@ -37,10 +39,8 @@ namespace osu.Game.Screens.Play
int startRange = (int)((h.StartTime - firstHit) / interval); int startRange = (int)((h.StartTime - firstHit) / interval);
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval); int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
for (int i = startRange; i <= endRange; i++) for (int i = startRange; i <= endRange; i++)
values[i]++; Values[i]++;
} }
Values = values;
} }
} }
} }

View File

@ -281,10 +281,13 @@ namespace osu.Game.Screens.Select
{ {
base.Dispose(isDisposing); base.Dispose(isDisposing);
if (database != null)
{
database.BeatmapSetAdded -= onBeatmapSetAdded; database.BeatmapSetAdded -= onBeatmapSetAdded;
database.BeatmapSetRemoved -= onBeatmapSetRemoved; database.BeatmapSetRemoved -= onBeatmapSetRemoved;
}
initialAddSetsTask.Cancel(); initialAddSetsTask?.Cancel();
} }
private void changeBackground(WorkingBeatmap beatmap) private void changeBackground(WorkingBeatmap beatmap)