Use IsCurrentScreen instead of a bool for both checks now.

This commit is contained in:
Michael Manis
2018-01-21 22:27:15 -05:00
parent 964c6da9a4
commit 530e0afa2c

View File

@ -88,8 +88,6 @@ namespace osu.Game.Screens.Play
private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true; private bool loadedSuccessfully => RulesetContainer?.Objects.Any() == true;
private bool allowRestart = true;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config, APIAccess api) private void load(AudioManager audio, OsuConfigManager config, APIAccess api)
{ {
@ -210,7 +208,7 @@ namespace osu.Game.Screens.Play
new HotkeyRetryOverlay new HotkeyRetryOverlay
{ {
Action = () => { Action = () => {
if (allowRestart) { if (IsCurrentScreen) {
//we want to hide the hitrenderer immediately (looks better). //we want to hide the hitrenderer immediately (looks better).
//we may be able to remove this once the mouse cursor trail is improved. //we may be able to remove this once the mouse cursor trail is improved.
RulesetContainer?.Hide(); RulesetContainer?.Hide();
@ -294,8 +292,6 @@ namespace osu.Game.Screens.Play
{ {
if (IsCurrentScreen) if (IsCurrentScreen)
{ {
allowRestart = false;
var score = new Score var score = new Score
{ {
Beatmap = Beatmap.Value.BeatmapInfo, Beatmap = Beatmap.Value.BeatmapInfo,