Skip to content

Commit

Permalink
Change menu items to be in same order as hotkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Jul 3, 2024
1 parent 42aff95 commit 6abb728
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,20 +483,26 @@ public MenuItem[] ContextMenuItems

curveTypeItems = new List<MenuItem>();

if (!selectedPieces.Contains(Pieces[0]))
// todo: hide/disable items which aren't valid for selected points
foreach (PathType? type in path_types)
{
curveTypeItems.Add(createMenuItemForPathType(null));
curveTypeItems.Add(new OsuMenuItemSpacer());
}
// special inherit case
if (type == null)
{
if (selectedPieces.Contains(Pieces[0]))
continue;

// todo: hide/disable items which aren't valid for selected points
curveTypeItems.Add(createMenuItemForPathType(PathType.LINEAR));
curveTypeItems.Add(createMenuItemForPathType(PathType.PERFECT_CURVE));
curveTypeItems.Add(createMenuItemForPathType(PathType.BEZIER));
curveTypeItems.Add(createMenuItemForPathType(PathType.BSpline(4)));
curveTypeItems.Add(new OsuMenuItemSpacer());
}

curveTypeItems.Add(createMenuItemForPathType(type));
}

if (selectedPieces.Any(piece => piece.ControlPoint.Type?.Type == SplineType.Catmull))
{
curveTypeItems.Add(new OsuMenuItemSpacer());
curveTypeItems.Add(createMenuItemForPathType(PathType.CATMULL));
}

var menuItems = new List<MenuItem>
{
Expand Down

0 comments on commit 6abb728

Please sign in to comment.