1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Add missing LocalisableString

This commit is contained in:
huoyaoyuan 2021-07-17 19:40:32 +08:00 committed by kj415j45
parent 22ff40fdd5
commit e3c10e3994

View File

@ -14,6 +14,7 @@ using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Framework.Utils; using osu.Framework.Utils;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
@ -160,7 +161,12 @@ namespace osu.Game.Graphics.UserInterface
Margin = new MarginPadding { Top = 5, Bottom = 5 }, Margin = new MarginPadding { Top = 5, Bottom = 5 },
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Text = (value as IHasDescription)?.Description ?? (value as Enum)?.GetLocalisableDescription() ?? value.ToString(), Text = value switch{
IHasDescription desc => desc?.Description,
Enum e => e.GetLocalisableDescription(),
LocalisableString l => l,
var other => other.ToString()
},
Font = OsuFont.GetFont(size: 14) Font = OsuFont.GetFont(size: 14)
}, },
Bar = new Box Bar = new Box