1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 13:02:54 +08:00

Improve code quality

This commit is contained in:
Dean Herbert 2017-11-29 20:07:00 +09:00
parent d4c1359a49
commit 2b7bf285e4

View File

@ -320,26 +320,25 @@ namespace osu.Game.Screens.Select
return; return;
} }
this.FadeIn(transition_duration);
setTextAsync(value); setTextAsync(value);
} }
} }
private void setTextAsync(string text) private void setTextAsync(string text)
{ {
var newTextFlow = new TextFlowContainer LoadComponentAsync(new TextFlowContainer(s => s.TextSize = 14)
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Colour = textFlow.Colour, Colour = textFlow.Colour,
}; Text = text
}, loaded =>
newTextFlow.AddText(text, s => s.TextSize = 14);
LoadComponentAsync(newTextFlow, d =>
{ {
textContainer.Remove(textFlow); textFlow?.Expire();
textContainer.Add(textFlow = d); textContainer.Add(textFlow = loaded);
// fade in if we haven't yet.
this.FadeIn(transition_duration);
}); });
} }