1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 10:12:53 +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;
}
this.FadeIn(transition_duration);
setTextAsync(value);
}
}
private void setTextAsync(string text)
{
var newTextFlow = new TextFlowContainer
LoadComponentAsync(new TextFlowContainer(s => s.TextSize = 14)
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Colour = textFlow.Colour,
};
newTextFlow.AddText(text, s => s.TextSize = 14);
LoadComponentAsync(newTextFlow, d =>
Text = text
}, loaded =>
{
textContainer.Remove(textFlow);
textContainer.Add(textFlow = d);
textFlow?.Expire();
textContainer.Add(textFlow = loaded);
// fade in if we haven't yet.
this.FadeIn(transition_duration);
});
}