-
-
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
Add ability to download beatmaps from context menu of beatmap cards #31468
base: master
Are you sure you want to change the base?
Conversation
@@ -24,6 +25,8 @@ public abstract partial class BeatmapCard : OsuClickableContainer, IHasContextMe | |||
|
|||
protected const float WIDTH = 345; | |||
|
|||
public CollapsibleButtonContainer ButtonContainer { get; set; } = null!; |
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.
I really really dislike this. This is how multiplayer ended up in the place it currently is, where random things are exposed for the purpose of inheriting screens setting them that eventually goes completely out of control.
Let's not make the same mistake again.
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.
I agree it's not 100% optimal, but also can't read your mind 😅.
I also tried an Action RequestDownload
kinda flow but it felt way too verbose for what this is. Would that work better?
What's your preference?
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.
@smoogipoo prod on this one, need some direction before attempting something else that doesn't work for you.
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.
Sorry, I thought your reply was in response to the comment below.
Here's two suggestions:
- Make
ContextMenuItems
virtual and duplicate the implementation. - Add abstract
DownloadButton? GetDownloadButton()
and implement in every place.
var menuItems = new List<MenuItem>(); | ||
|
||
if (ButtonContainer.DownloadButton.Enabled.Value) | ||
menuItems.Add(new OsuMenuItem(ContextMenuStrings.DownloadBeatmap, MenuItemType.Highlighted, () => ButtonContainer.DownloadButton.TriggerClick())); |
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.
Never said this question, but what makes menu items highlighted?
Relevant search: https://github.com/search?q=repo%3Appy%2Fosu%20MenuItemType.Highlighted&type=code
I thought the highlighting was to indicate the left-click behavior, but this makes it more inconsistent right now.
The "play" button on beatmap panels in song select was a precedent to these "view" items that I made. Other menus that don't show the left-click menu item highlight something else.
Closes #31151 I guess?
osu.2025-01-10.at.05.52.39.mp4