mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Merge pull request #11888 from H2n9/modtimeramp-new-behaviour
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Track;
|
||||
using osu.Framework.Bindables;
|
||||
@ -24,6 +25,8 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public double ApplyToRate(double time, double rate) => rate * SpeedChange.Value;
|
||||
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModTimeRamp) };
|
||||
|
||||
public override string SettingDescription => SpeedChange.IsDefault ? string.Empty : $"{SpeedChange.Value:N2}x";
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,8 @@ namespace osu.Game.Rulesets.Mods
|
||||
[SettingSource("Adjust pitch", "Should pitch be adjusted with speed")]
|
||||
public abstract BindableBool AdjustPitch { get; }
|
||||
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModRateAdjust) };
|
||||
|
||||
public override string SettingDescription => $"{InitialRate.Value:N2}x to {FinalRate.Value:N2}x";
|
||||
|
||||
private double finalRateTime;
|
||||
|
@ -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.51,
|
||||
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 = 1.99,
|
||||
Default = 0.75,
|
||||
Value = 0.75,
|
||||
Precision = 0.01,
|
||||
@ -45,5 +45,20 @@ namespace osu.Game.Rulesets.Mods
|
||||
};
|
||||
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindUp)).ToArray();
|
||||
|
||||
public ModWindDown()
|
||||
{
|
||||
InitialRate.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue <= FinalRate.Value)
|
||||
FinalRate.Value = val.NewValue - FinalRate.Precision;
|
||||
});
|
||||
|
||||
FinalRate.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue >= InitialRate.Value)
|
||||
InitialRate.Value = val.NewValue + InitialRate.Precision;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
public override BindableNumber<double> InitialRate { get; } = new BindableDouble
|
||||
{
|
||||
MinValue = 0.5,
|
||||
MaxValue = 1,
|
||||
MaxValue = 1.99,
|
||||
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.51,
|
||||
MaxValue = 2,
|
||||
Default = 1.5,
|
||||
Value = 1.5,
|
||||
@ -45,5 +45,20 @@ namespace osu.Game.Rulesets.Mods
|
||||
};
|
||||
|
||||
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(ModWindDown)).ToArray();
|
||||
|
||||
public ModWindUp()
|
||||
{
|
||||
InitialRate.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue >= FinalRate.Value)
|
||||
FinalRate.Value = val.NewValue + FinalRate.Precision;
|
||||
});
|
||||
|
||||
FinalRate.BindValueChanged(val =>
|
||||
{
|
||||
if (val.NewValue <= InitialRate.Value)
|
||||
InitialRate.Value = val.NewValue - InitialRate.Precision;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user