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

Keep mod customisation panel open when dragging outside #29541

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

frenzibyte
Copy link
Member

Really wish hover is not being eaten from the FocusGrabbingContainer so we don't have to do ReceivePositionalInputAt but I don't think it's worth checking on that.

{
ExpandedState.Value = ModCustomisationPanelState.Collapsed;
if (!ReceivePositionalInputAt(inputManager!.CurrentState.Mouse.Position) && inputManager.DraggedDrawable == null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bit baffled by this NRT usage, why declare inputManager as InputManager? if you're just going to silence null inspections at point of usage here? Just make the field non-nullable from the start?

Also is there any point to splitting this into two nested ifs rather than adding a third condition?

Copy link
Member Author

@frenzibyte frenzibyte Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I can silence it elsewhere.

Two ifs read better to me, not a big fan of very long conditionals. Probably just me.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silence at point of assignment IMO.

@peppy peppy self-requested a review August 22, 2024 06:21
@peppy peppy merged commit 7e483bb into ppy:master Aug 22, 2024
9 of 12 checks passed
@peppy peppy self-requested a review August 22, 2024 06:28
@frenzibyte frenzibyte deleted the fix-mod-customisation-dragging-outside branch August 22, 2024 07:03
@Cai1Hsu
Copy link
Contributor

Cai1Hsu commented Aug 23, 2024

I don't know if I should report it, but there is a super edge case where the panel doesn't collapse if you are dragging a slider that is NOT in the customisation panel.

This could be reproduced by the following steps:

  1. Select mods to enable customsation.
  2. dragging a slider in the setting overlay
  3. Press ESC to close the setting overlay(hold the mouse button to keep dragging)
  4. hover the header and left
  5. the panel doesn't collapse until you release the mouse button
2024-08-23.17-55-44-encoded.mp4

@peppy
Copy link
Member

peppy commented Aug 23, 2024

Don't think it matters.

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

Successfully merging this pull request may close these issues.

In mods customization, moving out of the customization area while still holding a slider hides it
4 participants