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

Merge branch 'master' into random-song-fix

This commit is contained in:
Dean Herbert 2017-11-29 20:32:10 +09:00 committed by GitHub
commit 28d925dc1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,6 +261,7 @@ namespace osu.Game.Screens.Select
description.Text = null; description.Text = null;
source.Text = null; source.Text = null;
tags.Text = null; tags.Text = null;
advanced.Beatmap = new BeatmapInfo advanced.Beatmap = new BeatmapInfo
{ {
StarDifficulty = 0, StarDifficulty = 0,
@ -306,36 +307,16 @@ namespace osu.Game.Screens.Select
private class MetadataSection : Container private class MetadataSection : Container
{ {
private readonly TextFlowContainer textFlow; private readonly FillFlowContainer textContainer;
private TextFlowContainer textFlow;
public string Text
{
set
{
if (string.IsNullOrEmpty(value))
{
this.FadeOut(transition_duration);
return;
}
this.FadeIn(transition_duration);
textFlow.Clear();
textFlow.AddText(value, s => s.TextSize = 14);
}
}
public Color4 TextColour
{
get { return textFlow.Colour; }
set { textFlow.Colour = value; }
}
public MetadataSection(string title) public MetadataSection(string title)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Alpha = 0;
InternalChild = new FillFlowContainer InternalChild = textContainer = new FillFlowContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
@ -361,6 +342,44 @@ namespace osu.Game.Screens.Select
}, },
}; };
} }
public string Text
{
set
{
if (string.IsNullOrEmpty(value))
{
this.FadeOut(transition_duration);
return;
}
setTextAsync(value);
}
}
private void setTextAsync(string text)
{
LoadComponentAsync(new TextFlowContainer(s => s.TextSize = 14)
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Colour = textFlow.Colour,
Text = text
}, loaded =>
{
textFlow?.Expire();
textContainer.Add(textFlow = loaded);
// fade in if we haven't yet.
this.FadeIn(transition_duration);
});
}
public Color4 TextColour
{
get { return textFlow.Colour; }
set { textFlow.Colour = value; }
}
} }
private class DimmedLoadingAnimation : VisibilityContainer private class DimmedLoadingAnimation : VisibilityContainer