1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-07 23:32:56 +08:00

Adjust layout and code quality slightly

This commit is contained in:
Dean Herbert 2025-01-24 15:57:13 +09:00
parent d326f23576
commit 05b1002e9d
No known key found for this signature in database
2 changed files with 8 additions and 17 deletions

View File

@ -349,22 +349,16 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
if (Room.RoomID.HasValue) if (Room.RoomID.HasValue)
{ {
items.AddRange([ items.AddRange([
new OsuMenuItem("View in browser", MenuItemType.Standard, () => new OsuMenuItem("View in browser", MenuItemType.Standard, () => game?.OpenUrlExternally(formatRoomUrl(Room.RoomID.Value))),
{ new OsuMenuItem("Copy link", MenuItemType.Standard, () => game?.CopyUrlToClipboard(formatRoomUrl(Room.RoomID.Value)))
game?.OpenUrlExternally(formatRoomUrl(Room.RoomID.Value));
}),
new OsuMenuItem("Copy link", MenuItemType.Standard, () =>
{
game?.CopyUrlToClipboard(formatRoomUrl(Room.RoomID.Value));
})
]); ]);
} }
return items.ToArray(); return items.ToArray();
}
}
private string formatRoomUrl(long id) => $@"{api.WebsiteRootUrl}/multiplayer/rooms/{id}"; string formatRoomUrl(long id) => $@"{api.WebsiteRootUrl}/multiplayer/rooms/{id}";
}
}
protected virtual UpdateableBeatmapBackgroundSprite CreateBackground() => new UpdateableBeatmapBackgroundSprite(); protected virtual UpdateableBeatmapBackgroundSprite CreateBackground() => new UpdateableBeatmapBackgroundSprite();

View File

@ -159,16 +159,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
{ {
get get
{ {
var items = new List<MenuItem> var items = new List<MenuItem>();
{
new OsuMenuItem("Create copy", MenuItemType.Standard, () =>
{
lounge?.OpenCopy(Room);
})
};
items.AddRange(base.ContextMenuItems); items.AddRange(base.ContextMenuItems);
items.Add(new OsuMenuItemSpacer());
items.Add(new OsuMenuItem("Create copy", MenuItemType.Standard, () => lounge?.OpenCopy(Room)));
if (Room.Type == MatchType.Playlists && Room.Host?.Id == api.LocalUser.Value.Id && Room.StartDate?.AddMinutes(5) >= DateTimeOffset.Now && !Room.HasEnded) if (Room.Type == MatchType.Playlists && Room.Host?.Id == api.LocalUser.Value.Id && Room.StartDate?.AddMinutes(5) >= DateTimeOffset.Now && !Room.HasEnded)
{ {
items.Add(new OsuMenuItem("Close playlist", MenuItemType.Destructive, () => items.Add(new OsuMenuItem("Close playlist", MenuItemType.Destructive, () =>