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 ina49a4329
, 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 toa49a4329
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:
parent
97439c3df1
commit
ef9f56e585
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user