mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 07:23:14 +08:00
Invalidate waveform on track load
This commit is contained in:
parent
d0645ce151
commit
20370bd5ae
@ -105,7 +105,14 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public virtual bool TrackLoaded => track != null;
|
||||
|
||||
public Track LoadTrack() => track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||
public Track LoadTrack()
|
||||
{
|
||||
// track could be changed, clearing waveform cache
|
||||
waveform = null;
|
||||
|
||||
track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||
return track;
|
||||
}
|
||||
|
||||
public void PrepareTrackForPreview(bool looping, double offsetFromPreviewPoint = 0)
|
||||
{
|
||||
@ -172,12 +179,6 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public Waveform Waveform => waveform ??= GetWaveform();
|
||||
|
||||
/// <summary>
|
||||
/// Reloads waveform of beatmap's track even if one is already cached.
|
||||
/// </summary>
|
||||
/// <returns>Newly loaded waveform.</returns>
|
||||
public Waveform LoadWaveform() => waveform = GetWaveform();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Beatmap
|
||||
|
@ -118,7 +118,7 @@ namespace osu.Game.Screens.Edit.Setup
|
||||
}
|
||||
|
||||
working.Value.Metadata.AudioFile = destination.Name;
|
||||
working.Value.LoadWaveform();
|
||||
|
||||
editorBeatmap.SaveState();
|
||||
music.ReloadCurrentTrack();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user