1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 16:27:26 +08:00

Localise level badge tooltip.

This commit is contained in:
Lucas A 2021-07-17 15:21:30 +02:00
parent 4d276b114b
commit 306a34a802

View File

@ -11,6 +11,7 @@ using osu.Framework.Graphics.Textures;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Users;
namespace osu.Game.Overlays.Profile.Header.Components
@ -19,13 +20,13 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
public readonly Bindable<User> User = new Bindable<User>();
public LocalisableString TooltipText { get; }
public LocalisableString TooltipText { get; private set; }
private OsuSpriteText levelText;
public LevelBadge()
{
TooltipText = "level";
TooltipText = UsersStrings.ShowStatsLevel("0");
}
[BackgroundDependencyLoader]
@ -53,6 +54,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
private void updateLevel(User user)
{
levelText.Text = user?.Statistics?.Level.Current.ToString() ?? "0";
TooltipText = UsersStrings.ShowStatsLevel(user?.Statistics?.Level.Current.ToString());
}
}
}