mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Revert "Use fades instead of event listening. Fixed same issue in the playlist room creation."
This reverts commit 3a7608275d
.
This commit is contained in:
parent
3a7608275d
commit
9b7187e3c8
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user