Fixes issue described in the following comment:
https://github.com/ppy/osu/pull/25759#issuecomment-1855954637
That is just not how the tooltip system is supposed to be used.
To name the individual sins:
- Caching and returning a tooltip instance like the classes that used
tooltips is incorrect. The lifetime of tooltip instances is managed by
the tooltip container. `GetCustomTooltip()` is called by it
exclusively. It should return a fresh instance every time.
- Not putting actual data in `IHasCustomTooltip.TooltipContent` is
wrong.
- Having `Tooltip.SetContent()` be a no-op is *grossly and flagrantly*
wrong.
I'm not even sure which particular combination of the above
transgressions caused the issue as it presented itself, but at this time
I frankly do not care.
The recent changes related to adding support for working beatmap load
cancellation exposed a flaw in the beatmap difficulty cache. With the
way the difficulty computation logic was written, any error in the
calculation process (including beatmap load timeout, or cancellation)
would result in a 0.00 star rating being permanently cached in memory
for the given beatmap.
To resolve, change the difficulty cache's return type to nullable.
In failure scenarios, `null` is returned, rather than
`default(StarDifficulty)` as done previously.
`AdvancedStats` was locally assuming that the only changes in mods that
are relevant to it are if the mods are `IApplicableToDifficulty`. This
is not true, as other mods (such as `IApplicableToRate` mods, or more
recently, Flashlight) can also affect star difficulty, which is shown on
one of the bars in `AdvancedStats`.
Due to the use of bindable flow provided by `BeatmapDifficultyCache` in
this usage, the display would briefly flash to zero while difficulty
calculation was still running (as there is no way for a consumer of the
provided bindable to know whether the returned 0 is an actual 0 SR or a
"pending" calculation).
While I hope to fix this by making the bindable flow return nullable
values, I think this particular use case works better with non-bindable
flow so have switched across to that.