mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Fix control point hover text and context menu
This commit is contained in:
parent
ceeaf5b67c
commit
520642975b
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
int totalCount = Pieces.Count(p => p.IsSelected.Value);
|
||||
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))
|
||||
updatePathType(p, type);
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Types
|
||||
{
|
||||
@ -13,7 +14,7 @@ namespace osu.Game.Rulesets.Objects.Types
|
||||
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 BEZIER = new PathType(SplineType.BSpline);
|
||||
@ -31,6 +32,15 @@ namespace osu.Game.Rulesets.Objects.Types
|
||||
/// </summary>
|
||||
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)
|
||||
{
|
||||
Type = splineType;
|
||||
|
Loading…
Reference in New Issue
Block a user