mirror of https://github.com/ppy/osu
Unload daily challenge background less aggressively
This commit is contained in:
parent
6c37560842
commit
f85a1339d9
|
@ -27,8 +27,17 @@ public IBeatmapSetOnlineInfo OnlineInfo
|
|||
set => base.Masking = value;
|
||||
}
|
||||
|
||||
public UpdateableOnlineBeatmapSetCover(BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover)
|
||||
protected override double LoadDelay { get; }
|
||||
|
||||
private readonly double timeBeforeUnload;
|
||||
|
||||
protected override double TransformDuration => 400;
|
||||
|
||||
public UpdateableOnlineBeatmapSetCover(BeatmapSetCoverType coverType = BeatmapSetCoverType.Cover, double timeBeforeLoad = 500, double timeBeforeUnload = 1000)
|
||||
{
|
||||
LoadDelay = timeBeforeLoad;
|
||||
this.timeBeforeUnload = timeBeforeUnload;
|
||||
|
||||
this.coverType = coverType;
|
||||
|
||||
InternalChild = new Box
|
||||
|
@ -38,12 +47,8 @@ public UpdateableOnlineBeatmapSetCover(BeatmapSetCoverType coverType = BeatmapSe
|
|||
};
|
||||
}
|
||||
|
||||
protected override double LoadDelay => 500;
|
||||
|
||||
protected override double TransformDuration => 400;
|
||||
|
||||
protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Func<Drawable> createContentFunc, double timeBeforeLoad)
|
||||
=> new DelayedLoadUnloadWrapper(createContentFunc, timeBeforeLoad)
|
||||
=> new DelayedLoadUnloadWrapper(createContentFunc, timeBeforeLoad, timeBeforeUnload)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
|
|
@ -67,7 +67,7 @@ public DailyChallengeButton(string sampleName, Color4 colour, Action<MainMenuBut
|
|||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
cover = new UpdateableOnlineBeatmapSetCover
|
||||
cover = new UpdateableOnlineBeatmapSetCover(timeBeforeLoad: 0, timeBeforeUnload: 600_000)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Anchor = Anchor.Centre,
|
||||
|
|
Loading…
Reference in New Issue