mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +08:00
Remove a couple more overrides
This commit is contained in:
parent
fd9c7184e4
commit
3dd18c777a
@ -40,8 +40,6 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
|
|||||||
{
|
{
|
||||||
public override string Title => "Lounge";
|
public override string Title => "Lounge";
|
||||||
|
|
||||||
protected override bool PlayExitSound => false;
|
|
||||||
|
|
||||||
protected override BackgroundScreen CreateBackground() => new LoungeBackgroundScreen
|
protected override BackgroundScreen CreateBackground() => new LoungeBackgroundScreen
|
||||||
{
|
{
|
||||||
SelectedRoom = { BindTarget = SelectedRoom }
|
SelectedRoom = { BindTarget = SelectedRoom }
|
||||||
|
@ -44,8 +44,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
|
|
||||||
public override string ShortTitle => "room";
|
public override string ShortTitle => "room";
|
||||||
|
|
||||||
protected override bool PlayExitSound => !exitConfirmed;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private MultiplayerClient client { get; set; }
|
private MultiplayerClient client { get; set; }
|
||||||
|
|
||||||
@ -249,15 +247,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private IDialogOverlay dialogOverlay { get; set; }
|
private IDialogOverlay dialogOverlay { get; set; }
|
||||||
|
|
||||||
private bool exitConfirmed;
|
|
||||||
|
|
||||||
public override bool OnExiting(ScreenExitEvent e)
|
public override bool OnExiting(ScreenExitEvent e)
|
||||||
{
|
{
|
||||||
// room has not been created yet or we're offline; exit immediately.
|
// room has not been created yet or we're offline; exit immediately.
|
||||||
if (client.Room == null || !IsConnected)
|
if (client.Room == null || !IsConnected)
|
||||||
return base.OnExiting(e);
|
return base.OnExiting(e);
|
||||||
|
|
||||||
if (!exitConfirmed && dialogOverlay != null)
|
if (dialogOverlay != null)
|
||||||
{
|
{
|
||||||
if (dialogOverlay.CurrentDialog is ConfirmDialog confirmDialog)
|
if (dialogOverlay.CurrentDialog is ConfirmDialog confirmDialog)
|
||||||
confirmDialog.PerformOkAction();
|
confirmDialog.PerformOkAction();
|
||||||
@ -265,7 +261,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
dialogOverlay.Push(new ConfirmDialog("Are you sure you want to leave this multiplayer match?", () =>
|
dialogOverlay.Push(new ConfirmDialog("Are you sure you want to leave this multiplayer match?", () =>
|
||||||
{
|
{
|
||||||
exitConfirmed = true;
|
|
||||||
if (this.IsCurrentScreen())
|
if (this.IsCurrentScreen())
|
||||||
this.Exit();
|
this.Exit();
|
||||||
}));
|
}));
|
||||||
|
@ -13,7 +13,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
public virtual string ShortTitle => Title;
|
public virtual string ShortTitle => Title;
|
||||||
|
|
||||||
protected override bool PlayExitSound => false;
|
protected sealed override bool PlayExitSound => false;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected IRoomManager? RoomManager { get; private set; }
|
protected IRoomManager? RoomManager { get; private set; }
|
||||||
|
Loading…
Reference in New Issue
Block a user