From 297e5ec62eba47257363514b825fec92f3474656 Mon Sep 17 00:00:00 2001 From: Dean Herbert <pe@ppy.sh> Date: Sun, 27 Feb 2022 23:16:04 +0900 Subject: [PATCH 1/3] Remove unused constants --- osu.Game.Tournament/Components/TournamentBeatmapPanel.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs index 4189f3ccb5..b064d3dd79 100644 --- a/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs +++ b/osu.Game.Tournament/Components/TournamentBeatmapPanel.cs @@ -24,9 +24,6 @@ namespace osu.Game.Tournament.Components private readonly string mod; - private const float horizontal_padding = 10; - private const float vertical_padding = 10; - public const float HEIGHT = 50; private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>(); From df4170b9396695b02c1efb02e0c0c6bf9096073d Mon Sep 17 00:00:00 2001 From: Dean Herbert <pe@ppy.sh> Date: Sun, 27 Feb 2022 23:17:04 +0900 Subject: [PATCH 2/3] Display star ratings in tournament mode using two decimal places --- osu.Game.Tournament/Components/SongBar.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Components/SongBar.cs b/osu.Game.Tournament/Components/SongBar.cs index a7f0d58145..a45582a7c0 100644 --- a/osu.Game.Tournament/Components/SongBar.cs +++ b/osu.Game.Tournament/Components/SongBar.cs @@ -186,7 +186,7 @@ namespace osu.Game.Tournament.Components Children = new Drawable[] { new DiffPiece(stats), - new DiffPiece(("Star Rating", $"{beatmap.StarRating:0.#}{srExtra}")) + new DiffPiece(("Star Rating", $"{beatmap.StarRating:0.##}{srExtra}")) } }, new FillFlowContainer From 746f28c8487d05b697db217f0a66849c16132396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= <dach.bartlomiej@gmail.com> Date: Sun, 27 Feb 2022 15:31:34 +0100 Subject: [PATCH 3/3] Add test scene for song bar component --- .../Components/TestSceneSongBar.cs | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 osu.Game.Tournament.Tests/Components/TestSceneSongBar.cs diff --git a/osu.Game.Tournament.Tests/Components/TestSceneSongBar.cs b/osu.Game.Tournament.Tests/Components/TestSceneSongBar.cs new file mode 100644 index 0000000000..868946d80f --- /dev/null +++ b/osu.Game.Tournament.Tests/Components/TestSceneSongBar.cs @@ -0,0 +1,45 @@ +// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using NUnit.Framework; +using osu.Framework.Graphics; +using osu.Game.Beatmaps.Legacy; +using osu.Game.Tests.Visual; +using osu.Game.Tournament.Components; + +namespace osu.Game.Tournament.Tests.Components +{ + [TestFixture] + public class TestSceneSongBar : OsuTestScene + { + [Test] + public void TestSongBar() + { + SongBar songBar = null; + + AddStep("create bar", () => Child = songBar = new SongBar + { + RelativeSizeAxes = Axes.X, + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }); + AddUntilStep("wait for loaded", () => songBar.IsLoaded); + + AddStep("set beatmap", () => + { + var beatmap = CreateAPIBeatmap(Ruleset.Value); + beatmap.CircleSize = 3.4f; + beatmap.ApproachRate = 6.8f; + beatmap.OverallDifficulty = 5.5f; + beatmap.StarRating = 4.56f; + beatmap.Length = 123456; + beatmap.BPM = 133; + + songBar.Beatmap = beatmap; + }); + AddStep("set mods to HR", () => songBar.Mods = LegacyMods.HardRock); + AddStep("set mods to DT", () => songBar.Mods = LegacyMods.DoubleTime); + AddStep("unset mods", () => songBar.Mods = LegacyMods.None); + } + } +}