mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Simplify text initialization
This commit is contained in:
parent
e70510ef19
commit
82fb9dc2ef
@ -212,9 +212,6 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private StarRatingDisplay starRatingDisplay = null!;
|
||||
|
||||
private ILocalisedBindableString titleBinding = null!;
|
||||
private ILocalisedBindableString artistBinding = null!;
|
||||
|
||||
private readonly WorkingBeatmap working;
|
||||
|
||||
public IBindable<double> DisplayedStars => starRatingDisplay.DisplayedStars;
|
||||
@ -238,14 +235,11 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LocalisationManager localisation)
|
||||
private void load()
|
||||
{
|
||||
var beatmapInfo = working.BeatmapInfo;
|
||||
var metadata = working.Metadata;
|
||||
|
||||
titleBinding = localisation.GetLocalisedBindableString(new RomanisableString(metadata.TitleUnicode, metadata.Title));
|
||||
artistBinding = localisation.GetLocalisedBindableString(new RomanisableString(metadata.ArtistUnicode, metadata.Artist));
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new FillFlowContainer
|
||||
@ -292,7 +286,7 @@ namespace osu.Game.Screens.Select
|
||||
TitleLabel = new TruncatingSpriteText
|
||||
{
|
||||
Shadow = true,
|
||||
Current = { BindTarget = titleBinding },
|
||||
Text = new RomanisableString(metadata.TitleUnicode, metadata.Title),
|
||||
Font = OsuFont.TorusAlternate.With(size: 40, weight: FontWeight.SemiBold),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
@ -300,7 +294,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
// TODO : figma design has a diffused shadow, instead of the solid one present here, not possible currently as far as i'm aware.
|
||||
Shadow = true,
|
||||
Current = { BindTarget = artistBinding },
|
||||
Text = new RomanisableString(metadata.ArtistUnicode, metadata.Artist),
|
||||
// Not sure if this should be semi bold or medium
|
||||
Font = OsuFont.Torus.With(size: 20, weight: FontWeight.SemiBold),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
|
Loading…
Reference in New Issue
Block a user