mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +08:00
Merge branch 'master' into beatmap-listing-search-options
This commit is contained in:
commit
4a264bc173
@ -120,6 +120,11 @@ namespace osu.Game.Rulesets.Edit
|
||||
/// </summary>
|
||||
public void Deselect() => State = SelectionState.NotSelected;
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the selection state of this <see cref="OverlaySelectionBlueprint"/>.
|
||||
/// </summary>
|
||||
public void ToggleSelection() => State = IsSelected ? SelectionState.NotSelected : SelectionState.Selected;
|
||||
|
||||
public bool IsSelected => State == SelectionState.Selected;
|
||||
|
||||
/// <summary>
|
||||
|
@ -298,13 +298,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
{
|
||||
Debug.Assert(!clickSelectionBegan);
|
||||
|
||||
// Deselections are only allowed for control + left clicks
|
||||
bool allowDeselection = e.ControlPressed && e.Button == MouseButton.Left;
|
||||
|
||||
// Todo: This is probably incorrectly disallowing multiple selections on stacked objects
|
||||
if (!allowDeselection && SelectionHandler.SelectedBlueprints.Any(s => s.IsHovered))
|
||||
return;
|
||||
|
||||
foreach (SelectionBlueprint blueprint in SelectionBlueprints.AliveChildren)
|
||||
{
|
||||
if (blueprint.IsHovered)
|
||||
|
@ -24,6 +24,7 @@ using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Compose.Components
|
||||
{
|
||||
@ -224,21 +225,21 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <param name="state">The input state at the point of selection.</param>
|
||||
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
||||
{
|
||||
if (state.Keyboard.ControlPressed)
|
||||
{
|
||||
if (blueprint.IsSelected)
|
||||
blueprint.Deselect();
|
||||
else
|
||||
blueprint.Select();
|
||||
}
|
||||
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
||||
EditorBeatmap.Remove(blueprint.HitObject);
|
||||
else if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
||||
blueprint.ToggleSelection();
|
||||
else
|
||||
{
|
||||
if (blueprint.IsSelected)
|
||||
return;
|
||||
ensureSelected(blueprint);
|
||||
}
|
||||
|
||||
DeselectAll?.Invoke();
|
||||
blueprint.Select();
|
||||
}
|
||||
private void ensureSelected(SelectionBlueprint blueprint)
|
||||
{
|
||||
if (blueprint.IsSelected)
|
||||
return;
|
||||
|
||||
DeselectAll?.Invoke();
|
||||
blueprint.Select();
|
||||
}
|
||||
|
||||
private void deleteSelected()
|
||||
|
@ -450,12 +450,21 @@ namespace osu.Game.Screens.Edit
|
||||
if (dialogOverlay == null || dialogOverlay.CurrentDialog is PromptForSaveDialog)
|
||||
{
|
||||
confirmExit();
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isNewBeatmap || HasUnsavedChanges)
|
||||
{
|
||||
dialogOverlay?.Push(new PromptForSaveDialog(confirmExit, confirmExitWithSave));
|
||||
dialogOverlay?.Push(new PromptForSaveDialog(() =>
|
||||
{
|
||||
confirmExit();
|
||||
this.Exit();
|
||||
}, () =>
|
||||
{
|
||||
confirmExitWithSave();
|
||||
this.Exit();
|
||||
}));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -470,7 +479,6 @@ namespace osu.Game.Screens.Edit
|
||||
{
|
||||
exitConfirmed = true;
|
||||
Save();
|
||||
this.Exit();
|
||||
}
|
||||
|
||||
private void confirmExit()
|
||||
@ -489,7 +497,6 @@ namespace osu.Game.Screens.Edit
|
||||
}
|
||||
|
||||
exitConfirmed = true;
|
||||
this.Exit();
|
||||
}
|
||||
|
||||
private readonly Bindable<string> clipboard = new Bindable<string>();
|
||||
|
Loading…
Reference in New Issue
Block a user