mirror of
https://github.com/ppy/osu.git
synced 2026-05-28 02:25:29 +08:00
Refactor ModNightcore/ModDaycore
This commit is contained in:
@@ -18,16 +18,20 @@ namespace osu.Game.Rulesets.Mods
|
||||
private readonly BindableNumber<double> tempoAdjust = new BindableDouble(1);
|
||||
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
|
||||
|
||||
public override void ApplyToTrack(Track track)
|
||||
public ModDaycore()
|
||||
{
|
||||
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
||||
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
||||
|
||||
SpeedChange.BindValueChanged(val =>
|
||||
{
|
||||
freqAdjust.Value = SpeedChange.Default;
|
||||
tempoAdjust.Value = val.NewValue / SpeedChange.Default;
|
||||
}, true);
|
||||
}
|
||||
|
||||
public override void ApplyToTrack(Track track)
|
||||
{
|
||||
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
|
||||
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
||||
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,16 +19,20 @@ namespace osu.Game.Rulesets.Mods
|
||||
private readonly BindableNumber<double> tempoAdjust = new BindableDouble(1);
|
||||
private readonly BindableNumber<double> freqAdjust = new BindableDouble(1);
|
||||
|
||||
public override void ApplyToTrack(Track track)
|
||||
public ModNightcore()
|
||||
{
|
||||
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
||||
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
||||
|
||||
SpeedChange.BindValueChanged(val =>
|
||||
{
|
||||
freqAdjust.Value = SpeedChange.Default;
|
||||
tempoAdjust.Value = val.NewValue / SpeedChange.Default;
|
||||
}, true);
|
||||
}
|
||||
|
||||
public override void ApplyToTrack(Track track)
|
||||
{
|
||||
// base.ApplyToTrack() intentionally not called (different tempo adjustment is applied)
|
||||
track.AddAdjustment(AdjustableProperty.Frequency, freqAdjust);
|
||||
track.AddAdjustment(AdjustableProperty.Tempo, tempoAdjust);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user