1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Fade only textContainer instead of entire MetadataSection

This commit is contained in:
HoLLy 2018-10-26 13:35:51 +02:00
parent 88aca46500
commit cf3b4447eb

View File

@ -307,10 +307,10 @@ namespace osu.Game.Screens.Select
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Alpha = 0;
InternalChild = textContainer = new FillFlowContainer
{
Alpha = 0,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Spacing = new Vector2(spacing / 2),
@ -337,17 +337,14 @@ namespace osu.Game.Screens.Select
{
if (string.IsNullOrEmpty(value))
{
this.FadeOut(transition_duration);
textContainer.FadeOut(transition_duration);
return;
}
this.FadeIn(transition_duration);
setTextAsync(value);
}
}
public override bool IsPresent => base.IsPresent || textFlow == null; // Visibility is updated in the LoadComponentAsync callback
private void setTextAsync(string text)
{
LoadComponentAsync(new OsuTextFlowContainer(s => s.TextSize = 14)
@ -362,7 +359,7 @@ namespace osu.Game.Screens.Select
textContainer.Add(textFlow = loaded);
// fade in if we haven't yet.
this.FadeIn(transition_duration);
textContainer.FadeIn(transition_duration);
});
}
}