Merge pull request #24346 from cdwcgt/tournament-no-unload-cover

Use `DelayedLoadWrapper` in `TournamentBeatmapPanel` to avoid beatmap cover unload in map pool
This commit is contained in:
Dean Herbert 2023-07-25 16:27:52 +09:00 committed by GitHub
commit 04c1333b59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -56,7 +56,7 @@ private void load(LadderInfo ladder)
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
new UpdateableOnlineBeatmapSetCover
new NoUnloadBeatmapSetCover
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.5f),
@ -180,5 +180,15 @@ private void updateState()
Alpha = 1;
}
}
private partial class NoUnloadBeatmapSetCover : UpdateableOnlineBeatmapSetCover
{
// As covers are displayed on stream, we want them to load as soon as possible.
protected override double LoadDelay => 0;
// Use DelayedLoadWrapper to avoid content unloading when switching away to another screen.
protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Func<Drawable> createContentFunc, double timeBeforeLoad)
=> new DelayedLoadWrapper(createContentFunc, timeBeforeLoad);
}
}
}