mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 09:42:55 +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,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
},
|
},
|
||||||
new UpdateableOnlineBeatmapSetCover
|
new NoUnloadBeatmapSetCover
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = OsuColour.Gray(0.5f),
|
Colour = OsuColour.Gray(0.5f),
|
||||||
@ -180,5 +180,15 @@ namespace osu.Game.Tournament.Components
|
|||||||
Alpha = 1;
|
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