mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 13:13:22 +08:00
Merge pull request #19528 from Joehuu/fix-op-non-current-onexiting
Fix online play screen only accounting for current sub screen onexiting blocks
This commit is contained in:
commit
60eeb4607c
@ -27,6 +27,7 @@ using osu.Game.Rulesets.Osu.Mods;
|
|||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Menu;
|
using osu.Game.Screens.Menu;
|
||||||
using osu.Game.Screens.OnlinePlay.Lounge;
|
using osu.Game.Screens.OnlinePlay.Lounge;
|
||||||
|
using osu.Game.Screens.OnlinePlay.Match.Components;
|
||||||
using osu.Game.Screens.OnlinePlay.Playlists;
|
using osu.Game.Screens.OnlinePlay.Playlists;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
@ -80,7 +81,25 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
|
|
||||||
AddUntilStep("wait for return to playlist screen", () => playlistScreen.CurrentSubScreen is PlaylistsRoomSubScreen);
|
AddUntilStep("wait for return to playlist screen", () => playlistScreen.CurrentSubScreen is PlaylistsRoomSubScreen);
|
||||||
|
|
||||||
|
AddStep("go back to song select", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(playlistScreen.ChildrenOfType<PurpleRoundedButton>().Single(b => b.Text == "Edit playlist"));
|
||||||
|
InputManager.Click(MouseButton.Left);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("wait for song select", () => (playlistScreen.CurrentSubScreen as PlaylistsSongSelect)?.BeatmapSetsLoaded == true);
|
||||||
|
|
||||||
|
AddStep("press home button", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(Game.Toolbar.ChildrenOfType<ToolbarHomeButton>().Single());
|
||||||
|
InputManager.Click(MouseButton.Left);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddAssert("confirmation dialog shown", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is not null);
|
||||||
|
|
||||||
pushEscape();
|
pushEscape();
|
||||||
|
pushEscape();
|
||||||
|
|
||||||
AddAssert("confirmation dialog shown", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is not null);
|
AddAssert("confirmation dialog shown", () => Game.ChildrenOfType<DialogOverlay>().Single().CurrentDialog is not null);
|
||||||
|
|
||||||
AddStep("confirm exit", () => InputManager.Key(Key.Enter));
|
AddStep("confirm exit", () => InputManager.Key(Key.Enter));
|
||||||
|
@ -148,9 +148,14 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
public override bool OnExiting(ScreenExitEvent e)
|
public override bool OnExiting(ScreenExitEvent e)
|
||||||
{
|
{
|
||||||
var subScreen = screenStack.CurrentScreen as Drawable;
|
while (screenStack.CurrentScreen != null && screenStack.CurrentScreen is not LoungeSubScreen)
|
||||||
if (subScreen?.IsLoaded == true && screenStack.CurrentScreen.OnExiting(e))
|
{
|
||||||
return true;
|
var subScreen = (Screen)screenStack.CurrentScreen;
|
||||||
|
if (subScreen.IsLoaded && subScreen.OnExiting(e))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
subScreen.Exit();
|
||||||
|
}
|
||||||
|
|
||||||
RoomManager.PartRoom();
|
RoomManager.PartRoom();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user