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

Fix advanced stats in beatmap info overlay showing "key count" on non-mania beatmaps #27380

Merged
merged 3 commits into from Feb 28, 2024

Conversation

frenzibyte
Copy link
Member

The component itself was assuming too much. The decision of whether to show the "key count" label should be completely up to each usage instead.

@frenzibyte frenzibyte changed the title Fix advanced stats display Fix advanced stats in beatmap info overlay showing "key count" on non-mania beatmaps Feb 25, 2024
@peppy peppy self-requested a review February 26, 2024 05:56
{
Ratings.Ratings = BeatmapSet?.Ratings;
ratingBox.Alpha = BeatmapSet?.Status > 0 ? 1 : 0;
advanced.Ruleset.Value = rulesets.GetRuleset(beatmapInfo?.Ruleset.OnlineID ?? 0);
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 dunno. I would have just changed AdvancedStats to have a ctor flag of something like "showConvertedRulesetInfo" rather than changing this whole flow.

The new flow reads very shoddy and is confusing. Like when do you hook up ruleset to beamap and when do you use game? It's not explained anywhere and bound to get used wrong in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't agree with that. I think boolean flags are shoddy and should only be used as a last resort. This seems better because it makes this a more "pure" component in that it has explicit inputs that it's reading rather some implicit resolution process as previously.

On a quick skim the only thing that makes me wince in this diff is the SongSelect change and it looks like that one is caused by the typical song select debounce hell.

Copy link
Sponsor Member

@peppy peppy Feb 26, 2024

Choose a reason for hiding this comment

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

To confirm you're understand this: Ruleset not being set (and thus null) in the online beatmap set overlay is the fix here.

Zero xmldoc explaining this, just a wild ruleset bindable? I don't know.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Uhhhh... I guess I missed that part. null fixing it is dodgy indeed.

Should be explicitly set in all instances.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

If it's explicitly set on the beatmap overlay to anything that isn't null, it will regress the fix. I'm open to a better structure or xmldoc trying to explain this, but this is why I proposed the ctor argument instead (it's explicit and it gives us a place to document the modes of operation). 🤷

Copy link
Sponsor Member

@peppy peppy Feb 26, 2024

Choose a reason for hiding this comment

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

My API proposal is for AdvancedStats which is used at song select, and bound to song select's local ruleset.

Maybe if we can't easily agree on this the class should just be copypasted into two versions. Because I guarantee the next issue is going to be that it's reading from global mods and displaying "unexpected" on the overlay.

Copy link
Collaborator

@bdach bdach Feb 26, 2024

Choose a reason for hiding this comment

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

I'm not sure why this conversation is going in the places it's going so I might just recuse myself from it.

the next issue is going to be that it's reading from global mods and displaying "unexpected" on the overlay

I never wanted that. It should not be reading from global mods. It should be given the correct ruleset to show explicitly in every usage. No inferences.

Hell give it a ruleset bindable instead but one that is explicltly hooked to by every usage. Song select can bind it to the game-global bindable and beatmap info overlay can do its local one.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

There's more issues with AdvancedStats ruleset – it doesn't have knowledge of whether a conversion can happen, so right now it will prefer the bound ruleset even if the conversion is impossible (ie. mania beatmap and osu! ruleset being set). Not sure if this is okay or not. Should it be up to the point of construction to get this right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

My vision for it was for it to be a dumb component that displays what it's told to. At the point it's told to display an impossible conversion something has gone deeply wrong somewhere higher above I'd say.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Fair enough.

@peppy
Copy link
Sponsor Member

peppy commented Feb 26, 2024

I've added xmldoc to the bindable, I guess it's fine.

@peppy peppy requested a review from bdach February 26, 2024 10:41
@bdach bdach merged commit a5948d3 into ppy:master Feb 28, 2024
15 of 17 checks passed
@frenzibyte frenzibyte deleted the fix-advanced-stats-display branch February 28, 2024 20:27
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.

Catch & taiko beatmaps have key count displayed in beatmap listing
3 participants