diff --git a/osu.Game.Tests/NonVisual/TestSceneUpdateManager.cs b/osu.Game.Tests/NonVisual/TestSceneUpdateManager.cs index 8a9ee4b81b..e20fb50722 100644 --- a/osu.Game.Tests/NonVisual/TestSceneUpdateManager.cs +++ b/osu.Game.Tests/NonVisual/TestSceneUpdateManager.cs @@ -48,6 +48,13 @@ namespace osu.Game.Tests.NonVisual AddUntilStep("no check pending", () => !manager.IsPending); } + [TearDownSteps] + public void TeardownSteps() + { + // Importantly, this immediately saves the config, which cancels any pending background save. + AddStep("dispose config manager", () => config.Dispose()); + } + /// /// Updates should be checked when the release stream is changed. /// diff --git a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs index fe76b74bcb..02b2db6e31 100644 --- a/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs +++ b/osu.Game.Tests/Visual/Navigation/TestSceneSkinEditorNavigation.cs @@ -126,12 +126,7 @@ namespace osu.Game.Tests.Visual.Navigation AddUntilStep("wait for accuracy counter", () => Game.ChildrenOfType().Any(counter => counter.Position != new Vector2())); AddStep("dump state of accuracy meter", () => state = JsonConvert.SerializeObject(Game.ChildrenOfType().First().CreateSerialisedInfo())); AddStep("add any component", () => Game.ChildrenOfType().First().TriggerClick()); - AddStep("undo", () => - { - InputManager.PressKey(Key.ControlLeft); - InputManager.Key(Key.Z); - InputManager.ReleaseKey(Key.ControlLeft); - }); + AddStep("undo", () => InputManager.Keys(PlatformAction.Undo)); AddUntilStep("only one accuracy meter left", () => Game.ChildrenOfType().Single().ChildrenOfType().Count(), () => Is.EqualTo(1)); @@ -163,12 +158,7 @@ namespace osu.Game.Tests.Visual.Navigation AddUntilStep("wait for accuracy counter", () => Game.ChildrenOfType().Any(counter => counter.Position != new Vector2())); AddStep("dump state of accuracy meter", () => state = JsonConvert.SerializeObject(Game.ChildrenOfType().First().CreateSerialisedInfo())); AddStep("add any component", () => Game.ChildrenOfType().First().TriggerClick()); - AddStep("undo", () => - { - InputManager.PressKey(Key.ControlLeft); - InputManager.Key(Key.Z); - InputManager.ReleaseKey(Key.ControlLeft); - }); + AddStep("undo", () => InputManager.Keys(PlatformAction.Undo)); AddUntilStep("only one accuracy meter left", () => Game.ChildrenOfType().Single().ChildrenOfType().Count(), () => Is.EqualTo(1)); @@ -190,12 +180,7 @@ namespace osu.Game.Tests.Visual.Navigation AddUntilStep("wait for components", () => skinEditor.ChildrenOfType().Any()); - AddStep("select all components", () => - { - InputManager.PressKey(Key.ControlLeft); - InputManager.Key(Key.A); - InputManager.ReleaseKey(Key.ControlLeft); - }); + AddStep("select all components", () => InputManager.Keys(PlatformAction.SelectAll)); AddUntilStep("components selected", () => skinEditor.SelectedComponents.Count > 0); diff --git a/osu.Game/Online/Leaderboards/LeaderboardManager.cs b/osu.Game/Online/Leaderboards/LeaderboardManager.cs index 88cc9d5db5..5750c83c97 100644 --- a/osu.Game/Online/Leaderboards/LeaderboardManager.cs +++ b/osu.Game/Online/Leaderboards/LeaderboardManager.cs @@ -188,6 +188,13 @@ namespace osu.Game.Online.Leaderboards var newScoresArray = newScores.ToArray(); scores.Value = LeaderboardScores.Success(newScoresArray, newScoresArray.Length, null); } + + protected override void Dispose(bool isDisposing) + { + base.Dispose(isDisposing); + + localScoreSubscription?.Dispose(); + } } public record LeaderboardCriteria( diff --git a/osu.Game/Screens/Ranking/SoloResultsScreen.cs b/osu.Game/Screens/Ranking/SoloResultsScreen.cs index 2d772e5f09..aeb21b09cb 100644 --- a/osu.Game/Screens/Ranking/SoloResultsScreen.cs +++ b/osu.Game/Screens/Ranking/SoloResultsScreen.cs @@ -41,12 +41,12 @@ namespace osu.Game.Screens.Ranking { Debug.Assert(Score != null); + // sort mode intentionally omitted to default to score - results screen only supports sorting by score, so don't pass any other to avoid confusion var criteria = new LeaderboardCriteria( Score.BeatmapInfo!, Score.Ruleset, leaderboardManager.CurrentCriteria?.Scope ?? BeatmapLeaderboardScope.Global, - leaderboardManager.CurrentCriteria?.ExactMods, - leaderboardManager.CurrentCriteria?.Sorting ?? LeaderboardSortMode.Score + leaderboardManager.CurrentCriteria?.ExactMods ); var requestTaskSource = new TaskCompletionSource(); globalScores.BindValueChanged(_ => diff --git a/osu.Game/Screens/SelectV2/BeatmapDetailsArea.cs b/osu.Game/Screens/SelectV2/BeatmapDetailsArea.cs index 85bbf34837..7a2068b0cf 100644 --- a/osu.Game/Screens/SelectV2/BeatmapDetailsArea.cs +++ b/osu.Game/Screens/SelectV2/BeatmapDetailsArea.cs @@ -97,5 +97,11 @@ namespace osu.Game.Screens.SelectV2 contentContainer.Add(currentContent); currentContent.Show(); } + + public void Refresh() + { + if (currentContent is BeatmapLeaderboardWedge leaderboardWedge) + leaderboardWedge.RefetchScores(); + } } } diff --git a/osu.Game/Screens/SelectV2/BeatmapLeaderboardWedge.cs b/osu.Game/Screens/SelectV2/BeatmapLeaderboardWedge.cs index 259ce8565b..0b845474dd 100644 --- a/osu.Game/Screens/SelectV2/BeatmapLeaderboardWedge.cs +++ b/osu.Game/Screens/SelectV2/BeatmapLeaderboardWedge.cs @@ -189,14 +189,14 @@ namespace osu.Game.Screens.SelectV2 { base.LoadComplete(); - Scope.BindValueChanged(_ => refetchScores()); - Sorting.BindValueChanged(_ => refetchScores()); - FilterBySelectedMods.BindValueChanged(_ => refetchScores()); - beatmap.BindValueChanged(_ => refetchScores()); - ruleset.BindValueChanged(_ => refetchScores()); + Scope.BindValueChanged(_ => RefetchScores()); + Sorting.BindValueChanged(_ => RefetchScores()); + FilterBySelectedMods.BindValueChanged(_ => RefetchScores()); + beatmap.BindValueChanged(_ => RefetchScores()); + ruleset.BindValueChanged(_ => RefetchScores()); mods.BindValueChanged(_ => refetchScoresFromMods()); - refetchScores(); + RefetchScores(); } protected override void PopIn() @@ -212,14 +212,14 @@ namespace osu.Game.Screens.SelectV2 private void refetchScoresFromMods() { if (FilterBySelectedMods.Value) - refetchScores(); + RefetchScores(); } private bool initialFetchComplete; private ScheduledDelegate? refetchOperation; - private void refetchScores() + public void RefetchScores() { SetScores(Array.Empty()); @@ -477,7 +477,7 @@ namespace osu.Game.Screens.SelectV2 case LeaderboardState.NetworkFailure: return new ClickablePlaceholder(LeaderboardStrings.CouldntFetchScores, FontAwesome.Solid.Sync) { - Action = refetchScores + Action = RefetchScores }; case LeaderboardState.NoneSelected: diff --git a/osu.Game/Screens/SelectV2/SongSelect.cs b/osu.Game/Screens/SelectV2/SongSelect.cs index b11254264a..5635fa07fc 100644 --- a/osu.Game/Screens/SelectV2/SongSelect.cs +++ b/osu.Game/Screens/SelectV2/SongSelect.cs @@ -594,6 +594,8 @@ namespace osu.Game.Screens.SelectV2 ensureGlobalBeatmapValid(); + detailsArea.Refresh(); + if (ControlGlobalMusic) { // restart playback on returning to song select, regardless.