mirror of https://github.com/ppy/osu
Use existing reflection methods to avoid manual binding of `ExtendedLimits`
This commit is contained in:
parent
bd7c334588
commit
88b00123f6
|
@ -35,12 +35,6 @@ public class CatchModDifficultyAdjust : ModDifficultyAdjust, IApplicableToBeatma
|
||||||
[SettingSource("Spicy Patterns", "Adjust the patterns as if Hard Rock is enabled.")]
|
[SettingSource("Spicy Patterns", "Adjust the patterns as if Hard Rock is enabled.")]
|
||||||
public BindableBool HardRockOffsets { get; } = new BindableBool();
|
public BindableBool HardRockOffsets { get; } = new BindableBool();
|
||||||
|
|
||||||
public CatchModDifficultyAdjust()
|
|
||||||
{
|
|
||||||
CircleSize.ExtendedLimits.BindTo(ExtendedLimits);
|
|
||||||
ApproachRate.ExtendedLimits.BindTo(ExtendedLimits);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SettingDescription
|
public override string SettingDescription
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -30,12 +30,6 @@ public class OsuModDifficultyAdjust : ModDifficultyAdjust
|
||||||
ReadFromDifficulty = diff => diff.ApproachRate,
|
ReadFromDifficulty = diff => diff.ApproachRate,
|
||||||
};
|
};
|
||||||
|
|
||||||
public OsuModDifficultyAdjust()
|
|
||||||
{
|
|
||||||
CircleSize.ExtendedLimits.BindTo(ExtendedLimits);
|
|
||||||
ApproachRate.ExtendedLimits.BindTo(ExtendedLimits);
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string SettingDescription
|
public override string SettingDescription
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
|
@ -57,8 +57,11 @@ public abstract class ModDifficultyAdjust : Mod, IApplicableToDifficulty
|
||||||
|
|
||||||
protected ModDifficultyAdjust()
|
protected ModDifficultyAdjust()
|
||||||
{
|
{
|
||||||
OverallDifficulty.ExtendedLimits.BindTo(ExtendedLimits);
|
foreach (var (_, property) in this.GetOrderedSettingsSourceProperties())
|
||||||
DrainRate.ExtendedLimits.BindTo(ExtendedLimits);
|
{
|
||||||
|
if (property.GetValue(this) is DifficultyBindable diffAdjustBindable)
|
||||||
|
diffAdjustBindable.ExtendedLimits.BindTo(ExtendedLimits);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string SettingDescription
|
public override string SettingDescription
|
||||||
|
|
Loading…
Reference in New Issue