mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:13:21 +08:00
extendable minimum AR value for osu!std diff adjust mod, set to -10
This commit is contained in:
parent
9b202b5f21
commit
3db0d0d341
@ -26,6 +26,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
Precision = 0.1f,
|
||||
MinValue = 0,
|
||||
MaxValue = 10,
|
||||
ExtendedMinValue = -10,
|
||||
ExtendedMaxValue = 11,
|
||||
ReadCurrentFromDifficulty = diff => diff.ApproachRate,
|
||||
};
|
||||
|
@ -34,9 +34,18 @@ namespace osu.Game.Rulesets.Mods
|
||||
set => CurrentNumber.Precision = value;
|
||||
}
|
||||
|
||||
private float minValue;
|
||||
|
||||
public float MinValue
|
||||
{
|
||||
set => CurrentNumber.MinValue = value;
|
||||
set
|
||||
{
|
||||
if (value == minValue)
|
||||
return;
|
||||
|
||||
minValue = value;
|
||||
updateMinValue();
|
||||
}
|
||||
}
|
||||
|
||||
private float maxValue;
|
||||
@ -53,6 +62,23 @@ namespace osu.Game.Rulesets.Mods
|
||||
}
|
||||
}
|
||||
|
||||
private float? extendedMinValue;
|
||||
|
||||
/// <summary>
|
||||
/// The minimum value to be used when extended limits are applied.
|
||||
/// </summary>
|
||||
public float? ExtendedMinValue
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value == extendedMinValue)
|
||||
return;
|
||||
|
||||
extendedMinValue = value;
|
||||
updateMinValue();
|
||||
}
|
||||
}
|
||||
|
||||
private float? extendedMaxValue;
|
||||
|
||||
/// <summary>
|
||||
@ -78,6 +104,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public DifficultyBindable(float? defaultValue = null)
|
||||
: base(defaultValue)
|
||||
{
|
||||
ExtendedLimits.BindValueChanged(_ => updateMinValue());
|
||||
ExtendedLimits.BindValueChanged(_ => updateMaxValue());
|
||||
}
|
||||
|
||||
@ -94,6 +121,11 @@ namespace osu.Game.Rulesets.Mods
|
||||
}
|
||||
}
|
||||
|
||||
private void updateMinValue()
|
||||
{
|
||||
CurrentNumber.MinValue = ExtendedLimits.Value && extendedMinValue != null ? extendedMinValue.Value : minValue;
|
||||
}
|
||||
|
||||
private void updateMaxValue()
|
||||
{
|
||||
CurrentNumber.MaxValue = ExtendedLimits.Value && extendedMaxValue != null ? extendedMaxValue.Value : maxValue;
|
||||
|
Loading…
Reference in New Issue
Block a user