2021-04-15 17:42:30 +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 osu.Framework.Allocation;
|
2024-07-12 13:18:41 +08:00
|
|
|
using osu.Framework.Extensions;
|
2024-07-12 12:57:36 +08:00
|
|
|
using osu.Framework.Graphics;
|
2024-07-12 13:18:41 +08:00
|
|
|
using osu.Framework.Graphics.Cursor;
|
|
|
|
using osu.Framework.Localisation;
|
2021-04-15 17:42:30 +08:00
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
2024-07-12 13:18:41 +08:00
|
|
|
using osu.Game.Extensions;
|
2021-04-15 17:42:30 +08:00
|
|
|
using osu.Game.Graphics;
|
|
|
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Visualisations;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
|
|
|
|
{
|
2024-07-12 13:18:41 +08:00
|
|
|
public partial class ControlPointVisualisation : PointVisualisation, IControlPointVisualisation, IHasTooltip
|
2021-04-15 17:42:30 +08:00
|
|
|
{
|
|
|
|
protected readonly ControlPoint Point;
|
|
|
|
|
|
|
|
public ControlPointVisualisation(ControlPoint point)
|
2024-07-12 13:18:41 +08:00
|
|
|
: base(point.Time)
|
2021-04-15 17:42:30 +08:00
|
|
|
{
|
|
|
|
Point = point;
|
2024-07-19 18:50:21 +08:00
|
|
|
Alpha = 0.5f;
|
2024-07-12 12:57:36 +08:00
|
|
|
Blending = BlendingParameters.Additive;
|
2021-04-15 17:42:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
{
|
|
|
|
Colour = Point.GetRepresentingColour(colours);
|
|
|
|
}
|
2022-01-14 15:29:26 +08:00
|
|
|
|
2022-01-15 22:55:11 +08:00
|
|
|
public bool IsVisuallyRedundant(ControlPoint other) => other.GetType() == Point.GetType();
|
2024-07-12 13:18:41 +08:00
|
|
|
|
|
|
|
public LocalisableString TooltipText
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
switch (Point)
|
|
|
|
{
|
|
|
|
case EffectControlPoint effect:
|
|
|
|
return $"{StartTime.ToEditorFormattedString()} effect [{effect.ScrollSpeed:N2}x scroll{(effect.KiaiMode ? " kiai" : "")}]";
|
|
|
|
|
|
|
|
case TimingControlPoint timing:
|
|
|
|
return $"{StartTime.ToEditorFormattedString()} timing [{timing.BPM:N2} bpm {timing.TimeSignature.GetDescription()}]";
|
|
|
|
}
|
|
|
|
|
|
|
|
return string.Empty;
|
|
|
|
}
|
|
|
|
}
|
2021-04-15 17:42:30 +08:00
|
|
|
}
|
|
|
|
}
|