Apply changes in-line with framework localisation changes

This commit is contained in:
smoogipoo
2018-09-19 14:07:46 +09:00
parent 492b5edb02
commit 28f31540c4
11 changed files with 39 additions and 60 deletions

View File

@ -1,7 +1,6 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
@ -14,8 +13,6 @@ namespace osu.Game.Screens.Multi.Components
{
private readonly OsuSpriteText beatmapTitle, beatmapDash, beatmapArtist;
private LocalisationEngine localisation;
public float TextSize
{
set { beatmapTitle.TextSize = beatmapDash.TextSize = beatmapArtist.TextSize = value; }
@ -48,12 +45,6 @@ namespace osu.Game.Screens.Multi.Components
};
}
[BackgroundDependencyLoader]
private void load(LocalisationEngine localisation)
{
this.localisation = localisation;
}
protected override void LoadComplete()
{
base.LoadComplete();
@ -64,15 +55,14 @@ namespace osu.Game.Screens.Multi.Components
{
if (beatmap == null)
{
beatmapTitle.Current = beatmapArtist.Current = null;
beatmapTitle.Text = "Changing map";
beatmapDash.Text = beatmapArtist.Text = string.Empty;
}
else
{
beatmapTitle.Current = localisation.GetUnicodePreference(beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title);
beatmapTitle.Text = new LocalisedString((beatmap.Metadata.TitleUnicode, beatmap.Metadata.Title));
beatmapDash.Text = @" - ";
beatmapArtist.Current = localisation.GetUnicodePreference(beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist);
beatmapArtist.Text = new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist));
}
}
}