1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 04:47:50 +08:00
osu-lazer/osu.Game.Rulesets.Osu/UI/ReplayAnalysis/HitMarkerClick.cs

73 lines
2.0 KiB
C#
Raw Normal View History

2024-09-04 19:25:29 +08:00
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
2024-09-04 19:25:29 +08:00
using osu.Game.Graphics;
using osuTK;
namespace osu.Game.Rulesets.Osu.UI.ReplayAnalysis
{
2024-09-04 19:25:29 +08:00
public partial class HitMarkerClick : HitMarker
{
2024-09-04 19:25:29 +08:00
public HitMarkerClick()
{
const float length = 20;
2024-09-04 19:25:29 +08:00
const float border_size = 3;
InternalChildren = new Drawable[]
{
new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2024-09-04 19:25:29 +08:00
Size = new Vector2(border_size, length + border_size),
Colour = Colour4.Black.Opacity(0.5F)
},
new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2024-09-04 19:25:29 +08:00
Size = new Vector2(border_size, length + border_size),
Rotation = 90,
Colour = Colour4.Black.Opacity(0.5F)
},
new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(1, length),
},
new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Size = new Vector2(1, length),
Rotation = 90,
}
};
}
2024-09-04 19:25:29 +08:00
[Resolved]
private OsuColour colours { get; set; } = null!;
protected override void OnApply(AnalysisFrameEntry entry)
{
base.OnApply(entry);
switch (entry.Action)
{
case OsuAction.LeftButton:
Colour = colours.BlueLight;
break;
case OsuAction.RightButton:
Colour = colours.YellowLight;
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}
}