1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Reduce the serialised size of LegacyReplayFrame

This commit is contained in:
Dean Herbert 2020-10-22 19:17:10 +09:00
parent d659b7739d
commit 823d717a7d

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using Newtonsoft.Json;
using osu.Game.Rulesets.Replays;
using osuTK;
@ -8,17 +9,28 @@ namespace osu.Game.Replays.Legacy
{
public class LegacyReplayFrame : ReplayFrame
{
[JsonIgnore]
public Vector2 Position => new Vector2(MouseX ?? 0, MouseY ?? 0);
public float? MouseX;
public float? MouseY;
[JsonIgnore]
public bool MouseLeft => MouseLeft1 || MouseLeft2;
[JsonIgnore]
public bool MouseRight => MouseRight1 || MouseRight2;
[JsonIgnore]
public bool MouseLeft1 => ButtonState.HasFlag(ReplayButtonState.Left1);
[JsonIgnore]
public bool MouseRight1 => ButtonState.HasFlag(ReplayButtonState.Right1);
[JsonIgnore]
public bool MouseLeft2 => ButtonState.HasFlag(ReplayButtonState.Left2);
[JsonIgnore]
public bool MouseRight2 => ButtonState.HasFlag(ReplayButtonState.Right2);
public ReplayButtonState ButtonState;