1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 03:15:36 +08:00

Merge branch 'master' into disable-intro-track-pause

This commit is contained in:
Bartłomiej Dach 2024-01-08 12:54:37 +01:00
commit 5337d999b5
No known key found for this signature in database
6 changed files with 29 additions and 12 deletions

View File

@ -799,11 +799,7 @@ namespace osu.Game.Tests.Visual.Navigation
});
});
AddStep("attempt exit", () =>
{
for (int i = 0; i < 2; ++i)
Game.ScreenStack.CurrentScreen.Exit();
});
AddRepeatStep("attempt force exit", () => Game.ScreenStack.CurrentScreen.Exit(), 2);
AddUntilStep("stopped at exit confirm", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is ConfirmExitDialog);
}

View File

@ -152,6 +152,15 @@ namespace osu.Game.Online.Leaderboards
/// </summary>
public void RefetchScores() => Scheduler.AddOnce(refetchScores);
/// <summary>
/// Clear all scores from the display.
/// </summary>
public void ClearScores()
{
cancelPendingWork();
SetScores(null);
}
/// <summary>
/// Call when a retrieval or display failure happened to show a relevant message to the user.
/// </summary>
@ -220,9 +229,7 @@ namespace osu.Game.Online.Leaderboards
{
Debug.Assert(ThreadSafety.IsUpdateThread);
cancelPendingWork();
SetScores(null);
ClearScores();
setState(LeaderboardState.Retrieving);
currentFetchCancellationSource = new CancellationTokenSource();

View File

@ -32,7 +32,7 @@ namespace osu.Game.Overlays.Dialog
private readonly Vector2 ringMinifiedSize = new Vector2(20f);
private readonly Box flashLayer;
private Sample flashSample = null!;
private Sample? flashSample;
private readonly Container content;
private readonly Container ring;
@ -267,7 +267,7 @@ namespace osu.Game.Overlays.Dialog
flashLayer.FadeInFromZero(80, Easing.OutQuint)
.Then()
.FadeOutFromOne(1500, Easing.OutQuint);
flashSample.Play();
flashSample?.Play();
}
protected override bool OnKeyDown(KeyDownEvent e)

View File

@ -5,6 +5,7 @@
using System;
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -25,6 +26,7 @@ using osu.Game.Input.Bindings;
using osu.Game.IO;
using osu.Game.Online.API;
using osu.Game.Overlays;
using osu.Game.Overlays.Dialog;
using osu.Game.Overlays.SkinEditor;
using osu.Game.Rulesets;
using osu.Game.Screens.Backgrounds;
@ -392,7 +394,12 @@ namespace osu.Game.Screens.Menu
if (requiresConfirmation)
{
if (dialogOverlay.CurrentDialog is ConfirmExitDialog exitDialog)
exitDialog.PerformOkAction();
{
if (exitDialog.Buttons.OfType<PopupDialogOkButton>().FirstOrDefault() != null)
exitDialog.PerformOkAction();
else
exitDialog.Flash();
}
else
{
dialogOverlay.Push(new ConfirmExitDialog(() =>

View File

@ -37,7 +37,6 @@ namespace osu.Game.Screens.Ranking.Statistics
RelativeSizeAxes = Axes.X,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Width = 0.5f,
StatisticsUpdate = { BindTarget = StatisticsUpdate }
})).ToArray();
}

View File

@ -146,6 +146,14 @@ namespace osu.Game.Screens.Select
}
}
public override void OnSuspending(ScreenTransitionEvent e)
{
// Scores will be refreshed on arriving at this screen.
// Clear them to avoid animation overload on returning to song select.
playBeatmapDetailArea.Leaderboard.ClearScores();
base.OnSuspending(e);
}
public override void OnResuming(ScreenTransitionEvent e)
{
base.OnResuming(e);