Initial storage changes

This commit is contained in:
Dean Herbert
2021-07-08 14:28:13 +09:00
parent 8d94e8f534
commit 0e4f4a6fde
4 changed files with 40 additions and 123 deletions

View File

@ -13,23 +13,23 @@ namespace osu.Game.Rulesets.Catch.Mods
public class CatchModDifficultyAdjust : ModDifficultyAdjust, IApplicableToBeatmapProcessor
{
[SettingSource("Circle Size", "Override a beatmap's set CS.", FIRST_SETTING_ORDER - 1)]
public BindableNumber<float> CircleSize { get; } = new BindableFloatWithLimitExtension
public Bindable<float?> CircleSize { get; } = new Bindable<float?>
{
/*
Precision = 0.1f,
MinValue = 1,
MaxValue = 10,
Default = 5,
Value = 5,
*/
};
[SettingSource("Approach Rate", "Override a beatmap's set AR.", LAST_SETTING_ORDER + 1)]
public BindableNumber<float> ApproachRate { get; } = new BindableFloatWithLimitExtension
public Bindable<float?> ApproachRate { get; } = new Bindable<float?>
{
/*
Precision = 0.1f,
MinValue = 1,
MaxValue = 10,
Default = 5,
Value = 5,
*/
};
[SettingSource("Spicy Patterns", "Adjust the patterns as if Hard Rock is enabled.")]
@ -39,8 +39,9 @@ namespace osu.Game.Rulesets.Catch.Mods
{
base.ApplyLimits(extended);
CircleSize.MaxValue = extended ? 11 : 10;
ApproachRate.MaxValue = extended ? 11 : 10;
// TODO: reimplement
// CircleSize.MaxValue = extended ? 11 : 10;
// ApproachRate.MaxValue = extended ? 11 : 10;
}
public override string SettingDescription
@ -61,20 +62,12 @@ namespace osu.Game.Rulesets.Catch.Mods
}
}
protected override void TransferSettings(BeatmapDifficulty difficulty)
{
base.TransferSettings(difficulty);
TransferSetting(CircleSize, difficulty.CircleSize);
TransferSetting(ApproachRate, difficulty.ApproachRate);
}
protected override void ApplySettings(BeatmapDifficulty difficulty)
{
base.ApplySettings(difficulty);
ApplySetting(CircleSize, cs => difficulty.CircleSize = cs);
ApplySetting(ApproachRate, ar => difficulty.ApproachRate = ar);
if (CircleSize.Value != null) difficulty.CircleSize = CircleSize.Value.Value;
if (ApproachRate.Value != null) difficulty.ApproachRate = ApproachRate.Value.Value;
}
public void ApplyToBeatmapProcessor(IBeatmapProcessor beatmapProcessor)