mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:45:09 +08:00
Adjust initial and final rate ranges and prevent them from overlapping
This commit is contained in:
parent
66f86bdee5
commit
f45cedeb85
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
[SettingSource("Initial rate", "The starting speed of the track")]
|
||||
public override BindableNumber<double> InitialRate { get; } = new BindableDouble
|
||||
{
|
||||
MinValue = 1,
|
||||
MinValue = 0.5,
|
||||
MaxValue = 2,
|
||||
Default = 1,
|
||||
Value = 1,
|
||||
@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override BindableNumber<double> FinalRate { get; } = new BindableDouble
|
||||
{
|
||||
MinValue = 0.5,
|
||||
MaxValue = 0.99,
|
||||
MaxValue = 2,
|
||||
Default = 0.75,
|
||||
Value = 0.75,
|
||||
Precision = 0.01,
|
||||
@ -45,5 +45,14 @@ namespace osu.Game.Rulesets.Mods
|
||||
};
|
||||
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindUp)).ToArray();
|
||||
|
||||
public ModWindDown()
|
||||
{
|
||||
InitialRate.BindValueChanged(val =>
|
||||
InitialRate.Value = Math.Max(val.NewValue, FinalRate.Value + 0.01));
|
||||
|
||||
FinalRate.BindValueChanged(val =>
|
||||
FinalRate.Value = Math.Min(val.NewValue, InitialRate.Value - 0.01));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override BindableNumber<double> InitialRate { get; } = new BindableDouble
|
||||
{
|
||||
MinValue = 0.5,
|
||||
MaxValue = 1,
|
||||
MaxValue = 2,
|
||||
Default = 1,
|
||||
Value = 1,
|
||||
Precision = 0.01,
|
||||
@ -30,7 +30,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
[SettingSource("Final rate", "The speed increase to ramp towards")]
|
||||
public override BindableNumber<double> FinalRate { get; } = new BindableDouble
|
||||
{
|
||||
MinValue = 1.01,
|
||||
MinValue = 0.5,
|
||||
MaxValue = 2,
|
||||
Default = 1.5,
|
||||
Value = 1.5,
|
||||
@ -45,5 +45,14 @@ namespace osu.Game.Rulesets.Mods
|
||||
};
|
||||
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindDown)).ToArray();
|
||||
|
||||
public ModWindUp()
|
||||
{
|
||||
InitialRate.BindValueChanged(val =>
|
||||
InitialRate.Value = Math.Min(val.NewValue, FinalRate.Value - 0.01));
|
||||
|
||||
FinalRate.BindValueChanged(val =>
|
||||
FinalRate.Value = Math.Max(val.NewValue, InitialRate.Value + 0.01));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user