1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 12:35:34 +08:00

Fix control point hover text and context menu

This commit is contained in:
cs 2023-11-15 07:45:09 +01:00
parent ceeaf5b67c
commit 520642975b
3 changed files with 13 additions and 3 deletions

View File

@ -279,6 +279,6 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
} }
} }
public LocalisableString TooltipText => ControlPoint.Type.ToString() ?? string.Empty; public LocalisableString TooltipText => ControlPoint.Type?.Description ?? string.Empty;
} }
} }

View File

@ -403,7 +403,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
int totalCount = Pieces.Count(p => p.IsSelected.Value); int totalCount = Pieces.Count(p => p.IsSelected.Value);
int countOfState = Pieces.Where(p => p.IsSelected.Value).Count(p => p.ControlPoint.Type == type); int countOfState = Pieces.Where(p => p.IsSelected.Value).Count(p => p.ControlPoint.Type == type);
var item = new TernaryStateRadioMenuItem(type == null ? "Inherit" : type.ToString().Humanize(), MenuItemType.Standard, _ => var item = new TernaryStateRadioMenuItem(type == null ? "Inherit" : type!.Value.Description, MenuItemType.Standard, _ =>
{ {
foreach (var p in Pieces.Where(p => p.IsSelected.Value)) foreach (var p in Pieces.Where(p => p.IsSelected.Value))
updatePathType(p, type); updatePathType(p, type);

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using osu.Framework.Bindables;
namespace osu.Game.Rulesets.Objects.Types namespace osu.Game.Rulesets.Objects.Types
{ {
@ -13,7 +14,7 @@ namespace osu.Game.Rulesets.Objects.Types
PerfectCurve PerfectCurve
} }
public readonly struct PathType : IEquatable<PathType> public readonly struct PathType : IEquatable<PathType>, IHasDescription
{ {
public static readonly PathType CATMULL = new PathType(SplineType.Catmull); public static readonly PathType CATMULL = new PathType(SplineType.Catmull);
public static readonly PathType BEZIER = new PathType(SplineType.BSpline); public static readonly PathType BEZIER = new PathType(SplineType.BSpline);
@ -31,6 +32,15 @@ namespace osu.Game.Rulesets.Objects.Types
/// </summary> /// </summary>
public int? Degree { get; init; } public int? Degree { get; init; }
public string Description => Type switch
{
SplineType.Catmull => "Catmull",
SplineType.BSpline => Degree == null ? "Bezier" : "B-Spline",
SplineType.Linear => "Linear",
SplineType.PerfectCurve => "Perfect Curve",
_ => Type.ToString()
};
public PathType(SplineType splineType) public PathType(SplineType splineType)
{ {
Type = splineType; Type = splineType;