mirror of
https://github.com/osukey/osukey.git
synced 2025-05-19 20:47:24 +09:00
Fix beatmap transfer not working
This commit is contained in:
parent
93a8bc3d5a
commit
083bcde3cf
@ -259,6 +259,13 @@ namespace osu.Game.Beatmaps
|
|||||||
[NotNull]
|
[NotNull]
|
||||||
public Track LoadTrack() => loadedTrack = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
public Track LoadTrack() => loadedTrack = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Transfer a valid audio track into this working beatmap. Used as an optimisation to avoid reload / track swap
|
||||||
|
/// across difficulties in the same beatmap set.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="track">The track to transfer.</param>
|
||||||
|
public void TransferTrack([NotNull] Track track) => loadedTrack = track ?? throw new ArgumentNullException(nameof(track));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the loaded audio track instance. <see cref="LoadTrack"/> must have first been called.
|
/// Get the loaded audio track instance. <see cref="LoadTrack"/> must have first been called.
|
||||||
/// This generally happens via MusicController when changing the global beatmap.
|
/// This generally happens via MusicController when changing the global beatmap.
|
||||||
|
@ -282,10 +282,10 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
TrackChangeDirection direction = TrackChangeDirection.None;
|
TrackChangeDirection direction = TrackChangeDirection.None;
|
||||||
|
|
||||||
|
bool audioEquals = beatmap.NewValue?.BeatmapInfo?.AudioEquals(current?.BeatmapInfo) ?? false;
|
||||||
|
|
||||||
if (current != null)
|
if (current != null)
|
||||||
{
|
{
|
||||||
bool audioEquals = beatmap.NewValue?.BeatmapInfo?.AudioEquals(current.BeatmapInfo) ?? false;
|
|
||||||
|
|
||||||
if (audioEquals)
|
if (audioEquals)
|
||||||
direction = TrackChangeDirection.None;
|
direction = TrackChangeDirection.None;
|
||||||
else if (queuedDirection.HasValue)
|
else if (queuedDirection.HasValue)
|
||||||
@ -305,8 +305,15 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
current = beatmap.NewValue;
|
current = beatmap.NewValue;
|
||||||
|
|
||||||
if (CurrentTrack.IsDummyDevice || !beatmap.OldValue.BeatmapInfo.AudioEquals(current?.BeatmapInfo))
|
if (!audioEquals || CurrentTrack.IsDummyDevice)
|
||||||
|
{
|
||||||
changeTrack();
|
changeTrack();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// transfer still valid track to new working beatmap
|
||||||
|
current.TransferTrack(beatmap.OldValue.Track);
|
||||||
|
}
|
||||||
|
|
||||||
TrackChanged?.Invoke(current, direction);
|
TrackChanged?.Invoke(current, direction);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user