mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Fix queue mode not being bound to in all cases
This commit is contained in:
parent
ad35f3434b
commit
e87b0003fb
@ -181,6 +181,6 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
});
|
||||
}
|
||||
|
||||
private void changeQueueModeStep(QueueMode newMode) => AddStep($"change queue mode to {newMode}", () => list.QueueMode.Value = newMode);
|
||||
private void changeQueueModeStep(QueueMode newMode) => AddStep($"change queue mode to {newMode}", () => SelectedRoom.Value.QueueMode.Value = newMode);
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
||||
/// </summary>
|
||||
public class MultiplayerQueueList : DrawableRoomPlaylist
|
||||
{
|
||||
public readonly Bindable<QueueMode> QueueMode = new Bindable<QueueMode>();
|
||||
|
||||
public MultiplayerQueueList()
|
||||
: base(false, false, true)
|
||||
{
|
||||
@ -28,13 +26,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
||||
|
||||
protected override FillFlowContainer<RearrangeableListItem<PlaylistItem>> CreateListFillFlowContainer() => new QueueFillFlowContainer
|
||||
{
|
||||
QueueMode = { BindTarget = QueueMode },
|
||||
Spacing = new Vector2(0, 2)
|
||||
};
|
||||
|
||||
private class QueueFillFlowContainer : FillFlowContainer<RearrangeableListItem<PlaylistItem>>
|
||||
{
|
||||
public readonly IBindable<QueueMode> QueueMode = new Bindable<QueueMode>();
|
||||
[Resolved(typeof(Room), nameof(Room.QueueMode))]
|
||||
private Bindable<QueueMode> queueMode { get; set; }
|
||||
|
||||
[Resolved(typeof(Room), nameof(Room.Playlist))]
|
||||
private BindableList<PlaylistItem> roomPlaylist { get; set; }
|
||||
@ -42,21 +40,21 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
QueueMode.BindValueChanged(_ => InvalidateLayout());
|
||||
queueMode.BindValueChanged(_ => InvalidateLayout());
|
||||
}
|
||||
|
||||
public override IEnumerable<Drawable> FlowingChildren
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (QueueMode.Value)
|
||||
switch (queueMode.Value)
|
||||
{
|
||||
default:
|
||||
return AliveInternalChildren.Where(d => d.IsPresent)
|
||||
.OfType<RearrangeableListItem<PlaylistItem>>()
|
||||
.OrderBy(item => item.Model.ID);
|
||||
|
||||
case Game.Online.Multiplayer.QueueMode.AllPlayersRoundRobin:
|
||||
case QueueMode.AllPlayersRoundRobin:
|
||||
RearrangeableListItem<PlaylistItem>[] items = AliveInternalChildren
|
||||
.Where(d => d.IsPresent)
|
||||
.OfType<RearrangeableListItem<PlaylistItem>>()
|
||||
|
Loading…
Reference in New Issue
Block a user