mirror of
https://github.com/ppy/osu.git
synced 2026-05-26 03:49:56 +08:00
Merge pull request #35800 from peppy/fix-audio-dim-results
Fix quick retry/exit overlay volume dimming potentially sticking at results
This commit is contained in:
@@ -266,7 +266,11 @@ namespace osu.Game.Tests.Visual.Background
|
||||
|
||||
FadeAccessibleResults results = null;
|
||||
|
||||
AddStep("Transition to Results", () => player.Push(results = new FadeAccessibleResults(TestResources.CreateTestScoreInfo())));
|
||||
AddStep("Transition to Results", () =>
|
||||
{
|
||||
player.ValidForResume = false;
|
||||
player.Push(results = new FadeAccessibleResults(TestResources.CreateTestScoreInfo()));
|
||||
});
|
||||
|
||||
AddUntilStep("Wait for results is current", () => results.IsCurrentScreen());
|
||||
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace osu.Game.Screens.Play
|
||||
OnRetry = Configuration.AllowUserInteraction ? () => Restart() : null,
|
||||
OnQuit = () => PerformExitWithConfirmation(),
|
||||
},
|
||||
new HotkeyExitOverlay
|
||||
exitOverlay = new HotkeyExitOverlay
|
||||
{
|
||||
Action = () =>
|
||||
{
|
||||
@@ -338,7 +338,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
rulesetSkinProvider.AddRange(new Drawable[]
|
||||
{
|
||||
new HotkeyRetryOverlay
|
||||
retryOverlay = new HotkeyRetryOverlay
|
||||
{
|
||||
Action = () =>
|
||||
{
|
||||
@@ -1033,6 +1033,9 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private double? lastPauseActionTime;
|
||||
|
||||
private HotkeyRetryOverlay retryOverlay;
|
||||
private HotkeyExitOverlay exitOverlay;
|
||||
|
||||
protected bool PauseCooldownActive =>
|
||||
PlayingState.Value == LocalUserPlayingState.Playing && lastPauseActionTime.HasValue && GameplayClockContainer.CurrentTime < lastPauseActionTime + PauseCooldownDuration;
|
||||
|
||||
@@ -1169,8 +1172,14 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public override void OnSuspending(ScreenTransitionEvent e)
|
||||
{
|
||||
Debug.Assert(!ValidForResume);
|
||||
|
||||
screenSuspension?.RemoveAndDisposeImmediately();
|
||||
|
||||
// If these are not disposed, audio volume dimming can get stuck.
|
||||
retryOverlay?.RemoveAndDisposeImmediately();
|
||||
exitOverlay?.RemoveAndDisposeImmediately();
|
||||
|
||||
fadeOut();
|
||||
base.OnSuspending(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user