From 4cdb6dcea5307c328be87b2635996ffc0f3b2f69 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 3 Oct 2018 13:28:00 +0900 Subject: [PATCH] Rename HitObjectMask -> SelectionMask --- ...ldNoteMask.cs => HoldNoteSelectionMask.cs} | 12 +++--- .../{NoteMask.cs => NoteSelectionMask.cs} | 4 +- .../Edit/ManiaHitObjectComposer.cs | 6 +-- ...ircleMask.cs => HitCircleSelectionMask.cs} | 4 +- ...leMask.cs => SliderCircleSelectionMask.cs} | 8 ++-- .../{SliderMask.cs => SliderSelectionMask.cs} | 8 ++-- .../Edit/OsuHitObjectComposer.cs | 6 +-- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 4 +- .../{HitObjectMask.cs => SelectionMask.cs} | 30 +++++++-------- .../Edit/Screens/Compose/Layers/DragLayer.cs | 4 +- .../Screens/Compose/Layers/MaskContainer.cs | 38 +++++++++---------- .../Screens/Compose/Layers/MaskSelection.cs | 14 +++---- 13 files changed, 70 insertions(+), 70 deletions(-) rename osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/{HoldNoteMask.cs => HoldNoteSelectionMask.cs} (87%) rename osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/{NoteMask.cs => NoteSelectionMask.cs} (90%) rename osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/{HitCircleMask.cs => HitCircleSelectionMask.cs} (88%) rename osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/{SliderCircleMask.cs => SliderCircleSelectionMask.cs} (81%) rename osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/{SliderMask.cs => SliderSelectionMask.cs} (87%) rename osu.Game/Rulesets/Edit/{HitObjectMask.cs => SelectionMask.cs} (80%) diff --git a/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs b/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteSelectionMask.cs similarity index 87% rename from osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs rename to osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteSelectionMask.cs index 03d2ba19cb..b4f62ea170 100644 --- a/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs +++ b/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteSelectionMask.cs @@ -15,7 +15,7 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays { - public class HoldNoteMask : HitObjectMask + public class HoldNoteSelectionMask : SelectionMask { public new DrawableHoldNote HitObject => (DrawableHoldNote)base.HitObject; @@ -23,13 +23,13 @@ namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays private readonly BodyPiece body; - public HoldNoteMask(DrawableHoldNote hold) + public HoldNoteSelectionMask(DrawableHoldNote hold) : base(hold) { InternalChildren = new Drawable[] { - new HoldNoteNoteMask(hold.Head), - new HoldNoteNoteMask(hold.Tail), + new HoldNoteNoteSelectionMask(hold.Head), + new HoldNoteNoteSelectionMask(hold.Tail), body = new BodyPiece { AccentColour = Color4.Transparent @@ -59,9 +59,9 @@ namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays Y -= HitObject.Tail.DrawHeight; } - private class HoldNoteNoteMask : NoteMask + private class HoldNoteNoteSelectionMask : NoteSelectionMask { - public HoldNoteNoteMask(DrawableNote note) + public HoldNoteNoteSelectionMask(DrawableNote note) : base(note) { Select(); diff --git a/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/NoteMask.cs b/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/NoteSelectionMask.cs similarity index 90% rename from osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/NoteMask.cs rename to osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/NoteSelectionMask.cs index 78f876cb14..d976386d6e 100644 --- a/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/NoteMask.cs +++ b/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/NoteSelectionMask.cs @@ -9,9 +9,9 @@ using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays { - public class NoteMask : HitObjectMask + public class NoteSelectionMask : SelectionMask { - public NoteMask(DrawableNote note) + public NoteSelectionMask(DrawableNote note) : base(note) { Scale = note.Scale; diff --git a/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs b/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs index f37d8134ce..7cc473c712 100644 --- a/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs +++ b/osu.Game.Rulesets.Mania/Edit/ManiaHitObjectComposer.cs @@ -40,14 +40,14 @@ namespace osu.Game.Rulesets.Mania.Edit new HitObjectCompositionTool("Hold"), }; - public override HitObjectMask CreateMaskFor(DrawableHitObject hitObject) + public override SelectionMask CreateMaskFor(DrawableHitObject hitObject) { switch (hitObject) { case DrawableNote note: - return new NoteMask(note); + return new NoteSelectionMask(note); case DrawableHoldNote holdNote: - return new HoldNoteMask(holdNote); + return new HoldNoteSelectionMask(holdNote); } return base.CreateMaskFor(hitObject); diff --git a/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/HitCircleMask.cs b/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/HitCircleSelectionMask.cs similarity index 88% rename from osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/HitCircleMask.cs rename to osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/HitCircleSelectionMask.cs index a2aa639004..aa8044af15 100644 --- a/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/HitCircleMask.cs +++ b/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/HitCircleSelectionMask.cs @@ -10,9 +10,9 @@ using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays { - public class HitCircleMask : HitObjectMask + public class HitCircleSelectionMask : SelectionMask { - public HitCircleMask(DrawableHitCircle hitCircle) + public HitCircleSelectionMask(DrawableHitCircle hitCircle) : base(hitCircle) { Origin = Anchor.Centre; diff --git a/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleMask.cs b/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleSelectionMask.cs similarity index 81% rename from osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleMask.cs rename to osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleSelectionMask.cs index 151564a2a8..4d6a530eda 100644 --- a/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleMask.cs +++ b/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderCircleSelectionMask.cs @@ -12,21 +12,21 @@ using OpenTK; namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays { - public class SliderCircleMask : HitObjectMask + public class SliderCircleSelectionMask : SelectionMask { - public SliderCircleMask(DrawableHitCircle sliderHead, DrawableSlider slider) + public SliderCircleSelectionMask(DrawableHitCircle sliderHead, DrawableSlider slider) : this(sliderHead, Vector2.Zero, slider) { } - public SliderCircleMask(DrawableSliderTail sliderTail, DrawableSlider slider) + public SliderCircleSelectionMask(DrawableSliderTail sliderTail, DrawableSlider slider) : this(sliderTail, ((Slider)slider.HitObject).Curve.PositionAt(1), slider) { } private readonly DrawableOsuHitObject hitObject; - private SliderCircleMask(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider) + private SliderCircleSelectionMask(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider) : base(hitObject) { this.hitObject = hitObject; diff --git a/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderMask.cs b/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderSelectionMask.cs similarity index 87% rename from osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderMask.cs rename to osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderSelectionMask.cs index aff42dd233..40c2026937 100644 --- a/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderMask.cs +++ b/osu.Game.Rulesets.Osu/Edit/Layers/Selection/Overlays/SliderSelectionMask.cs @@ -14,12 +14,12 @@ using OpenTK.Graphics; namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays { - public class SliderMask : HitObjectMask + public class SliderSelectionMask : SelectionMask { private readonly SliderBody body; private readonly DrawableSlider slider; - public SliderMask(DrawableSlider slider) + public SliderSelectionMask(DrawableSlider slider) : base(slider) { this.slider = slider; @@ -35,8 +35,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays AccentColour = Color4.Transparent, PathWidth = sliderObject.Scale * 64 }, - new SliderCircleMask(slider.HeadCircle, slider), - new SliderCircleMask(slider.TailCircle, slider), + new SliderCircleSelectionMask(slider.HeadCircle, slider), + new SliderCircleSelectionMask(slider.TailCircle, slider), }; sliderObject.PositionChanged += _ => Position = slider.Position; diff --git a/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs b/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs index dce1fc2851..04f573596b 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs @@ -33,14 +33,14 @@ namespace osu.Game.Rulesets.Osu.Edit protected override ScalableContainer CreateLayerContainer() => new ScalableContainer(OsuPlayfield.BASE_SIZE.X) { RelativeSizeAxes = Axes.Both }; - public override HitObjectMask CreateMaskFor(DrawableHitObject hitObject) + public override SelectionMask CreateMaskFor(DrawableHitObject hitObject) { switch (hitObject) { case DrawableHitCircle circle: - return new HitCircleMask(circle); + return new HitCircleSelectionMask(circle); case DrawableSlider slider: - return new SliderMask(slider); + return new SliderSelectionMask(slider); } return base.CreateMaskFor(hitObject); diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index aa653d88f9..758a98e317 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -348,7 +348,7 @@ namespace osu.Game.Beatmaps OnlineBeatmapSetID = beatmap.BeatmapInfo.BeatmapSet?.OnlineBeatmapSetID, Beatmaps = new List(), Hash = computeBeatmapSetHash(reader), - Metadata = beatmap.Metadata + Metadata = beatmap.Metadata, }; } diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index a3253250f2..8e8bc7edb8 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -151,10 +151,10 @@ namespace osu.Game.Rulesets.Edit protected abstract IReadOnlyList CompositionTools { get; } /// - /// Creates a for a specific . + /// Creates a for a specific . /// /// The to create the overlay for. - public virtual HitObjectMask CreateMaskFor(DrawableHitObject hitObject) => null; + public virtual SelectionMask CreateMaskFor(DrawableHitObject hitObject) => null; /// /// Creates a which outlines s diff --git a/osu.Game/Rulesets/Edit/HitObjectMask.cs b/osu.Game/Rulesets/Edit/SelectionMask.cs similarity index 80% rename from osu.Game/Rulesets/Edit/HitObjectMask.cs rename to osu.Game/Rulesets/Edit/SelectionMask.cs index 636ea418f3..9582c30457 100644 --- a/osu.Game/Rulesets/Edit/HitObjectMask.cs +++ b/osu.Game/Rulesets/Edit/SelectionMask.cs @@ -16,31 +16,31 @@ namespace osu.Game.Rulesets.Edit /// /// A mask placed above a adding editing functionality. /// - public class HitObjectMask : CompositeDrawable, IStateful + public class SelectionMask : CompositeDrawable, IStateful { /// - /// Invoked when this has been selected. + /// Invoked when this has been selected. /// - public event Action Selected; + public event Action Selected; /// - /// Invoked when this has been deselected. + /// Invoked when this has been deselected. /// - public event Action Deselected; + public event Action Deselected; /// - /// Invoked when this has requested selection. + /// Invoked when this has requested selection. /// Will fire even if already selected. Does not actually perform selection. /// - public event Action SelectionRequested; + public event Action SelectionRequested; /// - /// Invoked when this has requested drag. + /// Invoked when this has requested drag. /// - public event Action DragRequested; + public event Action DragRequested; /// - /// The which this applies to. + /// The which this applies to. /// public readonly DrawableHitObject HitObject; @@ -48,7 +48,7 @@ namespace osu.Game.Rulesets.Edit public override bool HandlePositionalInput => ShouldBeAlive; public override bool RemoveWhenNotAlive => false; - public HitObjectMask(DrawableHitObject hitObject) + public SelectionMask(DrawableHitObject hitObject) { HitObject = hitObject; @@ -83,12 +83,12 @@ namespace osu.Game.Rulesets.Edit } /// - /// Selects this , causing it to become visible. + /// Selects this , causing it to become visible. /// public void Select() => State = SelectionState.Selected; /// - /// Deselects this , causing it to become invisible. + /// Deselects this , causing it to become invisible. /// public void Deselect() => State = SelectionState.NotSelected; @@ -130,12 +130,12 @@ namespace osu.Game.Rulesets.Edit } /// - /// The screen-space point that causes this to be selected. + /// The screen-space point that causes this to be selected. /// public virtual Vector2 SelectionPoint => ScreenSpaceDrawQuad.Centre; /// - /// The screen-space quad that outlines this for selections. + /// The screen-space quad that outlines this for selections. /// public virtual Quad SelectionQuad => ScreenSpaceDrawQuad; } diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs index 981ddd989c..fdc0dee0ce 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs @@ -14,7 +14,7 @@ using OpenTK.Graphics; namespace osu.Game.Screens.Edit.Screens.Compose.Layers { /// - /// A layer that handles and displays drag selection for a collection of s. + /// A layer that handles and displays drag selection for a collection of s. /// public class DragLayer : CompositeDrawable { @@ -30,7 +30,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers /// /// Creates a new . /// - /// The selectable s. + /// The selectable s. public DragLayer(Action performSelection) { this.performSelection = performSelection; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs index 19258d669e..42a7757721 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskContainer.cs @@ -13,36 +13,36 @@ using RectangleF = osu.Framework.Graphics.Primitives.RectangleF; namespace osu.Game.Screens.Edit.Screens.Compose.Layers { - public class MaskContainer : Container + public class MaskContainer : Container { /// - /// Invoked when any is selected. + /// Invoked when any is selected. /// - public event Action MaskSelected; + public event Action MaskSelected; /// - /// Invoked when any is deselected. + /// Invoked when any is deselected. /// - public event Action MaskDeselected; + public event Action MaskDeselected; /// - /// Invoked when any requests selection. + /// Invoked when any requests selection. /// - public event Action MaskSelectionRequested; + public event Action MaskSelectionRequested; /// - /// Invoked when any requests drag. + /// Invoked when any requests drag. /// - public event Action MaskDragRequested; + public event Action MaskDragRequested; - private IEnumerable aliveMasks => AliveInternalChildren.Cast(); + private IEnumerable aliveMasks => AliveInternalChildren.Cast(); public MaskContainer() { RelativeSizeAxes = Axes.Both; } - public override void Add(HitObjectMask drawable) + public override void Add(SelectionMask drawable) { if (drawable == null) throw new ArgumentNullException(nameof(drawable)); @@ -54,7 +54,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers drawable.DragRequested += onDragRequested; } - public override bool Remove(HitObjectMask drawable) + public override bool Remove(SelectionMask drawable) { if (drawable == null) throw new ArgumentNullException(nameof(drawable)); @@ -87,33 +87,33 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers } /// - /// Deselects all selected s. + /// Deselects all selected s. /// public void DeselectAll() => aliveMasks.ToList().ForEach(m => m.Deselect()); - private void onMaskSelected(HitObjectMask mask) + private void onMaskSelected(SelectionMask mask) { MaskSelected?.Invoke(mask); ChangeChildDepth(mask, 1); } - private void onMaskDeselected(HitObjectMask mask) + private void onMaskDeselected(SelectionMask mask) { MaskDeselected?.Invoke(mask); ChangeChildDepth(mask, 0); } - private void onSelectionRequested(HitObjectMask mask, InputState state) => MaskSelectionRequested?.Invoke(mask, state); - private void onDragRequested(HitObjectMask mask, Vector2 delta, InputState state) => MaskDragRequested?.Invoke(mask, delta, state); + private void onSelectionRequested(SelectionMask mask, InputState state) => MaskSelectionRequested?.Invoke(mask, state); + private void onDragRequested(SelectionMask mask, Vector2 delta, InputState state) => MaskDragRequested?.Invoke(mask, delta, state); protected override int Compare(Drawable x, Drawable y) { - if (!(x is HitObjectMask xMask) || !(y is HitObjectMask yMask)) + if (!(x is SelectionMask xMask) || !(y is SelectionMask yMask)) return base.Compare(x, y); return Compare(xMask, yMask); } - public int Compare(HitObjectMask x, HitObjectMask y) + public int Compare(SelectionMask x, SelectionMask y) { // dpeth is used to denote selected status (we always want selected masks to handle input first). int d = x.Depth.CompareTo(y.Depth); diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs index 635edf82da..1231737122 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/MaskSelection.cs @@ -16,19 +16,19 @@ using OpenTK; namespace osu.Game.Screens.Edit.Screens.Compose.Layers { /// - /// A box which surrounds s and provides interactive handles, context menus etc. + /// A box which surrounds s and provides interactive handles, context menus etc. /// public class MaskSelection : CompositeDrawable { public const float BORDER_RADIUS = 2; - private readonly List selectedMasks; + private readonly List selectedMasks; private Drawable outline; public MaskSelection() { - selectedMasks = new List(); + selectedMasks = new List(); RelativeSizeAxes = Axes.Both; AlwaysPresent = true; @@ -54,7 +54,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers #region User Input Handling - public void HandleDrag(HitObjectMask m, Vector2 delta, InputState state) + public void HandleDrag(SelectionMask m, Vector2 delta, InputState state) { // Todo: Various forms of snapping @@ -82,13 +82,13 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers /// Handle a mask becoming selected. /// /// The mask. - public void HandleSelected(HitObjectMask mask) => selectedMasks.Add(mask); + public void HandleSelected(SelectionMask mask) => selectedMasks.Add(mask); /// /// Handle a mask becoming deselected. /// /// The mask. - public void HandleDeselected(HitObjectMask mask) + public void HandleDeselected(SelectionMask mask) { selectedMasks.Remove(mask); @@ -101,7 +101,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers /// Handle a mask requesting selection. /// /// The mask. - public void HandleSelectionRequested(HitObjectMask mask, InputState state) + public void HandleSelectionRequested(SelectionMask mask, InputState state) { if (state.Keyboard.ControlPressed) {