Reset to welcome screen on exiting mid-process

This commit is contained in:
Dean Herbert 2018-12-06 12:38:11 +09:00
parent d3f5111fa1
commit 88052dcea1
2 changed files with 12 additions and 6 deletions

View File

@ -8,17 +8,18 @@ namespace osu.Game.Overlays.AccountCreation
{ {
public abstract class AccountCreationScreen : Screen public abstract class AccountCreationScreen : Screen
{ {
protected AccountCreationScreen()
{
ValidForResume = false;
}
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)
{ {
base.OnEntering(last); base.OnEntering(last);
Content.FadeOut().Delay(200).FadeIn(200); Content.FadeOut().Delay(200).FadeIn(200);
} }
protected override void OnResuming(Screen last)
{
base.OnResuming(last);
Content.FadeIn(200);
}
protected override void OnSuspending(Screen next) protected override void OnSuspending(Screen next)
{ {
base.OnSuspending(next); base.OnSuspending(next);

View File

@ -19,6 +19,8 @@ namespace osu.Game.Overlays
{ {
private const float transition_time = 400; private const float transition_time = 400;
private ScreenWelcome welcomeScreen;
public AccountCreationOverlay() public AccountCreationOverlay()
{ {
Size = new Vector2(620, 450); Size = new Vector2(620, 450);
@ -67,7 +69,7 @@ namespace osu.Game.Overlays
Colour = Color4.Black, Colour = Color4.Black,
Alpha = 0.9f, Alpha = 0.9f,
}, },
new ScreenWelcome(), welcomeScreen = new ScreenWelcome(),
} }
} }
} }
@ -79,6 +81,9 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
this.FadeIn(transition_time, Easing.OutQuint); this.FadeIn(transition_time, Easing.OutQuint);
if (welcomeScreen.ChildScreen != null)
welcomeScreen.MakeCurrent();
} }
protected override void PopOut() protected override void PopOut()