mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Fix queue mode not being bound to in all cases
This commit is contained in:
@ -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>
|
/// </summary>
|
||||||
public class MultiplayerQueueList : DrawableRoomPlaylist
|
public class MultiplayerQueueList : DrawableRoomPlaylist
|
||||||
{
|
{
|
||||||
public readonly Bindable<QueueMode> QueueMode = new Bindable<QueueMode>();
|
|
||||||
|
|
||||||
public MultiplayerQueueList()
|
public MultiplayerQueueList()
|
||||||
: base(false, false, true)
|
: base(false, false, true)
|
||||||
{
|
{
|
||||||
@ -28,13 +26,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
|||||||
|
|
||||||
protected override FillFlowContainer<RearrangeableListItem<PlaylistItem>> CreateListFillFlowContainer() => new QueueFillFlowContainer
|
protected override FillFlowContainer<RearrangeableListItem<PlaylistItem>> CreateListFillFlowContainer() => new QueueFillFlowContainer
|
||||||
{
|
{
|
||||||
QueueMode = { BindTarget = QueueMode },
|
|
||||||
Spacing = new Vector2(0, 2)
|
Spacing = new Vector2(0, 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
private class QueueFillFlowContainer : FillFlowContainer<RearrangeableListItem<PlaylistItem>>
|
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))]
|
[Resolved(typeof(Room), nameof(Room.Playlist))]
|
||||||
private BindableList<PlaylistItem> roomPlaylist { get; set; }
|
private BindableList<PlaylistItem> roomPlaylist { get; set; }
|
||||||
@ -42,21 +40,21 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
QueueMode.BindValueChanged(_ => InvalidateLayout());
|
queueMode.BindValueChanged(_ => InvalidateLayout());
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<Drawable> FlowingChildren
|
public override IEnumerable<Drawable> FlowingChildren
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
switch (QueueMode.Value)
|
switch (queueMode.Value)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
return AliveInternalChildren.Where(d => d.IsPresent)
|
return AliveInternalChildren.Where(d => d.IsPresent)
|
||||||
.OfType<RearrangeableListItem<PlaylistItem>>()
|
.OfType<RearrangeableListItem<PlaylistItem>>()
|
||||||
.OrderBy(item => item.Model.ID);
|
.OrderBy(item => item.Model.ID);
|
||||||
|
|
||||||
case Game.Online.Multiplayer.QueueMode.AllPlayersRoundRobin:
|
case QueueMode.AllPlayersRoundRobin:
|
||||||
RearrangeableListItem<PlaylistItem>[] items = AliveInternalChildren
|
RearrangeableListItem<PlaylistItem>[] items = AliveInternalChildren
|
||||||
.Where(d => d.IsPresent)
|
.Where(d => d.IsPresent)
|
||||||
.OfType<RearrangeableListItem<PlaylistItem>>()
|
.OfType<RearrangeableListItem<PlaylistItem>>()
|
||||||
|
Reference in New Issue
Block a user