/// <summary> /// /// </summary> /// <returns>The menu item by identifier irection.</returns> /// <param name="direction">Direction.</param> public static MenuItem GenerateMovingLayerMenuItem(this IHasEditableTemplate editableTemplate) { return(new MenuItem(@"Layer") { Items = new List <MenuItem>() { new OsuMenuItem(@"Move UP", MenuItemType.Standard, () => { if (editableTemplate.RpObject is IHasLayerIndex hasLayerIndexObject) { if (hasLayerIndexObject.LayerIndex > 0) { hasLayerIndexObject.LayerIndex--; editableTemplate.UpdateTypeToDrawable(typeof(IHasLayerIndex)); } } }), new OsuMenuItem(@"MoveDown", MenuItemType.Standard, () => { if (editableTemplate.RpObject is IHasLayerIndex hasLayerIndexObject) { if (hasLayerIndexObject.LayerIndex < 10) { hasLayerIndexObject.LayerIndex++; editableTemplate.UpdateTypeToDrawable(typeof(IHasLayerIndex)); } } }), } });
/// <summary> /// Direction >> up down left right /// </summary> /// <returns>The menu item by identifier irection.</returns> /// <param name="editableTemplate"></param> public static MenuItem GenerateDirectionMenuItem(this IHasEditableTemplate editableTemplate) { return(new MenuItem(@"Direction") { Items = new List <MenuItem>() { new OsuMenuItem(@"Up", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasDirection).Direction = Direction.Up; editableTemplate.UpdateTypeToDrawable(typeof(IHasDirection)); }), new OsuMenuItem(@"Down", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasDirection).Direction = Direction.Down; editableTemplate.UpdateTypeToDrawable(typeof(IHasDirection)); }), new OsuMenuItem(@"Left", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasDirection).Direction = Direction.Left; editableTemplate.UpdateTypeToDrawable(typeof(IHasDirection)); }), new OsuMenuItem(@"Right", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasDirection).Direction = Direction.Right; editableTemplate.UpdateTypeToDrawable(typeof(IHasDirection)); }), } }); }
/// <summary> /// /// </summary> /// <returns>The menu item by identifier irection.</returns> /// <param name="direction">Direction.</param> public static MenuItem GenerateCoopMenuItem(this IHasEditableTemplate editableTemplate) { return(new MenuItem(@"Co-op") { Items = new List <MenuItem>() { new OsuMenuItem(@"Both", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasCoop).Coop = Coop.Both; editableTemplate.UpdateTypeToDrawable(typeof(IHasCoop)); }), new OsuMenuItem(@"Left Only", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasCoop).Coop = Coop.LeftOnly; editableTemplate.UpdateTypeToDrawable(typeof(IHasCoop)); }), new OsuMenuItem(@"Right Only", MenuItemType.Standard, () => { (editableTemplate.RpObject as IHasCoop).Coop = Coop.RightOnly; editableTemplate.UpdateTypeToDrawable(typeof(IHasCoop)); }), } }); }