1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 05:52:55 +08:00

Re-layout match settings overlay

This commit is contained in:
smoogipoo 2020-02-14 20:34:15 +09:00
parent d5496321e2
commit d0b7b7f53a

View File

@ -25,6 +25,8 @@ namespace osu.Game.Screens.Multi.Match.Components
private const float transition_duration = 350;
private const float field_padding = 45;
public Action EditPlaylist;
protected MatchSettings Settings { get; private set; }
[BackgroundDependencyLoader]
@ -35,7 +37,8 @@ namespace osu.Game.Screens.Multi.Match.Components
Child = Settings = new MatchSettings
{
RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Y
RelativePositionAxes = Axes.Y,
EditPlaylist = () => EditPlaylist?.Invoke()
};
}
@ -53,6 +56,8 @@ namespace osu.Game.Screens.Multi.Match.Components
{
private const float disabled_alpha = 0.2f;
public Action EditPlaylist;
public OsuTextBox NameField, MaxParticipantsField;
public OsuDropdown<TimeSpan> DurationField;
public RoomAvailabilityPicker AvailabilityPicker;
@ -63,6 +68,7 @@ namespace osu.Game.Screens.Multi.Match.Components
private OsuSpriteText typeLabel;
private ProcessingOverlay processingOverlay;
private DrawableRoomPlaylist playlist;
[Resolved(CanBeNull = true)]
private IRoomManager manager { get; set; }
@ -155,15 +161,6 @@ namespace osu.Game.Screens.Multi.Match.Components
},
},
},
},
},
new SectionContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Padding = new MarginPadding { Left = field_padding / 2 },
Children = new[]
{
new Section("Max participants")
{
Alpha = disabled_alpha,
@ -208,6 +205,45 @@ namespace osu.Game.Screens.Multi.Match.Components
},
},
},
new SectionContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Padding = new MarginPadding { Left = field_padding / 2 },
Children = new[]
{
new Section("Playlist")
{
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,
Height = 300,
Content = new[]
{
new Drawable[]
{
playlist = new DrawableRoomPlaylist(true, true) { RelativeSizeAxes = Axes.Both }
},
new Drawable[]
{
new OsuButton
{
RelativeSizeAxes = Axes.X,
Height = 40,
Text = "Edit playlist",
Action = () => EditPlaylist?.Invoke()
}
}
},
RowDimensions = new[]
{
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
}
}
},
},
},
},
}
},
@ -271,6 +307,8 @@ namespace osu.Game.Screens.Multi.Match.Components
Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
Duration.BindValueChanged(duration => DurationField.Current.Value = duration.NewValue, true);
playlist.Items.BindTo(Playlist);
}
protected override void Update()