From 231f7939a684377bdaf8aeba6099e65ae29a5cf3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 12:41:37 +0900 Subject: [PATCH 1/7] Fix channels being unnecessarily recycled on disconnect Resolves #768 --- osu.Game/Overlays/ChatOverlay.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index a85af251c5..cbcfbbfd9e 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -206,18 +206,12 @@ namespace osu.Game.Overlays private long? lastMessageId; - private List careChannels; + private List careChannels = new List(); private readonly List loadedChannels = new List(); private void initializeChannels() { - currentChannelContainer.Clear(); - - loadedChannels.Clear(); - - careChannels = new List(); - SpriteText loading; Add(loading = new OsuSpriteText { @@ -232,8 +226,6 @@ namespace osu.Game.Overlays ListChannelsRequest req = new ListChannelsRequest(); req.Success += delegate (List channels) { - Debug.Assert(careChannels.Count == 0); - Scheduler.Add(delegate { loading.FadeOut(100); From cab12ee55a6ce09ae2f01eed9fb8bf06a40e330a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 16:45:17 +0900 Subject: [PATCH 2/7] Reduce the possibility of recomputing drawables when underlying beatmap hasn't changed --- osu.Game/Screens/Select/BeatmapDetails.cs | 2 ++ .../Screens/Select/Leaderboards/Leaderboard.cs | 2 ++ osu.Game/Screens/Select/SongSelect.cs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Select/BeatmapDetails.cs b/osu.Game/Screens/Select/BeatmapDetails.cs index b750fc9bbe..abe54375cc 100644 --- a/osu.Game/Screens/Select/BeatmapDetails.cs +++ b/osu.Game/Screens/Select/BeatmapDetails.cs @@ -49,6 +49,8 @@ namespace osu.Game.Screens.Select get { return beatmap; } set { + if (beatmap == value) return; + beatmap = value; pendingBeatmapSwitch?.Cancel(); diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index a136e298b5..a7aa752d65 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -100,6 +100,8 @@ namespace osu.Game.Screens.Select.Leaderboards get { return beatmap; } set { + if (beatmap == value) return; + beatmap = value; Scores = null; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 4438b656b0..4982ca096f 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -313,15 +313,15 @@ namespace osu.Game.Screens.Select { bool beatmapSetChange = false; - if (!beatmap.Equals(Beatmap?.BeatmapInfo)) + if (beatmap.Equals(Beatmap?.BeatmapInfo)) + return; + + if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID) + sampleChangeDifficulty.Play(); + else { - if (beatmap.BeatmapSetInfoID == selectionChangeNoBounce?.BeatmapSetInfoID) - sampleChangeDifficulty.Play(); - else - { - sampleChangeBeatmap.Play(); - beatmapSetChange = true; - } + sampleChangeBeatmap.Play(); + beatmapSetChange = true; } selectionChangeNoBounce = beatmap; From 7bb38e927b5a0487994d3616f33b8525405d10e9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 17:15:25 +0900 Subject: [PATCH 3/7] Fix song select reverting to first difficulty of current group on entering --- osu.Game/Screens/Select/BeatmapCarousel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index fbdaa948cc..4df24c1314 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -107,6 +107,8 @@ namespace osu.Game.Screens.Select return; } + if (beatmap == SelectedBeatmap) return; + foreach (BeatmapGroup group in groups) { var panel = group.BeatmapPanels.FirstOrDefault(p => p.Beatmap.Equals(beatmap)); @@ -204,7 +206,7 @@ namespace osu.Game.Screens.Select if (selectedGroup == null || selectedGroup.State == BeatmapGroupState.Hidden) SelectNext(); else - selectGroup(selectedGroup); + selectGroup(selectedGroup, selectedPanel); }; filterTask?.Cancel(); @@ -339,6 +341,8 @@ namespace osu.Game.Screens.Select selectedGroup.State = BeatmapGroupState.Collapsed; group.State = BeatmapGroupState.Expanded; + group.SelectedPanel = panel; + panel.State = PanelSelectedState.Selected; if (selectedPanel == panel) return; From cba77967777da8f22469ae31b2f0f31bc34dbbf3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 18:49:30 +0900 Subject: [PATCH 4/7] Fix ratio container being added to a level too high That's a bad ratio container! How did we not notice this until now? --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 7e16030ec3..2c39a82245 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -146,7 +146,7 @@ namespace osu.Game { base.LoadComplete(); - AddInternal(ratioContainer = new RatioAdjust + base.Content.Add(ratioContainer = new RatioAdjust { Children = new Drawable[] { From 88a70e407ca2ce9805177f88f18ae073acb77265 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 20:11:41 +0900 Subject: [PATCH 5/7] Fix and simplifty pause logic Resolves #770 --- osu.Game/Screens/Play/Player.cs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 8ee0de12b9..68fbbaddcc 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -38,7 +38,7 @@ namespace osu.Game.Screens.Play public Action RestartRequested; - public bool IsPaused => !decoupledClock.IsRunning; + public bool IsPaused { get; private set; } internal override bool AllowRulesetChange => false; @@ -264,19 +264,18 @@ namespace osu.Game.Screens.Play { if (!canPause && !force) return; - // the actual pausing is potentially happening on a different thread. - // we want to wait for the source clock to stop so we can be sure all components are in a stable state. - if (!IsPaused) - { - decoupledClock.Stop(); + if (IsPaused) return; - Schedule(() => Pause(force)); - return; - } + // stop the decoupled clock (stops the audio eventually) + decoupledClock.Stop(); + + // stop processing updatess on the offset clock (instantly freezes time for all our components) + offsetClock.ProcessSourceClockFrames = false; + + IsPaused = true; // we need to do a final check after all of our children have processed up to the paused clock time. - // this is to cover cases where, for instance, the player fails in the last processed frame (which would change canPause). - // as the scheduler runs before children updates, let's schedule for the next frame. + // this is to cover cases where, for instance, the player fails in the current processing frame. Schedule(() => { if (!canPause) return; @@ -291,6 +290,11 @@ namespace osu.Game.Screens.Play public void Resume() { + if (!IsPaused) return; + + IsPaused = false; + offsetClock.ProcessSourceClockFrames = true; + lastPauseActionTime = Time.Current; hudOverlay.KeyCounter.IsCounting = true; hudOverlay.Progress.Hide(); From d606b5b3a73a70c51d8f89c06bebe2d753f85a6e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 22:13:56 +0900 Subject: [PATCH 6/7] Fix CI warning --- osu.Game/Overlays/ChatOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index cbcfbbfd9e..2836be22ae 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -206,7 +206,7 @@ namespace osu.Game.Overlays private long? lastMessageId; - private List careChannels = new List(); + private readonly List careChannels = new List(); private readonly List loadedChannels = new List(); From d1f85c3f8e6dc4982a731b51073b2b948fdafa35 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 May 2017 23:21:23 +0900 Subject: [PATCH 7/7] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 67f3958036..f8e5b10f68 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 67f39580365f7d0a42f8788eae2b60881dde1c67 +Subproject commit f8e5b10f6883af83ffbc431b03fe4ee3e89797a6