mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Do not store direct references to original bindable
`DifficultyAdjustSettingsControl` and its inner `SliderControl` were holding different references to `DifficultyBindable`s from the difficulty adjust mod, therefore leading to bindings being lost to the framework-side automatic unbind logic if the mod was toggled off and back on in rapid succession. Resolve by adding a shadowed implementation of `GetBoundCopy()` and using it to isolate the controls from the mod bindable.
This commit is contained in:
@ -92,5 +92,16 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
CurrentNumber.MaxValue = ExtendedLimits.Value && extendedMaxValue != null ? extendedMaxValue.Value : maxValue;
|
||||
}
|
||||
|
||||
public new DifficultyBindable GetBoundCopy() => new DifficultyBindable
|
||||
{
|
||||
BindTarget = this,
|
||||
CurrentNumber = { BindTarget = CurrentNumber },
|
||||
ExtendedLimits = { BindTarget = ExtendedLimits },
|
||||
ReadCurrentFromDifficulty = ReadCurrentFromDifficulty,
|
||||
// the following is only safe as long as these values are effectively constants.
|
||||
MaxValue = maxValue,
|
||||
ExtendedMaxValue = extendedMaxValue
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user