1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:58:21 +08:00

Initial commit

This commit is contained in:
EVAST9919 2017-04-28 21:05:00 +03:00
parent 88b2b740d7
commit d5c56aab7a

View File

@ -14,6 +14,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Menu;
using OpenTK;
using osu.Framework.Localisation;
namespace osu.Game.Screens.Play
{
@ -177,8 +178,20 @@ namespace osu.Game.Screens.Play
}
private readonly SpriteText title;
private readonly SpriteText artist;
private readonly WorkingBeatmap beatmap;
[BackgroundDependencyLoader]
private void load(LocalisationEngine localisation)
{
title.Current = localisation.GetUnicodePreference(beatmap.BeatmapSetInfo.Metadata.TitleUnicode, beatmap.BeatmapSetInfo.Metadata.Title);
artist.Current = localisation.GetUnicodePreference(beatmap.BeatmapSetInfo.Metadata.ArtistUnicode, beatmap.BeatmapSetInfo.Metadata.Artist);
}
public BeatmapMetadataDisplay(WorkingBeatmap beatmap)
{
this.beatmap = beatmap;
var metadata = beatmap?.BeatmapInfo?.Metadata ?? new BeatmapMetadata();
AutoSizeAxes = Axes.Both;
@ -192,7 +205,7 @@ namespace osu.Game.Screens.Play
Direction = FillDirection.Vertical,
Children = new Drawable[]
{
new OsuSpriteText
title = new OsuSpriteText
{
Text = metadata.Title,
TextSize = 36,
@ -200,7 +213,7 @@ namespace osu.Game.Screens.Play
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
},
new OsuSpriteText
artist = new OsuSpriteText
{
Text = metadata.Artist,
TextSize = 26,