Merge branch 'master' into fix-cursor-in-scale-container

This commit is contained in:
Dean Herbert
2019-03-05 22:22:56 +09:00
committed by GitHub
23 changed files with 340 additions and 151 deletions

View File

@ -67,7 +67,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;
@ -170,10 +170,10 @@ namespace osu.Game.Screens.Play
InternalChildren = new Drawable[]
{
PauseContainer = new PauseContainer(offsetClock, adjustableClock)
PausableGameplayContainer = new PausableGameplayContainer(offsetClock, adjustableClock)
{
Retries = RestartCount,
OnRetry = Restart,
OnRetry = restart,
OnQuit = performUserRequestedExit,
CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded.Value,
Children = new Container[]
@ -191,32 +191,26 @@ namespace osu.Game.Screens.Play
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
ProcessCustomClock = false,
Breaks = beatmap.Breaks
},
new ScalingContainer(ScalingMode.Gameplay)
{
Child = RulesetContainer.Cursor?.CreateProxy() ?? new Container(),
},
HUDOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working, offsetClock, adjustableClock)
HUDOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working, adjustableClock)
{
Clock = Clock, // hud overlay doesn't want to use the audio clock directly
ProcessCustomClock = false,
Anchor = Anchor.Centre,
Origin = Anchor.Centre
},
new SkipOverlay(RulesetContainer.GameplayStartTime)
{
Clock = Clock, // skip button doesn't want to use the audio clock directly
ProcessCustomClock = false,
AdjustableClock = adjustableClock,
FramedClock = offsetClock,
RequestSeek = time => adjustableClock.Seek(time)
},
}
},
failOverlay = new FailOverlay
{
OnRetry = Restart,
OnRetry = restart,
OnQuit = performUserRequestedExit,
},
new HotkeyRetryOverlay
@ -226,7 +220,7 @@ namespace osu.Game.Screens.Play
if (!this.IsCurrentScreen()) return;
fadeOut(true);
Restart();
restart();
},
}
};
@ -234,7 +228,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);
@ -263,7 +257,7 @@ namespace osu.Game.Screens.Play
this.Exit();
}
public void Restart()
private void restart()
{
if (!this.IsCurrentScreen()) return;
@ -367,7 +361,7 @@ namespace osu.Game.Screens.Play
this.Delay(750).Schedule(() =>
{
if (!PauseContainer.IsPaused.Value)
if (!PausableGameplayContainer.IsPaused.Value)
{
adjustableClock.Start();
}
@ -375,8 +369,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)
@ -394,7 +388,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();
@ -403,7 +397,7 @@ namespace osu.Game.Screens.Play
}
if (LoadedBeatmapSuccessfully)
PauseContainer?.Pause();
PausableGameplayContainer?.Pause();
return true;
}
@ -417,7 +411,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)
{