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:
parent
d326f23576
commit
05b1002e9d
@ -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();
|
||||||
|
|
||||||
|
@ -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, () =>
|
||||||
|
Loading…
Reference in New Issue
Block a user