1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 17:02:55 +08:00

Simplify MultiSpectatorScreen hierarchy construction

This commit is contained in:
Dean Herbert 2022-08-24 16:08:48 +09:00
parent 7c1fc4814e
commit 7f9246637a

View File

@ -73,53 +73,54 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
FillFlowContainer leaderboardFlow; FillFlowContainer leaderboardFlow;
Container scoreDisplayContainer; Container scoreDisplayContainer;
masterClockContainer = new MasterGameplayClockContainer(Beatmap.Value, 0); InternalChildren = new Drawable[]
InternalChildren = new[]
{ {
(Drawable)(syncManager = new SpectatorSyncManager(masterClockContainer) masterClockContainer = new MasterGameplayClockContainer(Beatmap.Value, 0)
{ {
ReadyToStart = performInitialSeek, Child = new GridContainer
}),
masterClockContainer.WithChild(new GridContainer
{
RelativeSizeAxes = Axes.Both,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{ {
new Drawable[] RelativeSizeAxes = Axes.Both,
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{ {
scoreDisplayContainer = new Container new Drawable[]
{ {
RelativeSizeAxes = Axes.X, scoreDisplayContainer = new Container
AutoSizeAxes = Axes.Y
},
},
new Drawable[]
{
new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{ {
new Drawable[] RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y
},
},
new Drawable[]
{
new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
Content = new[]
{ {
leaderboardFlow = new FillFlowContainer new Drawable[]
{ {
Anchor = Anchor.CentreLeft, leaderboardFlow = new FillFlowContainer
Origin = Anchor.CentreLeft, {
AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft,
Direction = FillDirection.Vertical, Origin = Anchor.CentreLeft,
Spacing = new Vector2(5) AutoSizeAxes = Axes.Both,
}, Direction = FillDirection.Vertical,
grid = new PlayerGrid { RelativeSizeAxes = Axes.Both } Spacing = new Vector2(5)
},
grid = new PlayerGrid { RelativeSizeAxes = Axes.Both }
}
} }
} }
} }
} }
} }
}) },
syncManager = new SpectatorSyncManager(masterClockContainer)
{
ReadyToStart = performInitialSeek,
}
}; };
for (int i = 0; i < Users.Count; i++) for (int i = 0; i < Users.Count; i++)