1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 14:07:25 +08:00

formating

This commit is contained in:
BananeVolante 2020-06-23 13:09:24 +02:00
parent 579d7cedcc
commit 624ad65806
2 changed files with 8 additions and 27 deletions

View File

@ -3,18 +3,12 @@
using System;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using NUnit.Framework.Internal;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
using osu.Game.Graphics;
using osuTK.Graphics;
using osu.Framework.Logging;
using SharpCompress.Common;
namespace osu.Game.Screens.Play
{
@ -37,17 +31,18 @@ namespace osu.Game.Screens.Play
AddButton("Quit", new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
var sampleChannel = audio.Samples.Get(@"Gameplay/pause-loop");
if (sampleChannel != null)
{
AddInternal(pauseLoop = new DrawableSample(sampleChannel)
pauseLoop = new DrawableSample(sampleChannel)
{
Looping = true,
});
};
AddInternal(pauseLoop);
pauseLoop?.Play();
}
}
protected override void PopIn()
{
base.PopIn();
@ -57,9 +52,7 @@ namespace osu.Game.Screens.Play
protected override void PopOut()
{
base.PopOut();
pauseLoop.VolumeTo(0.0f);
pauseLoop?.VolumeTo(0.0f);
}
}
}

View File

@ -5,13 +5,11 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Audio;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
using osu.Framework.Logging;
@ -412,10 +410,8 @@ namespace osu.Game.Screens.Play
if (canPause)
Pause();
else
{
this.Exit();
}
}
/// <summary>
/// Restart gameplay via a parent <see cref="PlayerLoader"/>.
@ -567,17 +563,16 @@ namespace osu.Game.Screens.Play
DrawableRuleset.CancelResume();
IsResuming = false;
}
GameplayClockContainer.Stop();
PauseOverlay.Show();
lastPauseActionTime = GameplayClockContainer.GameplayClock.CurrentTime;
}
public void Resume()
{
if (!canResume) return;
IsResuming = true;
PauseOverlay.Hide();
@ -671,9 +666,7 @@ namespace osu.Game.Screens.Play
// as we are no longer the current screen, we cannot guarantee the track is still usable.
GameplayClockContainer?.StopUsingBeatmapClock();
fadeOut();
return base.OnExiting(next);
}
@ -719,11 +712,6 @@ namespace osu.Game.Screens.Play
storyboardReplacesBackground.Value = false;
}
#endregion
}
}