From b020fe0d50c82a2eb2d38ff716c4546e90532417 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 23 Jun 2017 08:36:47 +0300 Subject: [PATCH 01/13] Added TestCase --- .../Tests/TestCaseBeatSyncedContainer.cs | 186 ++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs new file mode 100644 index 0000000000..a8fa8bf218 --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -0,0 +1,186 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Testing; +using osu.Framework.Graphics; +using osu.Framework.Timing; +using osu.Game.Overlays; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Containers; +using osu.Framework.Audio.Track; +using osu.Game.Beatmaps.ControlPoints; +using osu.Framework.Graphics.Shapes; +using OpenTK.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Framework.Lists; +using System; +using System.Globalization; + +namespace osu.Desktop.VisualTests.Tests +{ + internal class TestCaseBeatSyncedContainer : TestCase + { + public override string Description => @"Tests beat synced containers."; + + private MusicController mc; + + public TestCaseBeatSyncedContainer() + { + Clock = new FramedClock(); + } + + public override void Reset() + { + base.Reset(); + Clock.ProcessFrame(); + + Add(new BeatContainer + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + }); + + Add(mc = new MusicController + { + Origin = Anchor.TopRight, + Anchor = Anchor.TopRight, + }); + mc.State = Visibility.Visible; + } + + private class BeatContainer : BeatSyncedContainer + { + private const int flash_layer_heigth = 150; + + private readonly InfoString timingPointCount; + private readonly InfoString currentTimingPoint; + private readonly InfoString beatCount; + private readonly InfoString currentBeat; + private readonly InfoString beatsPerMinute; + private readonly InfoString beatLength; + + private readonly Box flashLayer; + + public BeatContainer() + { + RelativeSizeAxes = Axes.X; + AutoSizeAxes = Axes.Y; + Children = new Drawable[] + { + new FillFlowContainer + { + Name = @"Info Layer", + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Direction = FillDirection.Vertical, + AutoSizeAxes = Axes.Both, + Margin = new MarginPadding { Bottom = flash_layer_heigth, }, + Children = new Drawable[] + { + timingPointCount = new InfoString(@"Timing points amount: "), + currentTimingPoint = new InfoString(@"Current timing point: "), + beatCount = new InfoString(@"Beats amount (in the current timing point): "), + currentBeat = new InfoString(@"Current beat: "), + beatsPerMinute = new InfoString(@"BPM: "), + beatLength = new InfoString(@"Beat length: "), + } + }, + new Container + { + Name = @"Color indicator", + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.X, + Height = flash_layer_heigth, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + }, + flashLayer = new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + Alpha = 0, + } + } + } + }; + + Beatmap.ValueChanged += delegate + { + timingPointCount.Value = 0; + currentTimingPoint.Value = 0; + beatCount.Value = 0; + currentBeat.Value = 0; + beatsPerMinute.Value = 0; + beatLength.Value = 0; + }; + } + + private SortedList timingPoints => Beatmap.Value.Beatmap.ControlPointInfo.TimingPoints; + private TimingControlPoint getNextTimingPoint(TimingControlPoint current) + { + if (timingPoints[timingPoints.Count - 1] == current) + return current; + + return timingPoints[timingPoints.IndexOf(current) + 1]; + } + + private int calculateBeatCount(TimingControlPoint current) + { + if (timingPoints.IndexOf(current) + 1 == timingPoints.Count) + return (int)Math.Ceiling((Beatmap.Value.Track.Length - current.Time) / current.BeatLength); + + return (int)Math.Ceiling((getNextTimingPoint(current).Time - current.Time) / current.BeatLength); + } + + protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint, EffectControlPoint effectPoint, TrackAmplitudes amplitudes) + { + base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); + + timingPointCount.Value = timingPoints.Count; + currentTimingPoint.Value = timingPoints.IndexOf(timingPoint) + 1; + beatCount.Value = calculateBeatCount(timingPoint); + currentBeat.Value = beatIndex + 1; + beatsPerMinute.Value = (float)Math.Round(60000 / timingPoint.BeatLength, 1); + beatLength.Value = (float)timingPoint.BeatLength; + + flashLayer.ClearTransforms(); + flashLayer.FadeTo(1); + flashLayer.FadeTo(0, timingPoint.BeatLength); + } + } + + private class InfoString : FillFlowContainer + { + private const int text_size = 20; + private const int margin = 7; + + private readonly OsuSpriteText valueText; + + private float? value; + public float Value + { + set + { + if (value == this.value) return; + this.value = value; + + valueText.Text = value.ToString(CultureInfo.CurrentCulture); + } + } + + public InfoString(string header) + { + AutoSizeAxes = Axes.Both; + Direction = FillDirection.Horizontal; + Add(new OsuSpriteText { Text = header, TextSize = text_size }); + Add(valueText = new OsuSpriteText() { TextSize = text_size }); + Margin = new MarginPadding { Vertical = margin, }; + } + } + } +} From 608f3fe8c5d5744da212d552f7e755d5b9494cab Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 23 Jun 2017 08:41:48 +0300 Subject: [PATCH 02/13] oops --- osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index de84e567d2..bd333c4df9 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -187,6 +187,7 @@ + From a59af5b0054a10c2f5f1f2b89bccaf37c56b8fa6 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 23 Jun 2017 10:01:28 +0300 Subject: [PATCH 03/13] Applied suggested changes --- .../Tests/TestCaseBeatSyncedContainer.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index a8fa8bf218..d70e60cd93 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -57,7 +57,7 @@ namespace osu.Desktop.VisualTests.Tests private readonly InfoString beatCount; private readonly InfoString currentBeat; private readonly InfoString beatsPerMinute; - private readonly InfoString beatLength; + private readonly InfoString adjustedBeatLength; private readonly Box flashLayer; @@ -77,12 +77,12 @@ namespace osu.Desktop.VisualTests.Tests Margin = new MarginPadding { Bottom = flash_layer_heigth, }, Children = new Drawable[] { - timingPointCount = new InfoString(@"Timing points amount: "), - currentTimingPoint = new InfoString(@"Current timing point: "), - beatCount = new InfoString(@"Beats amount (in the current timing point): "), - currentBeat = new InfoString(@"Current beat: "), - beatsPerMinute = new InfoString(@"BPM: "), - beatLength = new InfoString(@"Beat length: "), + timingPointCount = new InfoString(@"Timing points amount"), + currentTimingPoint = new InfoString(@"Current timing point"), + beatCount = new InfoString(@"Beats amount (in the current timing point)"), + currentBeat = new InfoString(@"Current beat"), + beatsPerMinute = new InfoString(@"BPM"), + adjustedBeatLength = new InfoString(@"Beat length"), } }, new Container @@ -116,7 +116,7 @@ namespace osu.Desktop.VisualTests.Tests beatCount.Value = 0; currentBeat.Value = 0; beatsPerMinute.Value = 0; - beatLength.Value = 0; + adjustedBeatLength.Value = 0; }; } @@ -146,7 +146,7 @@ namespace osu.Desktop.VisualTests.Tests beatCount.Value = calculateBeatCount(timingPoint); currentBeat.Value = beatIndex + 1; beatsPerMinute.Value = (float)Math.Round(60000 / timingPoint.BeatLength, 1); - beatLength.Value = (float)timingPoint.BeatLength; + adjustedBeatLength.Value = (float)timingPoint.BeatLength; flashLayer.ClearTransforms(); flashLayer.FadeTo(1); @@ -177,7 +177,7 @@ namespace osu.Desktop.VisualTests.Tests { AutoSizeAxes = Axes.Both; Direction = FillDirection.Horizontal; - Add(new OsuSpriteText { Text = header, TextSize = text_size }); + Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size }); Add(valueText = new OsuSpriteText() { TextSize = text_size }); Margin = new MarginPadding { Vertical = margin, }; } From 3150bdb54b75d33b76a98f92dd1dd8fed63ee7ba Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Fri, 23 Jun 2017 14:56:43 +0300 Subject: [PATCH 04/13] Fixed wrong display string --- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index d70e60cd93..c0d2b04bcb 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -82,7 +82,7 @@ namespace osu.Desktop.VisualTests.Tests beatCount = new InfoString(@"Beats amount (in the current timing point)"), currentBeat = new InfoString(@"Current beat"), beatsPerMinute = new InfoString(@"BPM"), - adjustedBeatLength = new InfoString(@"Beat length"), + adjustedBeatLength = new InfoString(@"Adjusted beat length"), } }, new Container From 105d57a697530bd743d7a4cf206594bd93c093c8 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 9 Jul 2017 13:39:48 +0300 Subject: [PATCH 05/13] Update Testcase inline with framework --- .../Tests/TestCaseBeatSyncedContainer.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index c0d2b04bcb..9bf307b1ce 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -15,6 +15,7 @@ using osu.Game.Graphics.Sprites; using osu.Framework.Lists; using System; using System.Globalization; +using osu.Framework.Allocation; namespace osu.Desktop.VisualTests.Tests { @@ -27,11 +28,6 @@ namespace osu.Desktop.VisualTests.Tests public TestCaseBeatSyncedContainer() { Clock = new FramedClock(); - } - - public override void Reset() - { - base.Reset(); Clock.ProcessFrame(); Add(new BeatContainer @@ -45,7 +41,12 @@ namespace osu.Desktop.VisualTests.Tests Origin = Anchor.TopRight, Anchor = Anchor.TopRight, }); - mc.State = Visibility.Visible; + } + + [BackgroundDependencyLoader] + private void load() + { + mc.ToggleVisibility(); } private class BeatContainer : BeatSyncedContainer @@ -141,6 +142,8 @@ namespace osu.Desktop.VisualTests.Tests { base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); + if (beatIndex < 0) return; + timingPointCount.Value = timingPoints.Count; currentTimingPoint.Value = timingPoints.IndexOf(timingPoint) + 1; beatCount.Value = calculateBeatCount(timingPoint); From bd45e1f1e741be4957a267562db1c2a2b89233f2 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 9 Jul 2017 13:48:20 +0300 Subject: [PATCH 06/13] Make field readonly --- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 9bf307b1ce..ffcc76e82c 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -23,7 +23,7 @@ namespace osu.Desktop.VisualTests.Tests { public override string Description => @"Tests beat synced containers."; - private MusicController mc; + private readonly MusicController mc; public TestCaseBeatSyncedContainer() { From 62fc55521c0864a78c5cda8a7b82130b67e07079 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 9 Jul 2017 13:54:38 +0300 Subject: [PATCH 07/13] Added background colour for better info visibility --- .../Tests/TestCaseBeatSyncedContainer.cs | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index ffcc76e82c..f5b96391dd 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -16,6 +16,7 @@ using osu.Framework.Lists; using System; using System.Globalization; using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; namespace osu.Desktop.VisualTests.Tests { @@ -68,22 +69,36 @@ namespace osu.Desktop.VisualTests.Tests AutoSizeAxes = Axes.Y; Children = new Drawable[] { - new FillFlowContainer + new Container { Name = @"Info Layer", Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - Direction = FillDirection.Vertical, AutoSizeAxes = Axes.Both, - Margin = new MarginPadding { Bottom = flash_layer_heigth, }, + Margin = new MarginPadding { Bottom = flash_layer_heigth }, Children = new Drawable[] { - timingPointCount = new InfoString(@"Timing points amount"), - currentTimingPoint = new InfoString(@"Current timing point"), - beatCount = new InfoString(@"Beats amount (in the current timing point)"), - currentBeat = new InfoString(@"Current beat"), - beatsPerMinute = new InfoString(@"BPM"), - adjustedBeatLength = new InfoString(@"Adjusted beat length"), + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black.Opacity(150), + }, + new FillFlowContainer + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + timingPointCount = new InfoString(@"Timing points amount"), + currentTimingPoint = new InfoString(@"Current timing point"), + beatCount = new InfoString(@"Beats amount (in the current timing point)"), + currentBeat = new InfoString(@"Current beat"), + beatsPerMinute = new InfoString(@"BPM"), + adjustedBeatLength = new InfoString(@"Adjusted beat length"), + } + } } }, new Container @@ -182,7 +197,7 @@ namespace osu.Desktop.VisualTests.Tests Direction = FillDirection.Horizontal; Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size }); Add(valueText = new OsuSpriteText() { TextSize = text_size }); - Margin = new MarginPadding { Vertical = margin, }; + Margin = new MarginPadding { Vertical = margin, Horizontal = margin }; } } } From d533ac0e98bfb530ab4120f4b5219f9c917171e5 Mon Sep 17 00:00:00 2001 From: EVAST9919 Date: Sun, 9 Jul 2017 13:57:13 +0300 Subject: [PATCH 08/13] Simplify info margin --- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index f5b96391dd..88ed37ddb0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -197,7 +197,7 @@ namespace osu.Desktop.VisualTests.Tests Direction = FillDirection.Horizontal; Add(new OsuSpriteText { Text = header + @": ", TextSize = text_size }); Add(valueText = new OsuSpriteText() { TextSize = text_size }); - Margin = new MarginPadding { Vertical = margin, Horizontal = margin }; + Margin = new MarginPadding(margin); } } } From 8c40b808132bf0efed87065496d8ac8602bc0d5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 9 Jul 2017 19:33:23 +0300 Subject: [PATCH 09/13] Also display negative beats --- osu-framework | 2 +- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/osu-framework b/osu-framework index 8dc785a0ae..1242968326 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 8dc785a0aecfb6df53496eff5bd9f961ff8deee6 +Subproject commit 1242968326461ec1d7e1fb6877b12658d7e1644c diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 88ed37ddb0..29eadfe26e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -157,8 +157,6 @@ namespace osu.Desktop.VisualTests.Tests { base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); - if (beatIndex < 0) return; - timingPointCount.Value = timingPoints.Count; currentTimingPoint.Value = timingPoints.IndexOf(timingPoint) + 1; beatCount.Value = calculateBeatCount(timingPoint); From 1f425c3be8b8cfdd35cf20f1f485c6a013e72b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 9 Jul 2017 19:40:36 +0300 Subject: [PATCH 10/13] Simplify existing code --- .../Tests/TestCaseBeatSyncedContainer.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 29eadfe26e..05038f2d59 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -44,9 +44,9 @@ namespace osu.Desktop.VisualTests.Tests }); } - [BackgroundDependencyLoader] - private void load() + protected override void LoadComplete() { + base.LoadComplete(); mc.ToggleVisibility(); } @@ -147,7 +147,7 @@ namespace osu.Desktop.VisualTests.Tests private int calculateBeatCount(TimingControlPoint current) { - if (timingPoints.IndexOf(current) + 1 == timingPoints.Count) + if (timingPoints[timingPoints.Count - 1] == current) return (int)Math.Ceiling((Beatmap.Value.Track.Length - current.Time) / current.BeatLength); return (int)Math.Ceiling((getNextTimingPoint(current).Time - current.Time) / current.BeatLength); @@ -177,16 +177,9 @@ namespace osu.Desktop.VisualTests.Tests private readonly OsuSpriteText valueText; - private float? value; public float Value { - set - { - if (value == this.value) return; - this.value = value; - - valueText.Text = value.ToString(CultureInfo.CurrentCulture); - } + set { valueText.Text = value.ToString(); } } public InfoString(string header) From 934a585b9482ac8f34061ee2483d76083178f726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 9 Jul 2017 19:40:57 +0300 Subject: [PATCH 11/13] Better number formatting --- .../Tests/TestCaseBeatSyncedContainer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 05038f2d59..27c2467cb9 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -161,8 +161,8 @@ namespace osu.Desktop.VisualTests.Tests currentTimingPoint.Value = timingPoints.IndexOf(timingPoint) + 1; beatCount.Value = calculateBeatCount(timingPoint); currentBeat.Value = beatIndex + 1; - beatsPerMinute.Value = (float)Math.Round(60000 / timingPoint.BeatLength, 1); - adjustedBeatLength.Value = (float)timingPoint.BeatLength; + beatsPerMinute.Value = 60000 / timingPoint.BeatLength; + adjustedBeatLength.Value = timingPoint.BeatLength; flashLayer.ClearTransforms(); flashLayer.FadeTo(1); @@ -177,9 +177,9 @@ namespace osu.Desktop.VisualTests.Tests private readonly OsuSpriteText valueText; - public float Value + public double Value { - set { valueText.Text = value.ToString(); } + set { valueText.Text = $"{value:G}"; } } public InfoString(string header) From dedd4561a12e725ff68e3bcc990a319a92ad47e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 9 Jul 2017 19:41:36 +0300 Subject: [PATCH 12/13] Display indices rather than one-based numbers --- osu-framework | 2 +- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu-framework b/osu-framework index 1242968326..3c76bce457 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1242968326461ec1d7e1fb6877b12658d7e1644c +Subproject commit 3c76bce45762765b7268f8036da681a788f756b9 diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 27c2467cb9..95e24dd6fa 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -158,9 +158,9 @@ namespace osu.Desktop.VisualTests.Tests base.OnNewBeat(beatIndex, timingPoint, effectPoint, amplitudes); timingPointCount.Value = timingPoints.Count; - currentTimingPoint.Value = timingPoints.IndexOf(timingPoint) + 1; + currentTimingPoint.Value = timingPoints.IndexOf(timingPoint); beatCount.Value = calculateBeatCount(timingPoint); - currentBeat.Value = beatIndex + 1; + currentBeat.Value = beatIndex; beatsPerMinute.Value = 60000 / timingPoint.BeatLength; adjustedBeatLength.Value = timingPoint.BeatLength; From fec6f2ba651276cfaffe14c064694be4304179b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 9 Jul 2017 19:47:54 +0300 Subject: [PATCH 13/13] Remove unnecessary usings --- osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs index 95e24dd6fa..067bf47521 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseBeatSyncedContainer.cs @@ -14,8 +14,6 @@ using OpenTK.Graphics; using osu.Game.Graphics.Sprites; using osu.Framework.Lists; using System; -using System.Globalization; -using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; namespace osu.Desktop.VisualTests.Tests