Limit max size

This commit is contained in:
smoogipoo 2021-09-29 20:44:38 +09:00
parent 67d847fbd3
commit c9c2d20544

View File

@ -137,7 +137,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
{ {
new FillFlowContainer new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
{ {
@ -167,7 +168,8 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
}, },
new FillFlowContainer new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Top = 3 }, Padding = new MarginPadding { Top = 3 },
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
@ -310,23 +312,47 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
[Resolved] [Resolved]
private OsuColour colours { get; set; } private OsuColour colours { get; set; }
private LinkFlowContainer linkFlow; private SpriteText statusText;
private LinkFlowContainer beatmapText;
public RoomStatusText() public RoomStatusText()
{ {
AutoSizeAxes = Axes.Both; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Width = 0.5f;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
InternalChild = linkFlow = new LinkFlowContainer(s => InternalChild = new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
ColumnDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new Drawable[]
{
statusText = new OsuSpriteText
{
Font = OsuFont.Default.With(size: 16),
Colour = colours.Lime1
},
beatmapText = new LinkFlowContainer(s =>
{ {
s.Font = OsuFont.Default.With(size: 16); s.Font = OsuFont.Default.With(size: 16);
s.Colour = colours.Lime1; s.Colour = colours.Lime1;
}) })
{ {
AutoSizeAxes = Axes.Both, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y
}
}
}
}; };
} }
@ -338,18 +364,25 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
private void onSelectedItemChanged(ValueChangedEvent<PlaylistItem> item) private void onSelectedItemChanged(ValueChangedEvent<PlaylistItem> item)
{ {
beatmapText.Clear();
if (Type.Value == MatchType.Playlists) if (Type.Value == MatchType.Playlists)
{ {
linkFlow.Text = "Waiting for players"; statusText.Text = "Waiting for players";
return; return;
} }
linkFlow.Clear();
if (item.NewValue?.Beatmap.Value != null) if (item.NewValue?.Beatmap.Value != null)
{ {
linkFlow.AddText("Currently playing "); statusText.Text = "Currently playing ";
linkFlow.AddLink(item.NewValue.Beatmap.Value.ToRomanisableString(), LinkAction.OpenBeatmap, item.NewValue.Beatmap.Value.OnlineBeatmapID.ToString()); beatmapText.AddLink(item.NewValue.Beatmap.Value.ToRomanisableString(),
LinkAction.OpenBeatmap,
item.NewValue.Beatmap.Value.OnlineBeatmapID.ToString(),
creationParameters: s =>
{
s.Truncate = true;
s.RelativeSizeAxes = Axes.X;
});
} }
} }
} }