1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 15:52:54 +08:00

Fix bad check if content is placeholder

The `lastContent == foundContent` check, last touched in a49a4329, is
terminally broken, as it would always be false. `foundContent` is
mutated when a new card load task is started in `onSearchFinished()`,
which is *before* the aforementioned check.

The code prior to a49a4329 was checking against the two static reused
placeholder drawables which was the correct check to apply, and this
commit reverts to using a variant of that check.
This commit is contained in:
Bartłomiej Dach 2022-01-03 19:33:01 +01:00
parent 97439c3df1
commit ef9f56e585
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -212,7 +212,7 @@ namespace osu.Game.Overlays
// To resolve both of these issues, the bypass is delayed until a point when the content transitions (fade-in and fade-out) overlap and it looks good to do so.
var sequence = lastContent.Delay(25).Schedule(() => lastContent.BypassAutoSizeAxes = Axes.Y);
if (lastContent == foundContent)
if (!isPlaceholderContent(lastContent))
{
sequence.Then().Schedule(() =>
{
@ -232,6 +232,12 @@ namespace osu.Game.Overlays
currentContent.BypassAutoSizeAxes = Axes.None;
}
/// <summary>
/// Whether <paramref name="drawable"/> is a static placeholder reused multiple times by this overlay.
/// </summary>
private bool isPlaceholderContent(Drawable drawable)
=> drawable == notFoundContent || drawable == supporterRequiredContent;
private void onCardSizeChanged()
{
if (foundContent == null || !foundContent.Any())