1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00

Use existing reflection methods to avoid manual binding of ExtendedLimits

This commit is contained in:
Dean Herbert 2021-07-08 17:00:55 +09:00
parent bd7c334588
commit 88b00123f6
3 changed files with 5 additions and 14 deletions

View File

@ -35,12 +35,6 @@ namespace osu.Game.Rulesets.Catch.Mods
[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

View File

@ -30,12 +30,6 @@ namespace osu.Game.Rulesets.Osu.Mods
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

View File

@ -57,8 +57,11 @@ namespace osu.Game.Rulesets.Mods
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