mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Unify and smiplify exit logic. Now only OsuGame calls the final Exit.
This commit is contained in:
@ -69,11 +69,8 @@ namespace osu.Game.GameModes.Menu
|
|||||||
|
|
||||||
protected override void OnResuming(GameMode last)
|
protected override void OnResuming(GameMode last)
|
||||||
{
|
{
|
||||||
//this is an exit
|
//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).
|
||||||
Game.Scheduler.AddDelayed(delegate
|
Game.Scheduler.AddDelayed(Exit, 300);
|
||||||
{
|
|
||||||
Game.Exit();
|
|
||||||
}, 300);
|
|
||||||
|
|
||||||
base.OnResuming(last);
|
base.OnResuming(last);
|
||||||
}
|
}
|
||||||
|
@ -47,11 +47,7 @@ namespace osu.Game.GameModes.Menu
|
|||||||
OnSolo = delegate { Push(new PlaySongSelect()); },
|
OnSolo = delegate { Push(new PlaySongSelect()); },
|
||||||
OnMulti = delegate { Push(new Lobby()); },
|
OnMulti = delegate { Push(new Lobby()); },
|
||||||
OnTest = delegate { Push(new TestBrowser()); },
|
OnTest = delegate { Push(new TestBrowser()); },
|
||||||
OnExit = delegate {
|
OnExit = delegate { Game.Scheduler.AddDelayed(Exit, ButtonSystem.EXIT_DELAY); },
|
||||||
Game.Scheduler.AddDelayed(delegate {
|
|
||||||
Exit();
|
|
||||||
}, ButtonSystem.EXIT_DELAY);
|
|
||||||
},
|
|
||||||
OnSettings = delegate {
|
OnSettings = delegate {
|
||||||
osu.Options.PoppedOut = !osu.Options.PoppedOut;
|
osu.Options.PoppedOut = !osu.Options.PoppedOut;
|
||||||
},
|
},
|
||||||
|
@ -64,16 +64,5 @@ namespace osu.Game.GameModes
|
|||||||
|
|
||||||
base.OnExiting(next);
|
base.OnExiting(next);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnResuming(GameMode last)
|
|
||||||
{
|
|
||||||
base.OnResuming(last);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnSuspending(GameMode next)
|
|
||||||
{
|
|
||||||
base.OnSuspending(next);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,6 +60,7 @@ namespace osu.Game
|
|||||||
});
|
});
|
||||||
|
|
||||||
intro.ModePushed += modeAdded;
|
intro.ModePushed += modeAdded;
|
||||||
|
intro.Exited += modeRemoved;
|
||||||
|
|
||||||
PlayMode = Config.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
PlayMode = Config.GetBindable<PlayMode>(OsuConfig.PlayMode);
|
||||||
PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); };
|
PlayMode.ValueChanged += delegate { Toolbar.SetGameMode(PlayMode.Value); };
|
||||||
@ -89,6 +90,9 @@ namespace osu.Game
|
|||||||
Cursor.FadeIn(100);
|
Cursor.FadeIn(100);
|
||||||
|
|
||||||
ModeChanged?.Invoke(newMode);
|
ModeChanged?.Invoke(newMode);
|
||||||
|
|
||||||
|
if (newMode == null)
|
||||||
|
Host.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void modeAdded(GameMode newMode)
|
private void modeAdded(GameMode newMode)
|
||||||
|
Reference in New Issue
Block a user