1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Remove unnecessary invalidation handling flow

This commit is contained in:
Dean Herbert 2022-06-30 17:13:26 +09:00
parent 0698471627
commit aab4dcefbd
2 changed files with 0 additions and 27 deletions

View File

@ -1,10 +1,6 @@
// 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.
#nullable disable
using System;
namespace osu.Game.Beatmaps namespace osu.Game.Beatmaps
{ {
public interface IWorkingBeatmapCache public interface IWorkingBeatmapCache
@ -27,10 +23,5 @@ namespace osu.Game.Beatmaps
/// </summary> /// </summary>
/// <param name="beatmapInfo">The beatmap info to invalidate any cached entries for.</param> /// <param name="beatmapInfo">The beatmap info to invalidate any cached entries for.</param>
void Invalidate(BeatmapInfo beatmapInfo); void Invalidate(BeatmapInfo beatmapInfo);
/// <summary>
/// Fired whenever a <see cref="WorkingBeatmap"/> is invalidated.
/// </summary>
event Action<WorkingBeatmap> OnInvalidated;
} }
} }

View File

@ -296,24 +296,8 @@ namespace osu.Game.Screens.Select
base.LoadComplete(); base.LoadComplete();
modSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(ModSelect); modSelectOverlayRegistration = OverlayManager?.RegisterBlockingOverlay(ModSelect);
beatmaps.OnInvalidated += workingBeatmapInvalidated;
} }
private void workingBeatmapInvalidated(WorkingBeatmap working) => Scheduler.AddOnce(w =>
{
// The global beatmap may have already been updated (ie. by the editor).
// Only perform the actual switch if we still need to.
if (w == Beatmap.Value)
{
// Not sure if this refresh is required.
var beatmapInfo = beatmaps.QueryBeatmap(b => b.ID == w.BeatmapInfo.ID);
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmapInfo);
}
updateComponentFromBeatmap(Beatmap.Value);
}, working);
/// <summary> /// <summary>
/// Creates the buttons to be displayed in the footer. /// Creates the buttons to be displayed in the footer.
/// </summary> /// </summary>
@ -719,8 +703,6 @@ namespace osu.Game.Screens.Select
music.TrackChanged -= ensureTrackLooping; music.TrackChanged -= ensureTrackLooping;
modSelectOverlayRegistration?.Dispose(); modSelectOverlayRegistration?.Dispose();
beatmaps.OnInvalidated -= workingBeatmapInvalidated;
} }
/// <summary> /// <summary>