Skip to content
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

Some Buttons have small edge regions where they animate, but don't work #28232

Open
jhey29 opened this issue May 19, 2024 · 4 comments
Open

Some Buttons have small edge regions where they animate, but don't work #28232

jhey29 opened this issue May 19, 2024 · 4 comments

Comments

@jhey29
Copy link

jhey29 commented May 19, 2024

Type

Cosmetic

Bug description

When I use the Mod Menu and the editor, I move my cursor towards a button I want to click until that button does its hover animation, then click. I expect the button to then work.
If the button is the Test Button in the Editor, or the Back, Mod Customization, Deselect All (probably), or + (add Personal Preset) Button in the Mod Menu, it has a small region to the right and to the bottom of it where it animates if my cursor is there, but clicking doesn't do anything except play the click animation. This is annoying for the Test Button because that region coincides with the bottom edge of the screen, which it is very easy to put your cursor at. As a bonus, at least the Mod Menu Back Button also has a region on it's top and left where hovering and clicking plays no animations, but closes the menu anyways.
Possibly unrelated details are that I'm on Ubuntu and using the "High Precision Mouse" feature and a laptop touchpad to move my cursor (this might make the problem slightly more noticeable because clicking by tapping does not make the cursor move at all). There are other buttons without this problem though.
This problem has been there for a little while, so it's nothing new, which makes sense considering that these buttons are older than my 3-month osu! career.

Screenshots or videos

osu_2024-05-19_15-02-27
osu_2024-05-19_15-04-35
osu_2024-05-19_15-05-23
osu_2024-05-19_15-08-10

Version

2024.519.1

Logs

compressed-logs.zip

@bdach
Copy link
Collaborator

bdach commented May 20, 2024

Pretty sure this is caused by the scale change on mouse down:

protected override bool OnMouseDown(MouseDownEvent e)
{
Content.ScaleTo(0.9f, 2000, Easing.OutQuint);
return base.OnMouseDown(e);
}

Due to the trainwreck that is OsuClickableContainer:

public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
// base call is checked for cases when `OsuClickableContainer` has masking applied to it directly (ie. externally in object initialisation).
base.ReceivePositionalInputAt(screenSpacePos)
// Implementations often apply masking / edge rounding at a content level, so it's imperative to check that as well.
&& Content.ReceivePositionalInputAt(screenSpacePos);

this means that after the initial mouse down the button shrinks such that the mouse position is now outside content, and as such the button no longer receives positional input, and thus never gets a click triggered for it.

The solution here is probably to nuke OsuClickableContainer. I'm not sure what real gains it provides at this point. It can be reimplemented in around 10 lines of code.

@jhey29
Copy link
Author

jhey29 commented May 20, 2024

you might have noticed that the top/left region I identified is actually just intended behaviour in the Mod Menu: there are a bunch of places like e.g. the entire footer, where clicking closes the mod menu

@jhey29 jhey29 closed this as completed May 20, 2024
@jhey29 jhey29 reopened this May 20, 2024
@jhey29 jhey29 changed the title Some Buttons have small edge regions where they animate, but don't work, and vice-versa Some Buttons have small edge regions where they animate, but don't work May 20, 2024
@bdach
Copy link
Collaborator

bdach commented May 20, 2024

you might have noticed that the top/left region I identified is actually just intended behaviour in the Mod Menu: there are a bunch of places like e.g. the entire footer, where clicking closes the mod menu

Yeah clicking "the background" is supposed to exit out of the screen. The footer itself isn't supposed to do this but the gap between it and the columns is.

@jhey29
Copy link
Author

jhey29 commented May 20, 2024

yeah, correct. the actual issue with the scaling and the edges also happens for the beat snap divisor switching and play buttons in the editor-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants