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

BPM display in mods overlay #19929

Closed
wants to merge 18 commits into from
Closed

Conversation

Feodor0090
Copy link
Contributor

This PR adds BPM display next to difficulty multiplier display into mods overlay. This allows users to see final bpm after applying custom dt/nc/ht without closing the overlay.
изображение

Issues here:

  1. Label should be shorten to just "BPM" or localized. Which is better and in which class should i put field with localisable string?
  2. Now, it will be visible only if ShowTotalMultiplier is true, because i share container with DifficultyMultiplierDisplay. I think that it's ok, because DMD is hidden only in freemods selection where this control is useless anyway.
  3. Currently, opening customization panel shifts the whole overlay up, making this control invisible. Something to fix as a follow-up.
  4. WU/WD/AS are not supported, like in beatmap wedge.

Test scene included.

@bdach
Copy link
Collaborator

bdach commented Aug 23, 2022

Dunno about this from a design standpoint. I was hoping a design for this would arrive from @arflyte but no luck I guess. Also note that in this form, this display is potentially taking space away from a search box that I was going to add.

I'll review code tomorrow.

@peppy
Copy link
Sponsor Member

peppy commented Aug 24, 2022

Mentioned in OP, but this is kinda useless as it stands:

Uploading osu! 2022-08-24 at 05.27.25.mp4…

@arflyte ?

{
// when no map is selected, common length will be zero, producing infinity.
mostCommonBPM = 0d;
this.FadeOut(transition_duration, Easing.OutQuint);
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I disagree with fading out the whole thing in such cases. Show a - instead.

@Feodor0090
Copy link
Contributor Author

this display is potentially taking space away from a search box

Mods names are not so long. I think half of the screen will be enough for it. If we short the labels to just "BPM" and "Score", there will be space to add even more such displays.

Mentioned in OP, but this is kinda useless as it stands

My suggestion here is to move container with this displays to a higher level, forex. in ModSelectOverlay itself. They won't be shifted out of screen while customization panel is open.

Anchor = Anchor.Centre,
Origin = Anchor.Centre
},
new BpmDisplay(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the BPM display is to be steered by ShowTotalMultiplier then that property needs a rename. Maybe something like ShowModEffects or something, with associated proper xmldoc to explain what the "effects" are.

Height = DifficultyMultiplierDisplay.HEIGHT;
AutoSizeAxes = Axes.X;

InternalChild = new InputBlockingContainer
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having mixed feelings about all of this layout setup being essentially copy-pasted from DifficultyMultiplierDisplay. Is this really necessary?

Comment on lines 162 to 166
double rate = 1;
foreach (var mod in mods.Value.OfType<IApplicableToRate>())
rate = mod.ApplyToRate(0, rate);

double mostCommonBPM = Math.Round(Math.Round(60000 / beatmap.GetMostCommonBeatLength()) * rate);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly mixed feelings about all this being copy-pasted from BeatmapInfoWedge. I initially thought this was a misguided buggy implementation due to the double rounding, until I blamed back the BeatmapInfoWedge copy and found #18345.


double mostCommonBPM = Math.Round(Math.Round(60000 / beatmap.GetMostCommonBeatLength()) * rate);

if (double.IsNormal(mostCommonBPM))
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this IsNormal check, even? Is this supposed to catch NaNs? When can this even occur? A comment below is saying something about "no map selected" - maybe the way there is to, you know, not divide by 0 in the first place?

settingChangeTracker = new ModSettingChangeTracker(m.NewValue);
settingChangeTracker.SettingChanged += _ => refresh();
}, true);
working.ValueChanged += _ => refresh();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick, but why is one of these using BindValueChanged(...) and one is doing ValueChanged += ...?

@peppy
Copy link
Sponsor Member

peppy commented Aug 29, 2022

Is this intended to be dependent on #19991 now?

@Feodor0090
Copy link
Contributor Author

After same experiments, IMO the best way is just to duplicate effect displays to ModSettingsArea. I also added a simple animation to create feeling that it's the same panel, just moved off-screen.

2022-08-29.21-49-40.mp4

Will this be accepted?

Is this intended to be dependent on #19991

Yes.

@bdach
Copy link
Collaborator

bdach commented Aug 29, 2022

Will this be accepted?

I'm not a fan of duplicating the displays, personally, from a functional standpoint. The visual look also leaves much to be desired for me (the alignment of the items seems really weird for me).

For reference, some of the newer figma designs just get rid of the customisation panel at the bottom in favour of a dropdown, which would potentially solve this. That said we direly need input from @arflyte here whether that is something that's final or just a proposal (third time the charm, maybe?)

@arflyte
Copy link

arflyte commented Aug 30, 2022

I think the current problem with the design is that it's not suitable to display many types of info as it would clutter up everything (it's just bad to have a lot of boxes)

So probably, as a long-term solution, I have to design a better information container that can house multiple info, which could also be future-proof.

@peppy
Copy link
Sponsor Member

peppy commented Sep 8, 2022

@Feodor0090 I think it's fine to duplicate the display as you proposed. Please apply this change and we'll take it from ther.

@Feodor0090

This comment was marked as resolved.

@peppy peppy marked this pull request as draft June 16, 2023 06:09
@Joehuu
Copy link
Member

Joehuu commented Sep 6, 2023

Superseded by #24705.

@Joehuu Joehuu closed this Sep 6, 2023
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.

None yet

5 participants