2024-09-05 14:12:02 +08:00
|
|
|
// 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 System.Linq;
|
2024-09-05 13:02:05 +08:00
|
|
|
using osu.Framework.Allocation;
|
2024-09-04 19:07:31 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2024-09-05 14:12:02 +08:00
|
|
|
using osu.Framework.Graphics.UserInterface;
|
2024-09-04 19:07:31 +08:00
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
|
|
|
|
{
|
2024-09-05 13:28:20 +08:00
|
|
|
/// <summary>
|
|
|
|
/// A marker which shows one movement frame, include any buttons which are pressed.
|
|
|
|
/// </summary>
|
|
|
|
public partial class FrameMarker : AnalysisMarker
|
2024-09-04 19:07:31 +08:00
|
|
|
{
|
2024-09-05 14:12:02 +08:00
|
|
|
private CircularProgress leftClickDisplay = null!;
|
|
|
|
private CircularProgress rightClickDisplay = null!;
|
2024-09-05 13:02:05 +08:00
|
|
|
private Circle mainCircle = null!;
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
2024-09-04 19:07:31 +08:00
|
|
|
{
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
{
|
2024-09-05 13:02:05 +08:00
|
|
|
mainCircle = new Circle
|
2024-09-04 19:07:31 +08:00
|
|
|
{
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
Origin = Anchor.Centre,
|
2024-09-04 20:04:59 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-09-05 13:02:05 +08:00
|
|
|
Colour = Colours.Pink2,
|
2024-09-04 19:07:31 +08:00
|
|
|
},
|
2024-09-05 14:12:02 +08:00
|
|
|
leftClickDisplay = new CircularProgress
|
2024-09-04 19:07:31 +08:00
|
|
|
{
|
2024-09-05 13:02:05 +08:00
|
|
|
Colour = Colours.Yellow,
|
2024-09-05 14:12:02 +08:00
|
|
|
Size = new Vector2(0.8f),
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
Rotation = 180,
|
|
|
|
Progress = 0.5f,
|
|
|
|
InnerRadius = 0.5f,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
},
|
|
|
|
rightClickDisplay = new CircularProgress
|
|
|
|
{
|
|
|
|
Colour = Colours.Yellow,
|
|
|
|
Size = new Vector2(0.8f),
|
|
|
|
Anchor = Anchor.CentreRight,
|
2024-09-05 13:02:05 +08:00
|
|
|
Origin = Anchor.CentreRight,
|
2024-09-05 14:12:02 +08:00
|
|
|
Progress = 0.5f,
|
|
|
|
InnerRadius = 0.5f,
|
2024-09-04 20:04:59 +08:00
|
|
|
RelativeSizeAxes = Axes.Both,
|
2024-09-04 19:07:31 +08:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
2024-09-04 20:04:59 +08:00
|
|
|
|
|
|
|
protected override void OnApply(AnalysisFrameEntry entry)
|
|
|
|
{
|
|
|
|
base.OnApply(entry);
|
2024-09-05 14:12:02 +08:00
|
|
|
Size = new Vector2(entry.Action.Any() ? 4 : 2.5f);
|
2024-09-05 13:02:05 +08:00
|
|
|
|
2024-09-05 14:12:02 +08:00
|
|
|
mainCircle.Colour = entry.Action.Any() ? Colours.Gray4 : Colours.Pink2;
|
2024-09-04 20:04:59 +08:00
|
|
|
|
2024-09-05 14:12:02 +08:00
|
|
|
leftClickDisplay.Alpha = entry.Action.Contains(OsuAction.LeftButton) ? 1 : 0;
|
|
|
|
rightClickDisplay.Alpha = entry.Action.Contains(OsuAction.RightButton) ? 1 : 0;
|
2024-09-04 20:04:59 +08:00
|
|
|
}
|
2024-09-04 19:07:31 +08:00
|
|
|
}
|
|
|
|
}
|