Merge remote-tracking branch 'origin/master' into osu-fontusage

# Conflicts:
#	osu.Game/Screens/Multi/Components/BeatmapTitle.cs
This commit is contained in:
smoogipoo
2019-02-20 15:04:08 +09:00
134 changed files with 2930 additions and 1557 deletions

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.Multi.Components
[BackgroundDependencyLoader]
private void load()
{
CurrentBeatmap.BindValueChanged(v => updateText(), true);
CurrentItem.BindValueChanged(v => updateText(), true);
}
private float textSize = OsuFont.DEFAULT_FONT_SIZE;
@ -48,12 +48,14 @@ namespace osu.Game.Screens.Multi.Components
private void updateText()
{
if (!IsLoaded)
if (LoadState < LoadState.Loading)
return;
textFlow.Clear();
if (CurrentBeatmap.Value == null)
var beatmap = CurrentItem.Value?.Beatmap;
if (beatmap == null)
textFlow.AddText("No beatmap selected", s =>
{
s.Font = OsuFont.GetFont(s.Font, size: TextSize);
@ -65,7 +67,7 @@ namespace osu.Game.Screens.Multi.Components
{
new OsuSpriteText
{
Text = new LocalisedString((CurrentBeatmap.Value.Metadata.ArtistUnicode, CurrentBeatmap.Value.Metadata.Artist)),
Text = new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)),
Font = OsuFont.GetFont(size: TextSize),
},
new OsuSpriteText
@ -75,10 +77,10 @@ namespace osu.Game.Screens.Multi.Components
},
new OsuSpriteText
{
Text = new LocalisedString((CurrentBeatmap.Value.Metadata.TitleUnicode, CurrentBeatmap.Value.Metadata.Title)),
Text = new LocalisedString((beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title)),
Font = OsuFont.GetFont(size: TextSize),
}
}, null, LinkAction.OpenBeatmap, CurrentBeatmap.Value.OnlineBeatmapID.ToString(), "Open beatmap");
}, null, LinkAction.OpenBeatmap, beatmap.OnlineBeatmapID.ToString(), "Open beatmap");
}
}
}