mirror of https://github.com/ppy/osu
Change osu!catch key trigger to occur on frame before positional change
This commit is contained in:
parent
e536d97255
commit
624e5644a4
|
@ -33,13 +33,13 @@ public CatchReplayFrame(double time, float? position = null, bool dashing = fals
|
|||
if (lastFrame != null)
|
||||
{
|
||||
if (Position > lastFrame.Position)
|
||||
Actions.Add(CatchAction.MoveRight);
|
||||
lastFrame.Actions.Add(CatchAction.MoveRight);
|
||||
else if (Position < lastFrame.Position)
|
||||
Actions.Add(CatchAction.MoveLeft);
|
||||
lastFrame.Actions.Add(CatchAction.MoveLeft);
|
||||
}
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, LegacyReplayFrame lastFrame = null)
|
||||
public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayFrame lastFrame = null)
|
||||
{
|
||||
Position = currentFrame.Position.X / CatchPlayfield.BASE_WIDTH;
|
||||
Dashing = currentFrame.ButtonState == ReplayButtonState.Left1;
|
||||
|
@ -47,11 +47,12 @@ public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, Legacy
|
|||
if (Dashing)
|
||||
Actions.Add(CatchAction.Dash);
|
||||
|
||||
if (lastFrame != null)
|
||||
// this probably needs some cross-checking with osu-stable to ensure it is actually correct.
|
||||
if (lastFrame is CatchReplayFrame lastCatchFrame)
|
||||
{
|
||||
if (currentFrame.Position.X > lastFrame.Position.X)
|
||||
Actions.Add(CatchAction.MoveRight);
|
||||
else if (currentFrame.Position.X < lastFrame.Position.X)
|
||||
if (Position > lastCatchFrame.Position)
|
||||
lastCatchFrame.Actions.Add(CatchAction.MoveRight);
|
||||
else if (Position < lastCatchFrame.Position)
|
||||
Actions.Add(CatchAction.MoveLeft);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public ManiaReplayFrame(double time, params ManiaAction[] actions)
|
|||
Actions.AddRange(actions);
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, IBeatmap beatmap, LegacyReplayFrame lastFrame = null)
|
||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, IBeatmap beatmap, ReplayFrame lastFrame = null)
|
||||
{
|
||||
// We don't need to fully convert, just create the converter
|
||||
var converter = new ManiaBeatmapConverter(beatmap);
|
||||
|
|
|
@ -26,7 +26,7 @@ public OsuReplayFrame(double time, Vector2 position, params OsuAction[] actions)
|
|||
Actions.AddRange(actions);
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, LegacyReplayFrame lastFrame = null)
|
||||
public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayFrame lastFrame = null)
|
||||
{
|
||||
Position = currentFrame.Position;
|
||||
if (currentFrame.MouseLeft) Actions.Add(OsuAction.LeftButton);
|
||||
|
|
|
@ -23,7 +23,7 @@ public TaikoReplayFrame(double time, params TaikoAction[] actions)
|
|||
Actions.AddRange(actions);
|
||||
}
|
||||
|
||||
public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, LegacyReplayFrame lastFrame = null)
|
||||
public void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayFrame lastFrame = null)
|
||||
{
|
||||
if (currentFrame.MouseRight1) Actions.Add(TaikoAction.LeftRim);
|
||||
if (currentFrame.MouseRight2) Actions.Add(TaikoAction.RightRim);
|
||||
|
|
|
@ -16,7 +16,7 @@ public interface IConvertibleReplayFrame
|
|||
/// </summary>
|
||||
/// <param name="currentFrame">The <see cref="LegacyReplayFrame"/> to extract values from.</param>
|
||||
/// <param name="beatmap">The beatmap.</param>
|
||||
/// <param name="lastFrame">The last <see cref="LegacyReplayFrame"/>, used to fill in missing delta information. May be null.</param>
|
||||
void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, LegacyReplayFrame lastFrame = null);
|
||||
/// <param name="lastFrame">The last post-conversion <see cref="ReplayFrame"/>, used to fill in missing delta information. May be null.</param>
|
||||
void ConvertFrom(LegacyReplayFrame currentFrame, IBeatmap beatmap, ReplayFrame lastFrame = null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ protected void CalculateAccuracy(ScoreInfo score)
|
|||
private void readLegacyReplay(Replay replay, StreamReader reader)
|
||||
{
|
||||
float lastTime = 0;
|
||||
LegacyReplayFrame currentFrame = null;
|
||||
ReplayFrame currentFrame = null;
|
||||
|
||||
foreach (var l in reader.ReadToEnd().Split(','))
|
||||
{
|
||||
|
@ -241,18 +241,16 @@ private void readLegacyReplay(Replay replay, StreamReader reader)
|
|||
if (diff < 0)
|
||||
continue;
|
||||
|
||||
var lastFrame = currentFrame;
|
||||
|
||||
currentFrame = new LegacyReplayFrame(lastTime,
|
||||
currentFrame = convertFrame(new LegacyReplayFrame(lastTime,
|
||||
Parsing.ParseFloat(split[1], Parsing.MAX_COORDINATE_VALUE),
|
||||
Parsing.ParseFloat(split[2], Parsing.MAX_COORDINATE_VALUE),
|
||||
(ReplayButtonState)Parsing.ParseInt(split[3]));
|
||||
(ReplayButtonState)Parsing.ParseInt(split[3])), currentFrame);
|
||||
|
||||
replay.Frames.Add(convertFrame(currentFrame, lastFrame));
|
||||
replay.Frames.Add(currentFrame);
|
||||
}
|
||||
}
|
||||
|
||||
private ReplayFrame convertFrame(LegacyReplayFrame currentFrame, LegacyReplayFrame lastFrame)
|
||||
private ReplayFrame convertFrame(LegacyReplayFrame currentFrame, ReplayFrame lastFrame)
|
||||
{
|
||||
var convertible = currentRuleset.CreateConvertibleReplayFrame();
|
||||
if (convertible == null)
|
||||
|
|
Loading…
Reference in New Issue