mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +08:00
Reverse in-match playlist
This commit is contained in:
parent
eb983ed548
commit
8e014ca17a
@ -19,10 +19,12 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
private readonly bool allowEdit;
|
private readonly bool allowEdit;
|
||||||
private readonly bool allowSelection;
|
private readonly bool allowSelection;
|
||||||
|
|
||||||
public DrawableRoomPlaylist(bool allowEdit, bool allowSelection)
|
public DrawableRoomPlaylist(bool allowEdit, bool allowSelection, bool reverse = false)
|
||||||
{
|
{
|
||||||
this.allowEdit = allowEdit;
|
this.allowEdit = allowEdit;
|
||||||
this.allowSelection = allowSelection;
|
this.allowSelection = allowSelection;
|
||||||
|
|
||||||
|
((ReversibleFillFlowContainer)ListContainer).Reverse = reverse;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -47,10 +49,8 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
d.ScrollbarVisible = false;
|
d.ScrollbarVisible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
protected override FillFlowContainer<RearrangeableListItem<PlaylistItem>> CreateListFillFlowContainer() => new FillFlowContainer<RearrangeableListItem<PlaylistItem>>
|
protected override FillFlowContainer<RearrangeableListItem<PlaylistItem>> CreateListFillFlowContainer() => new ReversibleFillFlowContainer
|
||||||
{
|
{
|
||||||
LayoutDuration = 200,
|
|
||||||
LayoutEasing = Easing.OutQuint,
|
|
||||||
Spacing = new Vector2(0, 2)
|
Spacing = new Vector2(0, 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -72,5 +72,22 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
Items.Remove(item);
|
Items.Remove(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ReversibleFillFlowContainer : FillFlowContainer<RearrangeableListItem<PlaylistItem>>
|
||||||
|
{
|
||||||
|
private bool reverse;
|
||||||
|
|
||||||
|
public bool Reverse
|
||||||
|
{
|
||||||
|
get => reverse;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
reverse = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<Drawable> FlowingChildren => Reverse ? base.FlowingChildren.OrderBy(d => -GetLayoutPosition(d)) : base.FlowingChildren;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
null,
|
null,
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
playlist = new DrawableRoomPlaylist(false, false)
|
playlist = new DrawableRoomPlaylist(false, false, true)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user