mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 05:22:54 +08:00
Merge pull request #11537 from Mysfit/mp-initial-creation-screen-fix
Fix match/playlist room screen showing briefly behind initial room settings window on creation.
This commit is contained in:
commit
7da7079ef2
@ -11,12 +11,10 @@ using osu.Framework.Platform;
|
|||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics.UserInterface;
|
|
||||||
using osu.Game.Online.Rooms;
|
using osu.Game.Online.Rooms;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Osu;
|
using osu.Game.Rulesets.Osu;
|
||||||
using osu.Game.Screens.OnlinePlay;
|
using osu.Game.Screens.OnlinePlay;
|
||||||
using osu.Game.Screens.OnlinePlay.Match.Components;
|
|
||||||
using osu.Game.Screens.OnlinePlay.Playlists;
|
using osu.Game.Screens.OnlinePlay.Playlists;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -85,8 +83,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
|||||||
|
|
||||||
AddStep("move mouse to create button", () =>
|
AddStep("move mouse to create button", () =>
|
||||||
{
|
{
|
||||||
var footer = match.ChildrenOfType<Footer>().Single();
|
InputManager.MoveMouseTo(this.ChildrenOfType<PlaylistsMatchSettingsOverlay.CreateRoomButton>().Single());
|
||||||
InputManager.MoveMouseTo(footer.ChildrenOfType<OsuButton>().Single());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
|
@ -44,6 +44,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
private IDisposable readyClickOperation;
|
private IDisposable readyClickOperation;
|
||||||
|
|
||||||
|
private GridContainer mainContent;
|
||||||
|
|
||||||
public MultiplayerMatchSubScreen(Room room)
|
public MultiplayerMatchSubScreen(Room room)
|
||||||
{
|
{
|
||||||
Title = room.RoomID.Value == null ? "New room" : room.Name.Value;
|
Title = room.RoomID.Value == null ? "New room" : room.Name.Value;
|
||||||
@ -55,7 +57,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new GridContainer
|
mainContent = new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Content = new[]
|
Content = new[]
|
||||||
@ -178,6 +180,19 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
State = { Value = client.Room == null ? Visibility.Visible : Visibility.Hidden }
|
State = { Value = client.Room == null ? Visibility.Visible : Visibility.Hidden }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (client.Room == null)
|
||||||
|
{
|
||||||
|
// A new room is being created.
|
||||||
|
// The main content should be hidden until the settings overlay is hidden, signaling the room is ready to be displayed.
|
||||||
|
mainContent.Hide();
|
||||||
|
|
||||||
|
settingsOverlay.State.BindValueChanged(visibility =>
|
||||||
|
{
|
||||||
|
if (visibility.NewValue == Visibility.Hidden)
|
||||||
|
mainContent.Show();
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -33,6 +33,8 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
|
|
||||||
private OverlinedHeader participantsHeader;
|
private OverlinedHeader participantsHeader;
|
||||||
|
|
||||||
|
private GridContainer mainContent;
|
||||||
|
|
||||||
public PlaylistsRoomSubScreen(Room room)
|
public PlaylistsRoomSubScreen(Room room)
|
||||||
{
|
{
|
||||||
Title = room.RoomID.Value == null ? "New playlist" : room.Name.Value;
|
Title = room.RoomID.Value == null ? "New playlist" : room.Name.Value;
|
||||||
@ -44,7 +46,7 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
{
|
{
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new GridContainer
|
mainContent = new GridContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Content = new[]
|
Content = new[]
|
||||||
@ -190,6 +192,19 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
State = { Value = roomId.Value == null ? Visibility.Visible : Visibility.Hidden }
|
State = { Value = roomId.Value == null ? Visibility.Visible : Visibility.Hidden }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (roomId.Value == null)
|
||||||
|
{
|
||||||
|
// A new room is being created.
|
||||||
|
// The main content should be hidden until the settings overlay is hidden, signaling the room is ready to be displayed.
|
||||||
|
mainContent.Hide();
|
||||||
|
|
||||||
|
settingsOverlay.State.BindValueChanged(visibility =>
|
||||||
|
{
|
||||||
|
if (visibility.NewValue == Visibility.Hidden)
|
||||||
|
mainContent.Show();
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
|
Loading…
Reference in New Issue
Block a user