1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

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

View File

@ -56,7 +56,7 @@ namespace osu.Game.Tournament.Components
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
new UpdateableOnlineBeatmapSetCover
new NoUnloadBeatmapSetCover
{
RelativeSizeAxes = Axes.Both,
Colour = OsuColour.Gray(0.5f),
@ -180,5 +180,15 @@ namespace osu.Game.Tournament.Components
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);
}
}
}