mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Prevent playlist mangling selection if not allowed
This commit is contained in:
parent
8e014ca17a
commit
b9e38269e3
@ -1,7 +1,9 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Linq;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -37,7 +39,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
switch (args.Action)
|
switch (args.Action)
|
||||||
{
|
{
|
||||||
case NotifyCollectionChangedAction.Remove:
|
case NotifyCollectionChangedAction.Remove:
|
||||||
if (args.OldItems.Contains(SelectedItem))
|
if (allowSelection && args.OldItems.Contains(SelectedItem))
|
||||||
SelectedItem.Value = null;
|
SelectedItem.Value = null;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -62,7 +64,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
private void requestDeletion(PlaylistItem item)
|
private void requestDeletion(PlaylistItem item)
|
||||||
{
|
{
|
||||||
if (SelectedItem.Value == item)
|
if (allowSelection && SelectedItem.Value == item)
|
||||||
{
|
{
|
||||||
if (Items.Count == 1)
|
if (Items.Count == 1)
|
||||||
SelectedItem.Value = null;
|
SelectedItem.Value = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user