From d2a62351350459d763f5fc43e60b6d2328c19613 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 7 Sep 2023 14:19:15 +0900 Subject: [PATCH] Fix code quality issues --- osu.Game/Graphics/UserInterface/OsuSliderBar.cs | 2 +- osu.Game/Rulesets/Mods/DifficultyBindable.cs | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs index cf3cb3b734..e5f5f97eb7 100644 --- a/osu.Game/Graphics/UserInterface/OsuSliderBar.cs +++ b/osu.Game/Graphics/UserInterface/OsuSliderBar.cs @@ -82,7 +82,7 @@ namespace osu.Game.Graphics.UserInterface channel.Play(); } - protected LocalisableString getTooltipText(T value) + private LocalisableString getTooltipText(T value) { if (CurrentNumber.IsInteger) return value.ToInt32(NumberFormatInfo.InvariantInfo).ToString("N0"); diff --git a/osu.Game/Rulesets/Mods/DifficultyBindable.cs b/osu.Game/Rulesets/Mods/DifficultyBindable.cs index 4afeb6c8b2..a207048882 100644 --- a/osu.Game/Rulesets/Mods/DifficultyBindable.cs +++ b/osu.Game/Rulesets/Mods/DifficultyBindable.cs @@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Mods return; minValue = value; - updateMinValue(); + updateExtents(); } } @@ -58,7 +58,7 @@ namespace osu.Game.Rulesets.Mods return; maxValue = value; - updateMaxValue(); + updateExtents(); } } @@ -75,7 +75,7 @@ namespace osu.Game.Rulesets.Mods return; extendedMinValue = value; - updateMinValue(); + updateExtents(); } } @@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Mods return; extendedMaxValue = value; - updateMaxValue(); + updateExtents(); } } @@ -104,8 +104,7 @@ namespace osu.Game.Rulesets.Mods public DifficultyBindable(float? defaultValue = null) : base(defaultValue) { - ExtendedLimits.BindValueChanged(_ => updateMinValue()); - ExtendedLimits.BindValueChanged(_ => updateMaxValue()); + ExtendedLimits.BindValueChanged(_ => updateExtents()); } public override float? Value @@ -121,13 +120,9 @@ namespace osu.Game.Rulesets.Mods } } - private void updateMinValue() + private void updateExtents() { CurrentNumber.MinValue = ExtendedLimits.Value && extendedMinValue != null ? extendedMinValue.Value : minValue; - } - - private void updateMaxValue() - { CurrentNumber.MaxValue = ExtendedLimits.Value && extendedMaxValue != null ? extendedMaxValue.Value : maxValue; }