mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 12:53:11 +08:00
Rename PauseContainer
This commit is contained in:
parent
fafc80818c
commit
76ce3954a0
@ -188,10 +188,10 @@ namespace osu.Game.Tests.Visual
|
||||
public void PauseTest()
|
||||
{
|
||||
performFullSetup(true);
|
||||
AddStep("Pause", () => player.CurrentPauseContainer.Pause());
|
||||
AddStep("Pause", () => player.CurrentPausableGameplayContainer.Pause());
|
||||
waitForDim();
|
||||
AddAssert("Screen is dimmed", () => songSelect.IsBackgroundDimmed());
|
||||
AddStep("Unpause", () => player.CurrentPauseContainer.Resume());
|
||||
AddStep("Unpause", () => player.CurrentPausableGameplayContainer.Resume());
|
||||
waitForDim();
|
||||
AddAssert("Screen is dimmed", () => songSelect.IsBackgroundDimmed());
|
||||
}
|
||||
@ -328,7 +328,7 @@ namespace osu.Game.Tests.Visual
|
||||
};
|
||||
}
|
||||
|
||||
public PauseContainer CurrentPauseContainer => PauseContainer;
|
||||
public PausableGameplayContainer CurrentPausableGameplayContainer => PausableGameplayContainer;
|
||||
|
||||
public UserDimContainer CurrentStoryboardContainer => StoryboardContainer;
|
||||
|
||||
|
@ -17,15 +17,15 @@ namespace osu.Game.Tests.Visual
|
||||
[Description("player pause/fail screens")]
|
||||
public class TestCaseGameplayMenuOverlay : ManualInputManagerTestCase
|
||||
{
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(FailOverlay), typeof(PauseContainer) };
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[] { typeof(FailOverlay), typeof(PausableGameplayContainer) };
|
||||
|
||||
private FailOverlay failOverlay;
|
||||
private PauseContainer.PauseOverlay pauseOverlay;
|
||||
private PausableGameplayContainer.PauseOverlay pauseOverlay;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Add(pauseOverlay = new PauseContainer.PauseOverlay
|
||||
Add(pauseOverlay = new PausableGameplayContainer.PauseOverlay
|
||||
{
|
||||
OnResume = () => Logger.Log(@"Resume"),
|
||||
OnRetry = () => Logger.Log(@"Retry"),
|
||||
|
@ -7,7 +7,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
/// <summary>
|
||||
/// A clock which is used for gameplay elements that need to follow audio time 1:1.
|
||||
/// Exposed via DI by <see cref="PauseContainer"/>.
|
||||
/// Exposed via DI by <see cref="PausableGameplayContainer"/>.
|
||||
/// <remarks>
|
||||
/// The main purpose of this clock is to stop components using it from accidentally processing the main
|
||||
/// <see cref="IFrameBasedClock"/>, as this should only be done once to ensure accuracy.
|
||||
|
@ -14,10 +14,11 @@ using osuTK.Graphics;
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
/// <summary>
|
||||
/// A container which handles pausing children, displaying a pause overlay with choices etc.
|
||||
/// A container which handles pausing children, displaying a pause overlay with choices and processing the clock.
|
||||
/// Exposes a <see cref="GameplayClock"/> to children via DI.
|
||||
/// This alleviates a lot of the intricate pause logic from being in <see cref="Player"/>
|
||||
/// </summary>
|
||||
public class PauseContainer : Container
|
||||
public class PausableGameplayContainer : Container
|
||||
{
|
||||
public readonly BindableBool IsPaused = new BindableBool();
|
||||
|
||||
@ -53,11 +54,11 @@ namespace osu.Game.Screens.Play
|
||||
private readonly GameplayClock gameplayClock;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="PauseContainer"/>.
|
||||
/// Creates a new <see cref="PausableGameplayContainer"/>.
|
||||
/// </summary>
|
||||
/// <param name="offsetClock">The gameplay clock. This is the clock that will process frames. Includes user/system offsets.</param>
|
||||
/// <param name="adjustableClock">The seekable clock. This is the clock that will be paused and resumed. Should not be processed (it is processed automatically by <see cref="offsetClock"/>).</param>
|
||||
public PauseContainer(FramedClock offsetClock, DecoupleableInterpolatingFramedClock adjustableClock)
|
||||
public PausableGameplayContainer(FramedClock offsetClock, DecoupleableInterpolatingFramedClock adjustableClock)
|
||||
{
|
||||
this.offsetClock = offsetClock;
|
||||
this.adjustableClock = adjustableClock;
|
@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play
|
||||
[Resolved]
|
||||
private ScoreManager scoreManager { get; set; }
|
||||
|
||||
protected PauseContainer PauseContainer { get; private set; }
|
||||
protected PausableGameplayContainer PausableGameplayContainer { get; private set; }
|
||||
|
||||
private RulesetInfo ruleset;
|
||||
|
||||
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
PauseContainer = new PauseContainer(offsetClock, adjustableClock)
|
||||
PausableGameplayContainer = new PausableGameplayContainer(offsetClock, adjustableClock)
|
||||
{
|
||||
Retries = RestartCount,
|
||||
OnRetry = restart,
|
||||
@ -233,7 +233,7 @@ namespace osu.Game.Screens.Play
|
||||
HUDOverlay.HoldToQuit.Action = performUserRequestedExit;
|
||||
HUDOverlay.KeyCounter.Visible.BindTo(RulesetContainer.HasReplayLoaded);
|
||||
|
||||
RulesetContainer.IsPaused.BindTo(PauseContainer.IsPaused);
|
||||
RulesetContainer.IsPaused.BindTo(PausableGameplayContainer.IsPaused);
|
||||
|
||||
if (ShowStoryboard.Value)
|
||||
initializeStoryboard(false);
|
||||
@ -366,7 +366,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
this.Delay(750).Schedule(() =>
|
||||
{
|
||||
if (!PauseContainer.IsPaused.Value)
|
||||
if (!PausableGameplayContainer.IsPaused.Value)
|
||||
{
|
||||
adjustableClock.Start();
|
||||
}
|
||||
@ -374,8 +374,8 @@ namespace osu.Game.Screens.Play
|
||||
});
|
||||
});
|
||||
|
||||
PauseContainer.Alpha = 0;
|
||||
PauseContainer.FadeIn(750, Easing.OutQuint);
|
||||
PausableGameplayContainer.Alpha = 0;
|
||||
PausableGameplayContainer.FadeIn(750, Easing.OutQuint);
|
||||
}
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
@ -393,7 +393,7 @@ namespace osu.Game.Screens.Play
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((!AllowPause || HasFailed || !ValidForResume || PauseContainer?.IsPaused.Value != false || RulesetContainer?.HasReplayLoaded.Value != false) && (!PauseContainer?.IsResuming ?? true))
|
||||
if ((!AllowPause || HasFailed || !ValidForResume || PausableGameplayContainer?.IsPaused.Value != false || RulesetContainer?.HasReplayLoaded.Value != false) && (!PausableGameplayContainer?.IsResuming ?? true))
|
||||
{
|
||||
// In the case of replays, we may have changed the playback rate.
|
||||
applyRateFromMods();
|
||||
@ -402,7 +402,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
|
||||
if (LoadedBeatmapSuccessfully)
|
||||
PauseContainer?.Pause();
|
||||
PausableGameplayContainer?.Pause();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -416,7 +416,7 @@ namespace osu.Game.Screens.Play
|
||||
storyboardReplacesBackground.Value = false;
|
||||
}
|
||||
|
||||
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !PauseContainer.IsPaused.Value;
|
||||
protected override bool OnScroll(ScrollEvent e) => mouseWheelDisabled.Value && !PausableGameplayContainer.IsPaused.Value;
|
||||
|
||||
private void initializeStoryboard(bool asyncLoad)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user