1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 03:22:55 +08:00

Push to main multiplayer screen instead

This commit is contained in:
smoogipoo 2020-06-03 15:57:01 +09:00
parent 22f4e9012c
commit 3c07defa1a
2 changed files with 4 additions and 18 deletions

View File

@ -20,6 +20,7 @@ using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Match.Components;
using osu.Game.Screens.Multi.Play;
using osu.Game.Screens.Multi.Ranking;
using osu.Game.Screens.Play;
using osu.Game.Screens.Select;
using Footer = osu.Game.Screens.Multi.Match.Components.Footer;
@ -260,10 +261,10 @@ namespace osu.Game.Screens.Multi.Match
{
default:
case GameTypeTimeshift _:
multiplayer?.Start(() => new TimeshiftPlayer(SelectedItem.Value)
multiplayer?.Push(new PlayerLoader(() => new TimeshiftPlayer(SelectedItem.Value)
{
Exited = () => leaderboardChatDisplay.RefreshScores()
});
}));
break;
}
}
@ -271,8 +272,7 @@ namespace osu.Game.Screens.Multi.Match
private void showBeatmapResults()
{
Debug.Assert(roomId.Value != null);
this.Push(new TimeshiftResultsScreen(null, roomId.Value.Value, SelectedItem.Value, false));
multiplayer?.Push(new TimeshiftResultsScreen(null, roomId.Value.Value, SelectedItem.Value, false));
}
}
}

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@ -24,7 +23,6 @@ using osu.Game.Screens.Multi.Lounge;
using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Match;
using osu.Game.Screens.Multi.Match.Components;
using osu.Game.Screens.Play;
using osuTK;
namespace osu.Game.Screens.Multi
@ -197,18 +195,6 @@ namespace osu.Game.Screens.Multi
Logger.Log($"Polling adjusted (listing: {roomManager.TimeBetweenListingPolls}, selection: {roomManager.TimeBetweenSelectionPolls})");
}
/// <summary>
/// Push a <see cref="Player"/> to the main screen stack to begin gameplay.
/// Generally called from a <see cref="MatchSubScreen"/> via DI resolution.
/// </summary>
public void Start(Func<Player> player)
{
if (!this.IsCurrentScreen())
return;
this.Push(new PlayerLoader(player));
}
public void APIStateChanged(IAPIProvider api, APIState state)
{
if (state != APIState.Online)