mirror of
https://github.com/osukey/osukey.git
synced 2025-05-24 15:07:20 +09:00
Merge branch 'master' into changelog-overlay
This commit is contained in:
commit
cc256614b9
@ -32,6 +32,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
protected virtual double UnloadDelay => 10000;
|
protected virtual double UnloadDelay => 10000;
|
||||||
|
|
||||||
private BeatmapInfo lastModel;
|
private BeatmapInfo lastModel;
|
||||||
|
private bool firstLoad = true;
|
||||||
|
|
||||||
protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Drawable content, double timeBeforeLoad)
|
protected override DelayedLoadWrapper CreateDelayedLoadWrapper(Drawable content, double timeBeforeLoad)
|
||||||
{
|
{
|
||||||
@ -39,11 +40,12 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
{
|
{
|
||||||
// If DelayedLoadUnloadWrapper is attempting to RELOAD the same content (Beatmap), that means that it was
|
// If DelayedLoadUnloadWrapper is attempting to RELOAD the same content (Beatmap), that means that it was
|
||||||
// previously UNLOADED and thus its children have been disposed of, so we need to recreate them here.
|
// previously UNLOADED and thus its children have been disposed of, so we need to recreate them here.
|
||||||
if (lastModel == Beatmap.Value)
|
if (!firstLoad && lastModel == Beatmap.Value)
|
||||||
return CreateDrawable(Beatmap.Value);
|
return CreateDrawable(Beatmap.Value);
|
||||||
|
|
||||||
// If the model has changed since the previous unload (or if there was no load), then we can safely use the given content
|
// If the model has changed since the previous unload (or if there was no load), then we can safely use the given content
|
||||||
lastModel = Beatmap.Value;
|
lastModel = Beatmap.Value;
|
||||||
|
firstLoad = false;
|
||||||
return content;
|
return content;
|
||||||
}, timeBeforeLoad, UnloadDelay);
|
}, timeBeforeLoad, UnloadDelay);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user