mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Add support for simple triple time
This commit is contained in:
@ -33,6 +33,11 @@ namespace osu.Game.Graphics.Containers
|
||||
/// </summary>
|
||||
public double TimeSinceLastBeat { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// How many baets per beatlength to trigger. Defaults to 1.
|
||||
/// </summary>
|
||||
public int Divisor { get; set; } = 1;
|
||||
|
||||
/// <summary>
|
||||
/// Default length of a beat in milliseconds. Used whenever there is no beatmap or track playing.
|
||||
/// </summary>
|
||||
@ -82,17 +87,19 @@ namespace osu.Game.Graphics.Containers
|
||||
effectPoint = defaultEffect;
|
||||
}
|
||||
|
||||
int beatIndex = (int)((currentTrackTime - timingPoint.Time) / timingPoint.BeatLength);
|
||||
double beatLength = timingPoint.BeatLength / Divisor;
|
||||
|
||||
int beatIndex = (int)((currentTrackTime - timingPoint.Time) / beatLength);
|
||||
|
||||
// The beats before the start of the first control point are off by 1, this should do the trick
|
||||
if (currentTrackTime < timingPoint.Time)
|
||||
beatIndex--;
|
||||
|
||||
TimeUntilNextBeat = (timingPoint.Time - currentTrackTime) % timingPoint.BeatLength;
|
||||
TimeUntilNextBeat = (timingPoint.Time - currentTrackTime) % beatLength;
|
||||
if (TimeUntilNextBeat < 0)
|
||||
TimeUntilNextBeat += timingPoint.BeatLength;
|
||||
TimeUntilNextBeat += beatLength;
|
||||
|
||||
TimeSinceLastBeat = timingPoint.BeatLength - TimeUntilNextBeat;
|
||||
TimeSinceLastBeat = beatLength - TimeUntilNextBeat;
|
||||
|
||||
if (timingPoint.Equals(lastTimingPoint) && beatIndex == lastBeat)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user