mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 16:52:55 +08:00
Invert boolean logic
This commit is contained in:
parent
9f333ac58a
commit
d19b799f44
@ -116,7 +116,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
if (beginClickSelection(e)) return true;
|
||||
if (!beginClickSelection(e)) return true;
|
||||
|
||||
prepareSelectionMovement();
|
||||
|
||||
@ -292,23 +292,24 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// Attempts to select any hovered blueprints.
|
||||
/// </summary>
|
||||
/// <param name="e">The input event that triggered this selection.</param>
|
||||
/// <returns>Whether a selection was performed.</returns>
|
||||
private bool beginClickSelection(MouseButtonEvent e)
|
||||
{
|
||||
Debug.Assert(!clickSelectionBegan);
|
||||
|
||||
bool rightClickHandled = false;
|
||||
bool selectedPerformed = true;
|
||||
|
||||
foreach (SelectionBlueprint blueprint in SelectionBlueprints.AliveChildren)
|
||||
{
|
||||
if (blueprint.IsHovered)
|
||||
{
|
||||
rightClickHandled |= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
|
||||
selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
|
||||
clickSelectionBegan = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rightClickHandled;
|
||||
return selectedPerformed;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -219,13 +219,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// </summary>
|
||||
/// <param name="blueprint">The blueprint.</param>
|
||||
/// <param name="state">The input state at the point of selection.</param>
|
||||
/// <returns>Whether right click was handled.</returns>
|
||||
/// <returns>Whether a selection was performed.</returns>
|
||||
internal bool HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
||||
{
|
||||
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
||||
{
|
||||
handleQuickDeletion(blueprint);
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
||||
@ -233,7 +233,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
else
|
||||
ensureSelected(blueprint);
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void handleQuickDeletion(SelectionBlueprint blueprint)
|
||||
|
Loading…
Reference in New Issue
Block a user