diff --git a/osu.Game/Rulesets/Edit/HitObjectMask.cs b/osu.Game/Rulesets/Edit/HitObjectMask.cs
index 44ee981783..8b0d40dadc 100644
--- a/osu.Game/Rulesets/Edit/HitObjectMask.cs
+++ b/osu.Game/Rulesets/Edit/HitObjectMask.cs
@@ -16,14 +16,29 @@ namespace osu.Game.Rulesets.Edit
///
public class HitObjectMask : VisibilityContainer
{
+ ///
+ /// Invoked when this has been selected.
+ ///
public event Action Selected;
+
+ ///
+ /// Invoked when this has been deselected.
+ ///
public event Action Deselected;
+
+ ///
+ /// Invoked when this is requesting to be the single selection.
+ /// This has not been selected at this point, but will be selected immediately afterwards.
+ ///
public event Action SingleSelectionRequested;
+ ///
+ /// The which this applies to.
+ ///
public readonly DrawableHitObject HitObject;
protected override bool ShouldBeAlive => HitObject.IsAlive || State == Visibility.Visible;
- public override bool HandleMouseInput => true;
+ public override bool HandleMouseInput => HitObject.IsPresent;
public HitObjectMask(DrawableHitObject hitObject)
{
@@ -63,14 +78,9 @@ namespace osu.Game.Rulesets.Edit
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
- if (HitObject.IsPresent)
- {
- SingleSelectionRequested?.Invoke(this);
- Select();
- return true;
- }
-
- return false;
+ SingleSelectionRequested?.Invoke(this);
+ Select();
+ return true;
}
protected override bool OnDragStart(InputState state) => true;
diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs
index 2907f48568..ca161a6f37 100644
--- a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs
+++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs
@@ -17,9 +17,9 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
{
private readonly Playfield playfield;
private readonly HitObjectComposer composer;
- private readonly Container maskContainer;
- private readonly SelectionBox selectionBox;
+ private Container maskContainer;
+ private SelectionBox selectionBox;
private readonly HashSet selectedMasks = new HashSet();
@@ -29,7 +29,11 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
this.composer = composer;
RelativeSizeAxes = Axes.Both;
+ }
+ [BackgroundDependencyLoader]
+ private void load()
+ {
maskContainer = new Container();
selectionBox = composer.CreateSelectionBox();
@@ -43,11 +47,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
selectionBox,
dragBox.CreateProxy()
};
- }
- [BackgroundDependencyLoader]
- private void load()
- {
foreach (var obj in playfield.HitObjects.Objects)
addMask(obj);
}