mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 19:15:38 +08:00
Re-layout match settings overlay
This commit is contained in:
parent
d5496321e2
commit
d0b7b7f53a
@ -25,6 +25,8 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
private const float transition_duration = 350;
|
private const float transition_duration = 350;
|
||||||
private const float field_padding = 45;
|
private const float field_padding = 45;
|
||||||
|
|
||||||
|
public Action EditPlaylist;
|
||||||
|
|
||||||
protected MatchSettings Settings { get; private set; }
|
protected MatchSettings Settings { get; private set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -35,7 +37,8 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
Child = Settings = new MatchSettings
|
Child = Settings = new MatchSettings
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
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;
|
private const float disabled_alpha = 0.2f;
|
||||||
|
|
||||||
|
public Action EditPlaylist;
|
||||||
|
|
||||||
public OsuTextBox NameField, MaxParticipantsField;
|
public OsuTextBox NameField, MaxParticipantsField;
|
||||||
public OsuDropdown<TimeSpan> DurationField;
|
public OsuDropdown<TimeSpan> DurationField;
|
||||||
public RoomAvailabilityPicker AvailabilityPicker;
|
public RoomAvailabilityPicker AvailabilityPicker;
|
||||||
@ -63,6 +68,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
|
|
||||||
private OsuSpriteText typeLabel;
|
private OsuSpriteText typeLabel;
|
||||||
private ProcessingOverlay processingOverlay;
|
private ProcessingOverlay processingOverlay;
|
||||||
|
private DrawableRoomPlaylist playlist;
|
||||||
|
|
||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private IRoomManager manager { get; set; }
|
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")
|
new Section("Max participants")
|
||||||
{
|
{
|
||||||
Alpha = disabled_alpha,
|
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);
|
Type.BindValueChanged(type => TypePicker.Current.Value = type.NewValue, true);
|
||||||
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
|
MaxParticipants.BindValueChanged(count => MaxParticipantsField.Text = count.NewValue?.ToString(), true);
|
||||||
Duration.BindValueChanged(duration => DurationField.Current.Value = duration.NewValue, true);
|
Duration.BindValueChanged(duration => DurationField.Current.Value = duration.NewValue, true);
|
||||||
|
|
||||||
|
playlist.Items.BindTo(Playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user