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

Revert changes to GetTooltipText and use TooltipText override directly

This commit is contained in:
Dean Herbert 2022-03-05 22:46:13 +09:00
parent 524b8e02ef
commit ce51ce49cf
2 changed files with 7 additions and 9 deletions

View File

@ -148,7 +148,7 @@ namespace osu.Game.Graphics.UserInterface
protected override void LoadComplete()
{
base.LoadComplete();
CurrentNumber.BindValueChanged(current => TooltipText = GetTooltipText(current.NewValue), true);
CurrentNumber.BindValueChanged(current => TooltipText = getTooltipText(current.NewValue), true);
}
protected override bool OnHover(HoverEvent e)
@ -178,7 +178,7 @@ namespace osu.Game.Graphics.UserInterface
{
base.OnUserChange(value);
playSample(value);
TooltipText = GetTooltipText(value);
TooltipText = getTooltipText(value);
}
private void playSample(T value)
@ -203,7 +203,7 @@ namespace osu.Game.Graphics.UserInterface
channel.Play();
}
protected virtual LocalisableString GetTooltipText(T value)
private LocalisableString getTooltipText(T value)
{
if (CurrentNumber.IsInteger)
return value.ToInt32(NumberFormatInfo.InvariantInfo).ToString("N0");

View File

@ -97,12 +97,10 @@ namespace osu.Game.Screens.Play.PlayerSettings
protected class CustomSliderBar : SliderBar
{
protected override LocalisableString GetTooltipText(double value)
{
return value == 0
? new TranslatableString("_", @"{0} ms", base.GetTooltipText(value))
: new TranslatableString("_", @"{0} ms {1}", base.GetTooltipText(value), getEarlyLateText(value));
}
public override LocalisableString TooltipText =>
Current.Value == 0
? new TranslatableString("_", @"{0} ms", base.TooltipText)
: new TranslatableString("_", @"{0} ms {1}", base.TooltipText, getEarlyLateText(Current.Value));
private LocalisableString getEarlyLateText(double value)
{