Context menu for duplicating multi rooms

This commit is contained in:
voidedWarranties
2020-08-09 16:16:01 -07:00
parent d8ffc00f75
commit 3a97ee4712
5 changed files with 67 additions and 28 deletions

View File

@ -16,6 +16,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings;
using osu.Game.Online.Multiplayer;
using osuTK;
using osu.Game.Graphics.Cursor;
namespace osu.Game.Screens.Multi.Lounge.Components
{
@ -37,17 +38,24 @@ namespace osu.Game.Screens.Multi.Lounge.Components
[Resolved]
private IRoomManager roomManager { get; set; }
public Action<Room> DuplicateRoom;
public RoomsContainer()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
InternalChild = roomFlow = new FillFlowContainer<DrawableRoom>
InternalChild = new OsuContextMenuContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(2),
Child = roomFlow = new FillFlowContainer<DrawableRoom>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(2),
}
};
}
@ -88,6 +96,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
{
roomFlow.Add(new DrawableRoom(room)
{
DuplicateRoom = DuplicateRoom,
Action = () =>
{
if (room == selectedRoom.Value)