mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +08:00
Add comment & remove lastF
This commit is contained in:
parent
126056c436
commit
4fe1497f63
@ -91,13 +91,13 @@ namespace osu.Game.Scoring.Legacy
|
|||||||
|
|
||||||
if (score.Replay != null)
|
if (score.Replay != null)
|
||||||
{
|
{
|
||||||
LegacyReplayFrame lastF = new LegacyReplayFrame(0, 0, 0, ReplayButtonState.None);
|
int lastTimeRounded = 0;
|
||||||
|
|
||||||
foreach (var f in score.Replay.Frames.OfType<IConvertibleReplayFrame>().Select(f => f.ToLegacy(beatmap)))
|
foreach (var f in score.Replay.Frames.OfType<IConvertibleReplayFrame>().Select(f => f.ToLegacy(beatmap)))
|
||||||
{
|
{
|
||||||
replayData.Append(FormattableString.Invariant($"{Math.Round(f.Time - lastF.Time)}|{f.MouseX ?? 0}|{f.MouseY ?? 0}|{(int)f.ButtonState},"));
|
// Rounding because stable could only parse integral values
|
||||||
lastF = f;
|
int timeRounded = (int)Math.Round(f.Time);
|
||||||
lastF.Time = Math.Round(f.Time);
|
replayData.Append(FormattableString.Invariant($"{timeRounded - lastTimeRounded}|{f.MouseX ?? 0}|{f.MouseY ?? 0}|{(int)f.ButtonState},"));
|
||||||
|
lastTimeRounded = timeRounded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user