Avoid the need for per-settings control classes

This commit is contained in:
Dean Herbert
2021-07-08 16:56:16 +09:00
parent a6e94dd491
commit bd7c334588
7 changed files with 17 additions and 18 deletions

View File

@ -11,7 +11,6 @@ using osu.Game.Overlays.Settings;
namespace osu.Game.Rulesets.Mods
{
// TODO: make abstract once we finish making each implementation.
public class DifficultyAdjustSettingsControl : SettingsItem<float?>
{
[Resolved]
@ -69,14 +68,11 @@ namespace osu.Game.Rulesets.Mods
if (Current.Value == null)
{
isInternalChange = true;
CurrentNumber.Value = UpdateFromDifficulty(difficulty);
CurrentNumber.Value = difficultyBindable.ReadFromDifficulty(difficulty);
isInternalChange = false;
}
}
// TODO: make abstract
protected virtual float UpdateFromDifficulty(BeatmapDifficulty difficulty) => 0;
private class ControlDrawable : CompositeDrawable, IHasCurrentValue<float?>
{
private readonly BindableWithCurrent<float?> current = new BindableWithCurrent<float?>();