diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs index 03a76c66f2..38c2ca7e0c 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSubScreen.cs @@ -180,40 +180,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer State = { Value = client.Room == null ? Visibility.Visible : Visibility.Hidden } } }; - } - public override void OnEntering(IScreen last) - { - base.OnEntering(last); - - subScreenContainer.FadeOut().Delay(1000).FadeIn(500); - } - - public override bool OnExiting(IScreen next) - { - if (base.OnExiting(next)) - return true; - - subScreenContainer.FadeOut(); - - return false; - } - - public override void OnResuming(IScreen last) - { - base.OnResuming(last); - - if (client.Room == null) - subScreenContainer.FadeOut().Delay(1000).FadeIn(500); - else - subScreenContainer.FadeInFromZero(); - } - - public override void OnSuspending(IScreen next) - { - subScreenContainer.FadeOut(); - - base.OnSuspending(next); + subScreenContainer.Hide(); + client.RoomUpdated += roomUpdated; } protected override void LoadComplete() @@ -294,6 +263,16 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer readyClickOperation = null; } + private void roomUpdated() + { + if (client.Room != null) + { + // If the room is updated and is not null, show the room sub screen container and unsubscribe. + subScreenContainer.Show(); + client.RoomUpdated -= roomUpdated; + } + } + protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); diff --git a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs index 583956b3f1..e76ca995bf 100644 --- a/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs +++ b/osu.Game/Screens/OnlinePlay/Playlists/PlaylistsRoomSubScreen.cs @@ -33,8 +33,6 @@ namespace osu.Game.Screens.OnlinePlay.Playlists private OverlinedHeader participantsHeader; - private GridContainer subScreenContainer; - public PlaylistsRoomSubScreen(Room room) { Title = room.RoomID.Value == null ? "New playlist" : room.Name.Value; @@ -46,7 +44,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists { InternalChildren = new Drawable[] { - subScreenContainer = new GridContainer + new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] @@ -197,40 +195,6 @@ namespace osu.Game.Screens.OnlinePlay.Playlists [Resolved] private IAPIProvider api { get; set; } - public override void OnEntering(IScreen last) - { - base.OnEntering(last); - - subScreenContainer.FadeOut().Delay(1000).FadeIn(500); - } - - public override bool OnExiting(IScreen next) - { - if (base.OnExiting(next)) - return true; - - subScreenContainer.FadeOut(); - - return false; - } - - public override void OnResuming(IScreen last) - { - base.OnResuming(last); - - if (roomId.Value == null) - subScreenContainer.FadeOut().Delay(1000).FadeIn(500); - else - subScreenContainer.FadeInFromZero(); - } - - public override void OnSuspending(IScreen next) - { - subScreenContainer.FadeOut(); - - base.OnSuspending(next); - } - protected override void LoadComplete() { base.LoadComplete();