-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow copying beatmap link in song select carousel context menu #29537
Allow copying beatmap link in song select carousel context menu #29537
Conversation
Just to list some other methods of doing the same thing in-game:
Note that the above only works while logged in, so that's probably another argument. |
Updated the description for better clarity |
Normally I'd reject this based on the premise that you can already do this in other ways as @Joehuu said, but the number of reactions on the OP is giving me a little pause. I'm not sure whether people didn't know you could do this already (albeit, admittedly, in a more roundabout manner), or just don't think that flow is good enough. |
I think this is handy to have here. Other methods are hidden or require more steps. |
That said, this PR is basically a "needs full rewrite". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably fine. Batch localisation should probably happen for context menus at some point.
@@ -288,6 +296,9 @@ public MenuItem[] ContextMenuItems | |||
|
|||
items.Add(new OsuMenuItem("Collections") { Items = collectionItems }); | |||
|
|||
if (beatmapInfo.GetOnlineURL(api) is string url) | |||
items.Add(new OsuMenuItem("Copy link", MenuItemType.Standard, () => clipboard.SetText(url))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't have the OSD feedback like in ExternalLinkButton
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask about what the OSD stands for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can google for an explanation. But please leave this alone, I'll fix it to keep things moving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OnScreenDisplay
, but I dunno if it's better to copy the logic from ExternalLinkButton
two more times, or add another method to OsuGame
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latter is more valid. I believe we will be using this in many more places going forward.
@@ -288,6 +295,9 @@ public MenuItem[] ContextMenuItems | |||
|
|||
items.Add(new OsuMenuItem("Collections") { Items = collectionItems }); | |||
|
|||
if (beatmapInfo.GetOnlineURL(api) is string url) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No ruleset spec here? There is one on the beatmap set panels. And it does matter for stuff like converts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah right, this was on my todo and I forgot to act on it.
Why
This could be very useful when playing on mobile, which player won't need to open their browser to just get the link. At the other side, desktop players can reduce the step of getting URLs, they don't need to jump to the browser and copy the link, instead just do it inside the game
Though the /np command can send the current beatmap to the chat, it doesn't make a use on if we want to share through the other app, like if we want to send it to discord.
Implementation
Add
Copy link
item into bothDrawableCarouselBeatmapSet
andDrawableCarouselBeatmap
While
DrawableCarouselBeatmapSet
Copy URL as$@"{api.WebsiteRootUrl}/beatmapsets/{beatmapSet.OnlineID}#{ruleset.ShortName}"
andDrawableCarouselBeatmap
copy as$@"{api.WebsiteRootUrl}/beatmapsets/{beatmapSet.OnlineID}#{ruleset.ShortName}/{beatmapInfo.OnlineID}"