mirror of https://github.com/ppy/osu
Merge branch 'master' into efficient-user-retrieval
This commit is contained in:
commit
42e4df8cc8
|
@ -75,7 +75,7 @@ protected override void LoadComplete()
|
|||
|
||||
public override bool HandleQuickDeletion()
|
||||
{
|
||||
var hoveredControlPoint = ControlPointVisualiser.Pieces.FirstOrDefault(p => p.IsHovered);
|
||||
var hoveredControlPoint = ControlPointVisualiser?.Pieces.FirstOrDefault(p => p.IsHovered);
|
||||
|
||||
if (hoveredControlPoint == null)
|
||||
return false;
|
||||
|
|
|
@ -202,7 +202,9 @@ private BindableStarDifficulty createBindable([NotNull] BeatmapInfo beatmapInfo,
|
|||
/// <param name="cancellationToken">A token that may be used to cancel this update.</param>
|
||||
private void updateBindable([NotNull] BindableStarDifficulty bindable, [CanBeNull] RulesetInfo rulesetInfo, [CanBeNull] IEnumerable<Mod> mods, CancellationToken cancellationToken = default)
|
||||
{
|
||||
GetAsync(new DifficultyCacheLookup(bindable.Beatmap, rulesetInfo, mods), cancellationToken)
|
||||
// GetDifficultyAsync will fall back to existing data from BeatmapInfo if not locally available
|
||||
// (contrary to GetAsync)
|
||||
GetDifficultyAsync(bindable.Beatmap, rulesetInfo, mods, cancellationToken)
|
||||
.ContinueWith(t =>
|
||||
{
|
||||
// We're on a threadpool thread, but we should exit back to the update thread so consumers can safely handle value-changed events.
|
||||
|
|
|
@ -20,6 +20,7 @@ protected override void LoadBeatmap(WorkingBeatmap beatmap)
|
|||
{
|
||||
base.LoadBeatmap(beatmap);
|
||||
|
||||
controlPointGroups.UnbindAll();
|
||||
controlPointGroups.BindTo(beatmap.Beatmap.ControlPointInfo.Groups);
|
||||
controlPointGroups.BindCollectionChanged((sender, args) =>
|
||||
{
|
||||
|
|
|
@ -27,6 +27,7 @@ protected override void LoadBeatmap(WorkingBeatmap beatmap)
|
|||
{
|
||||
base.LoadBeatmap(beatmap);
|
||||
|
||||
controlPointGroups.UnbindAll();
|
||||
controlPointGroups.BindTo(beatmap.Beatmap.ControlPointInfo.Groups);
|
||||
controlPointGroups.BindCollectionChanged((sender, args) =>
|
||||
{
|
||||
|
|
|
@ -499,6 +499,9 @@ private void confirmExit()
|
|||
// confirming exit without save means we should delete the new beatmap completely.
|
||||
beatmapManager.Delete(playableBeatmap.BeatmapInfo.BeatmapSet);
|
||||
|
||||
// eagerly clear contents before restoring default beatmap to prevent value change callbacks from firing.
|
||||
ClearInternal();
|
||||
|
||||
// in theory this shouldn't be required but due to EF core not sharing instance states 100%
|
||||
// MusicController is unaware of the changed DeletePending state.
|
||||
Beatmap.SetDefault();
|
||||
|
|
Loading…
Reference in New Issue