osu-framework icon indicating copy to clipboard operation
osu-framework copied to clipboard

Add display range to SliderBar

Open EYHN opened this issue 4 months ago • 5 comments

This PR adds MinDisplayRange and MaxDisplayRange properties to SliderBar, allowing the display range to be adjusted instead of being fixed to BindableNumber.MinValue and BindableNumber.MaxValue.

Context: https://github.com/ppy/osu/pull/34362#issuecomment-3131504660 I spent some time considering variable naming and changed some original variable names, which may require discussion.

This change will not break the original behavior of SliderBar, and osu should be able to upgrade safely.

https://github.com/user-attachments/assets/5ec0bc48-5a53-4d61-a1d1-621b24f0c3c5

After this PR is merged, it will be possible to adjust the LowerBound and UpperBound ranges independently in osu ShearedSliderBar

https://github.com/user-attachments/assets/28d397d4-edf8-4ea6-a170-97314611ddc6

EYHN avatar Jul 30 '25 05:07 EYHN

This looks like it will work well for the scenario in question.

I'd want a second @ppy/team-client review as this is a framework change altering a central component.

peppy avatar Jul 30 '25 09:07 peppy

How on earth is this the resolution to whatever the game-side problem is? This "feature" is so broken.

Using the test added in this PR as-is, why can I go below zero if the MinDisplayRange is set to zero?

https://github.com/user-attachments/assets/9e1c16e4-6a7f-4dca-8632-f9c4183044e8

Why can I specify MaxDisplayRange < MinDisplayRange and have the slider bar work right-to-left?

https://github.com/user-attachments/assets/d97d1114-038d-4aa0-aa40-6393ad0189bc

Why does this allow specifying a wider range of movement than the underlying bindable therefore allowing half the slide range to be dead?

https://github.com/user-attachments/assets/9555432b-f91e-4f65-91f4-ec3f1366c728

I haven't examined the reason why this is apparently needed in closer detail but really?

bdach avatar Jul 30 '25 10:07 bdach

Oh and I apparently can just bypass the "display range" entirely by dragging past the bounds of the slider (set to [0,5] on this video):

https://github.com/user-attachments/assets/0fdba2fc-d28f-4ade-aaaf-d7a2c9dd8831

bdach avatar Jul 30 '25 10:07 bdach

@EYHN Based on the above, and the general feeling that we don't want to over-complicate the SliderBar class, we should try and figure a local workaround for this osu! side rather than making framework changes.

peppy avatar Jul 30 '25 10:07 peppy

Okay, thanks for your time reviewing this. I will consider how to workaround it.

EYHN avatar Jul 30 '25 10:07 EYHN