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

Update all usages of OsuSlider.TooltipText overrides to instead implement GetTooltipText

This commit is contained in:
Dean Herbert 2022-03-04 12:16:05 +09:00
parent 5cfa8b8821
commit abba49fd8f
10 changed files with 15 additions and 11 deletions

View File

@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Mania
private class TimeSlider : OsuSliderBar<double> private class TimeSlider : OsuSliderBar<double>
{ {
public override LocalisableString TooltipText => Current.Value.ToString(@"N0") + "ms"; protected override LocalisableString GetTooltipText(double value) => $"{value:N0} ms";
} }
} }
} }

View File

@ -40,7 +40,7 @@ namespace osu.Game.Graphics.UserInterface
private readonly Box rightBox; private readonly Box rightBox;
private readonly Container nubContainer; private readonly Container nubContainer;
public virtual LocalisableString TooltipText { get; private set; } public LocalisableString TooltipText { get; private set; }
/// <summary> /// <summary>
/// Whether to format the tooltip as a percentage or the actual value. /// Whether to format the tooltip as a percentage or the actual value.

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
private class OffsetSlider : OsuSliderBar<double> private class OffsetSlider : OsuSliderBar<double>
{ {
public override LocalisableString TooltipText => Current.Value.ToString(@"0ms"); protected override LocalisableString GetTooltipText(double value) => value.ToString(@"0ms");
} }
} }
} }

View File

@ -240,7 +240,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
private class UIScaleSlider : OsuSliderBar<float> private class UIScaleSlider : OsuSliderBar<float>
{ {
public override LocalisableString TooltipText => base.TooltipText + "x"; protected override LocalisableString GetTooltipText(float value) => $"{base.GetTooltipText(value)}x";
} }
private class ResolutionSettingsDropdown : SettingsDropdown<Size> private class ResolutionSettingsDropdown : SettingsDropdown<Size>

View File

@ -135,7 +135,9 @@ namespace osu.Game.Overlays.Settings.Sections.Input
private class SensitivitySlider : OsuSliderBar<double> private class SensitivitySlider : OsuSliderBar<double>
{ {
public override LocalisableString TooltipText => Current.Disabled ? MouseSettingsStrings.EnableHighPrecisionForSensitivityAdjust : $"{base.TooltipText}x"; protected override LocalisableString GetTooltipText(double value) => Current.Disabled
? MouseSettingsStrings.EnableHighPrecisionForSensitivityAdjust
: $"{base.GetTooltipText(value)}x";
} }
} }
} }

View File

@ -11,6 +11,6 @@ namespace osu.Game.Overlays.Settings.Sections
/// </summary> /// </summary>
internal class SizeSlider : OsuSliderBar<float> internal class SizeSlider : OsuSliderBar<float>
{ {
public override LocalisableString TooltipText => Current.Value.ToString(@"0.##x"); protected override LocalisableString GetTooltipText(float value) => value.ToString(@"0.##x");
} }
} }

View File

@ -46,7 +46,7 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
private class TimeSlider : OsuSliderBar<float> private class TimeSlider : OsuSliderBar<float>
{ {
public override LocalisableString TooltipText => Current.Value.ToString(@"N0") + "ms"; protected override LocalisableString GetTooltipText(float value) => $"{value:N0} ms";
} }
} }
} }

View File

@ -64,12 +64,14 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface
private class MaximumStarsSlider : StarsSlider private class MaximumStarsSlider : StarsSlider
{ {
public override LocalisableString TooltipText => Current.IsDefault ? UserInterfaceStrings.NoLimit : base.TooltipText; protected override LocalisableString GetTooltipText(double value) => Current.IsDefault
? UserInterfaceStrings.NoLimit
: base.GetTooltipText(value);
} }
private class StarsSlider : OsuSliderBar<double> private class StarsSlider : OsuSliderBar<double>
{ {
public override LocalisableString TooltipText => Current.Value.ToString(@"0.## stars"); protected override LocalisableString GetTooltipText(double value) => $"{value:0.##} stars";
} }
} }
} }

View File

@ -111,6 +111,6 @@ namespace osu.Game.Rulesets.Mods
public class MuteComboSlider : OsuSliderBar<int> public class MuteComboSlider : OsuSliderBar<int>
{ {
public override LocalisableString TooltipText => Current.Value == 0 ? "always muted" : base.TooltipText; protected override LocalisableString GetTooltipText(int value) => value == 0 ? "always muted" : base.GetTooltipText(value);
} }
} }

View File

@ -57,6 +57,6 @@ namespace osu.Game.Rulesets.Mods
public class HiddenComboSlider : OsuSliderBar<int> public class HiddenComboSlider : OsuSliderBar<int>
{ {
public override LocalisableString TooltipText => Current.Value == 0 ? "always hidden" : base.TooltipText; protected override LocalisableString GetTooltipText(int value) => value == 0 ? "always hidden" : base.GetTooltipText(value);
} }
} }