From 8dd36ee1a98a54ccf4ede99a4f829b1fc6b2ed19 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 1 Jun 2018 06:08:57 -0300 Subject: [PATCH 1/3] Default Max to null in ParticipantCount. --- osu.Game/Screens/Multi/Components/ParticipantCount.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Multi/Components/ParticipantCount.cs b/osu.Game/Screens/Multi/Components/ParticipantCount.cs index e47a529ff8..2e9183d047 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantCount.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantCount.cs @@ -62,6 +62,8 @@ namespace osu.Game.Screens.Multi.Components Font = @"Exo2.0-Light" }, }; + + Max = null; } } } From cc32adf51fb008e5e9573397c5c320cb8e3ea075 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Fri, 1 Jun 2018 14:28:24 -0300 Subject: [PATCH 2/3] Move max text updating into updateMax. --- .../Multi/Components/ParticipantCount.cs | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/ParticipantCount.cs b/osu.Game/Screens/Multi/Components/ParticipantCount.cs index 2e9183d047..e7183cbd92 100644 --- a/osu.Game/Screens/Multi/Components/ParticipantCount.cs +++ b/osu.Game/Screens/Multi/Components/ParticipantCount.cs @@ -12,28 +12,23 @@ namespace osu.Game.Screens.Multi.Components private const float text_size = 30; private const float transition_duration = 100; - private readonly OsuSpriteText count, slash, max; + private readonly OsuSpriteText count, slash, maxText; public int Count { set => count.Text = value.ToString(); } + private int? max; public int? Max { + get => max; set { - if (value == null) - { - slash.FadeOut(transition_duration); - max.FadeOut(transition_duration); - } - else - { - slash.FadeIn(transition_duration); - max.Text = value.ToString(); - max.FadeIn(transition_duration); - } + if (value == max) return; + max = value; + + updateMax(); } } @@ -56,14 +51,29 @@ namespace osu.Game.Screens.Multi.Components TextSize = text_size, Font = @"Exo2.0-Light" }, - max = new OsuSpriteText + maxText = new OsuSpriteText { TextSize = text_size, Font = @"Exo2.0-Light" }, }; - Max = null; + updateMax(); + } + + private void updateMax() + { + if (Max == null) + { + slash.FadeOut(transition_duration); + maxText.FadeOut(transition_duration); + } + else + { + slash.FadeIn(transition_duration); + maxText.Text = Max.ToString(); + maxText.FadeIn(transition_duration); + } } } } From a0c643fae50982f78040a64c219fe5fdb44bfa47 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Sat, 2 Jun 2018 11:25:49 +0200 Subject: [PATCH 3/3] Fix SongProgressInfo timespan formatting --- osu.Game/Screens/Play/SongProgressInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/SongProgressInfo.cs b/osu.Game/Screens/Play/SongProgressInfo.cs index b79c212ade..3156a646db 100644 --- a/osu.Game/Screens/Play/SongProgressInfo.cs +++ b/osu.Game/Screens/Play/SongProgressInfo.cs @@ -92,6 +92,6 @@ namespace osu.Game.Screens.Play } } - private string formatTime(TimeSpan timeSpan) => $"{(timeSpan < TimeSpan.Zero ? "-" : "")}{timeSpan.Duration().TotalMinutes:N0}:{timeSpan.Duration().Seconds:D2}"; + private string formatTime(TimeSpan timeSpan) => $"{(timeSpan < TimeSpan.Zero ? "-" : "")}{Math.Floor(timeSpan.Duration().TotalMinutes)}:{timeSpan.Duration().Seconds:D2}"; } }