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:
commit
04c1333b59
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user