mirror of
https://github.com/ppy/osu.git
synced 2025-02-06 07:53:22 +08:00
Switch DelayedLoadUnloadWrappers to DelayedLoadWrappers
Due to pooling usage, there is no time we need to unload. Switching to DelayedLoadWrapper cleans up the code and reduces overhead substantially.
This commit is contained in:
parent
a1801f8ae4
commit
2346644c04
@ -69,29 +69,25 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
if (Item == null)
|
if (Item == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
DelayedLoadWrapper background;
|
||||||
|
DelayedLoadWrapper mainFlow;
|
||||||
|
|
||||||
Header.Children = new Drawable[]
|
Header.Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new DelayedLoadUnloadWrapper(() =>
|
background = new DelayedLoadWrapper(new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()))
|
||||||
{
|
|
||||||
var background = new SetPanelBackground(manager.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault()))
|
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
}, 300),
|
||||||
|
mainFlow = new DelayedLoadWrapper(new SetPanelContent((CarouselBeatmapSet)Item), 100),
|
||||||
};
|
};
|
||||||
|
|
||||||
background.OnLoadComplete += d => d.FadeInFromZero(1000, Easing.OutQuint);
|
background.DelayedLoadComplete += fadeContentIn;
|
||||||
|
mainFlow.DelayedLoadComplete += fadeContentIn;
|
||||||
|
}
|
||||||
|
|
||||||
return background;
|
private void fadeContentIn(Drawable d)
|
||||||
}, 300, 5000),
|
|
||||||
new DelayedLoadUnloadWrapper(() =>
|
|
||||||
{
|
{
|
||||||
// main content split into own class to reduce allocation before load operation triggers.
|
d.FadeInFromZero(1000, Easing.OutQuint);
|
||||||
var mainFlow = new SetPanelContent((CarouselBeatmapSet)Item);
|
|
||||||
|
|
||||||
mainFlow.OnLoadComplete += d => d.FadeInFromZero(1000, Easing.OutQuint);
|
|
||||||
|
|
||||||
return mainFlow;
|
|
||||||
}, 100, 5000)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Deselected()
|
protected override void Deselected()
|
||||||
|
Loading…
Reference in New Issue
Block a user