diff --git a/osu.Game/GameModes/BackgroundMode.cs b/osu.Game/GameModes/BackgroundMode.cs index ee7a016b05..a34ec2d40b 100644 --- a/osu.Game/GameModes/BackgroundMode.cs +++ b/osu.Game/GameModes/BackgroundMode.cs @@ -9,6 +9,8 @@ using System.Threading.Tasks; using osu.Framework.GameModes; using osu.Framework.Graphics.Transformations; using OpenTK; +using osu.Framework.Graphics; +using osu.Framework.Input; namespace osu.Game.GameModes { @@ -46,12 +48,12 @@ namespace osu.Game.GameModes base.OnSuspending(next); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { Content.FadeOut(transition_length, EasingTypes.OutExpo); Content.MoveToX(x_movement_amount, transition_length, EasingTypes.OutExpo); - base.OnExiting(next); + return base.OnExiting(next); } protected override void OnResuming(GameMode last) diff --git a/osu.Game/GameModes/Edit/Editor.cs b/osu.Game/GameModes/Edit/Editor.cs index 9330d57ec6..fbefb38752 100644 --- a/osu.Game/GameModes/Edit/Editor.cs +++ b/osu.Game/GameModes/Edit/Editor.cs @@ -22,10 +22,10 @@ namespace osu.Game.GameModes.Edit Background.FadeColour(Color4.DarkGray, 500); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { - base.OnExiting(next); Background.FadeColour(Color4.White, 500); + return base.OnExiting(next); } } } diff --git a/osu.Game/GameModes/GameModeWhiteBox.cs b/osu.Game/GameModes/GameModeWhiteBox.cs index 25f22f8278..46250d9a91 100644 --- a/osu.Game/GameModes/GameModeWhiteBox.cs +++ b/osu.Game/GameModes/GameModeWhiteBox.cs @@ -53,12 +53,12 @@ namespace osu.Game.GameModes Content.FadeIn(transition_time, EasingTypes.OutExpo); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { - base.OnExiting(next); - textContainer.MoveTo(new Vector2((Size.X / 16), 0), transition_time, EasingTypes.OutExpo); Content.FadeOut(transition_time, EasingTypes.OutExpo); + + return base.OnExiting(next); } protected override void OnSuspending(GameMode next) diff --git a/osu.Game/GameModes/Menu/Intro.cs b/osu.Game/GameModes/Menu/Intro.cs index 4339ec9b29..c2f0599fdd 100644 --- a/osu.Game/GameModes/Menu/Intro.cs +++ b/osu.Game/GameModes/Menu/Intro.cs @@ -15,6 +15,8 @@ namespace osu.Game.GameModes.Menu class Intro : OsuGameMode { private OsuLogo logo; + private bool didLoadMenu; + protected override BackgroundMode CreateBackground() => new BackgroundModeEmpty(); public override void Load() @@ -52,6 +54,7 @@ namespace osu.Game.GameModes.Menu Game.Scheduler.AddDelayed(delegate { + didLoadMenu = true; Push(new MainMenu()); }, 2900); @@ -67,6 +70,12 @@ namespace osu.Game.GameModes.Menu base.OnSuspending(next); } + protected override bool OnExiting(GameMode next) + { + //cancel exiting if we haven't loaded the menu yet. + return !didLoadMenu; + } + protected override void OnResuming(GameMode last) { //we are just an intro. if we are resumed, we just want to exit after a short delay (to allow the last mode to transition out). diff --git a/osu.Game/GameModes/Multiplayer/Match.cs b/osu.Game/GameModes/Multiplayer/Match.cs index 330cb94374..0b12ade697 100644 --- a/osu.Game/GameModes/Multiplayer/Match.cs +++ b/osu.Game/GameModes/Multiplayer/Match.cs @@ -28,10 +28,10 @@ namespace osu.Game.GameModes.Multiplayer Background.FadeColour(Color4.DarkGray, 500); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { - base.OnExiting(next); Background.FadeColour(Color4.White, 500); + return base.OnExiting(next); } } } diff --git a/osu.Game/GameModes/OsuGameMode.cs b/osu.Game/GameModes/OsuGameMode.cs index 8d63de1489..b0755cbca0 100644 --- a/osu.Game/GameModes/OsuGameMode.cs +++ b/osu.Game/GameModes/OsuGameMode.cs @@ -55,14 +55,14 @@ namespace osu.Game.GameModes base.OnEntering(last); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { OsuGameMode nextOsu = next as OsuGameMode; if (Background != null && !Background.Equals(nextOsu?.Background)) Background.Exit(); - base.OnExiting(next); + return base.OnExiting(next); } } } diff --git a/osu.Game/GameModes/Play/ModSelect.cs b/osu.Game/GameModes/Play/ModSelect.cs index bbdc7bf6ce..525fdeeb94 100644 --- a/osu.Game/GameModes/Play/ModSelect.cs +++ b/osu.Game/GameModes/Play/ModSelect.cs @@ -22,10 +22,10 @@ namespace osu.Game.GameModes.Play Background.FadeColour(Color4.DarkGray, 500); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { - base.OnExiting(next); Background.FadeColour(Color4.White, 500); + return base.OnExiting(next); } } } diff --git a/osu.Game/GameModes/Play/Results.cs b/osu.Game/GameModes/Play/Results.cs index d7ba02c40f..4974966aa9 100644 --- a/osu.Game/GameModes/Play/Results.cs +++ b/osu.Game/GameModes/Play/Results.cs @@ -22,10 +22,10 @@ namespace osu.Game.GameModes.Play Background.FadeColour(Color4.DarkGray, 500); } - protected override void OnExiting(GameMode next) + protected override bool OnExiting(GameMode next) { - base.OnExiting(next); Background.FadeColour(Color4.White, 500); + return base.OnExiting(next); } } }