mirror of
https://github.com/ppy/osu
synced 2025-02-27 08:01:45 +00:00
Simplify serialisation edge case by moving to Value
override
This commit is contained in:
parent
52ea62e3b2
commit
ba939c0b65
@ -73,13 +73,19 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
public DifficultyBindable()
|
public DifficultyBindable()
|
||||||
{
|
{
|
||||||
ExtendedLimits.BindValueChanged(_ => updateMaxValue());
|
ExtendedLimits.BindValueChanged(_ => updateMaxValue());
|
||||||
|
}
|
||||||
|
|
||||||
BindValueChanged(val =>
|
public override float? Value
|
||||||
|
{
|
||||||
|
get => base.Value;
|
||||||
|
set
|
||||||
{
|
{
|
||||||
// Ensure that in the case serialisation runs in the wrong order (and limit extensions aren't applied yet) the deserialised value is still propagated.
|
// Ensure that in the case serialisation runs in the wrong order (and limit extensions aren't applied yet) the deserialised value is still propagated.
|
||||||
if (val.NewValue != null)
|
if (value != null)
|
||||||
CurrentNumber.MaxValue = MathF.Max(CurrentNumber.MaxValue, val.NewValue.Value);
|
CurrentNumber.MaxValue = MathF.Max(CurrentNumber.MaxValue, value.Value);
|
||||||
});
|
|
||||||
|
base.Value = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMaxValue()
|
private void updateMaxValue()
|
||||||
|
Loading…
Reference in New Issue
Block a user