2018-04-13 17:19:50 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2018-11-28 16:20:37 +08:00
|
|
|
|
using osu.Game.Rulesets.Replays;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-11-28 16:20:37 +08:00
|
|
|
|
namespace osu.Game.Replays.Legacy
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public class LegacyReplayFrame : ReplayFrame
|
|
|
|
|
{
|
|
|
|
|
public Vector2 Position => new Vector2(MouseX ?? 0, MouseY ?? 0);
|
|
|
|
|
|
|
|
|
|
public float? MouseX;
|
|
|
|
|
public float? MouseY;
|
|
|
|
|
|
|
|
|
|
public bool MouseLeft => MouseLeft1 || MouseLeft2;
|
|
|
|
|
public bool MouseRight => MouseRight1 || MouseRight2;
|
|
|
|
|
|
2018-07-16 15:17:22 +08:00
|
|
|
|
public bool MouseLeft1 => ButtonState.HasFlag(ReplayButtonState.Left1);
|
|
|
|
|
public bool MouseRight1 => ButtonState.HasFlag(ReplayButtonState.Right1);
|
|
|
|
|
public bool MouseLeft2 => ButtonState.HasFlag(ReplayButtonState.Left2);
|
|
|
|
|
public bool MouseRight2 => ButtonState.HasFlag(ReplayButtonState.Right2);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
public ReplayButtonState ButtonState;
|
|
|
|
|
|
|
|
|
|
public LegacyReplayFrame(double time, float? mouseX, float? mouseY, ReplayButtonState buttonState)
|
|
|
|
|
: base(time)
|
|
|
|
|
{
|
|
|
|
|
MouseX = mouseX;
|
|
|
|
|
MouseY = mouseY;
|
|
|
|
|
ButtonState = buttonState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return $"{Time}\t({MouseX},{MouseY})\t{MouseLeft}\t{MouseRight}\t{MouseLeft1}\t{MouseRight1}\t{MouseLeft2}\t{MouseRight2}\t{ButtonState}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|