mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 16:22:54 +08:00
Improve code quality
This commit is contained in:
parent
d4c1359a49
commit
2b7bf285e4
@ -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);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user