1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 14:25:10 +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,23 +349,17 @@ namespace osu.Game.Screens.OnlinePlay.Lounge.Components
if (Room.RoomID.HasValue)
{
items.AddRange([
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));
})
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)))
]);
}
return items.ToArray();
string formatRoomUrl(long id) => $@"{api.WebsiteRootUrl}/multiplayer/rooms/{id}";
}
}
private string formatRoomUrl(long id) => $@"{api.WebsiteRootUrl}/multiplayer/rooms/{id}";
protected virtual UpdateableBeatmapBackgroundSprite CreateBackground() => new UpdateableBeatmapBackgroundSprite();
protected virtual IEnumerable<Drawable> CreateBottomDetails()

View File

@ -159,16 +159,13 @@ namespace osu.Game.Screens.OnlinePlay.Lounge
{
get
{
var items = new List<MenuItem>
{
new OsuMenuItem("Create copy", MenuItemType.Standard, () =>
{
lounge?.OpenCopy(Room);
})
};
var items = new List<MenuItem>();
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)
{
items.Add(new OsuMenuItem("Close playlist", MenuItemType.Destructive, () =>