Localise OrderChanged handling and fix callbacks

The dragged item's position now only updates after the drag finishes. Local handling changes were required to ignore the bindable remove/add events that are fired as a result.
This commit is contained in:
Dean Herbert
2019-09-18 13:15:39 +09:00
parent 7e791f7cd7
commit 91bdece9af
3 changed files with 33 additions and 18 deletions

View File

@ -1,7 +1,6 @@
// 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.
using System;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -22,12 +21,6 @@ namespace osu.Game.Overlays.Music
private const float transition_duration = 600;
private const float playlist_height = 510;
/// <summary>
/// Invoked when the order of an item in the list has changed.
/// The second parameter indicates the new index of the item.
/// </summary>
public Action<BeatmapSetInfo, int> OrderChanged;
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
private BeatmapManager beatmaps;
@ -65,7 +58,6 @@ namespace osu.Game.Overlays.Music
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Top = 95, Bottom = 10, Right = 10 },
Selected = itemSelected,
OrderChanged = (s, i) => OrderChanged?.Invoke(s, i)
},
filter = new FilterControl
{