mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 02:37:25 +09:00
Simplify logic
This commit is contained in:
parent
069d48ac14
commit
fd54ae3c87
@ -173,8 +173,9 @@ namespace osu.Game.Overlays.Direct
|
|||||||
if (trackLoader != d) return;
|
if (trackLoader != d) return;
|
||||||
|
|
||||||
Preview = d?.Preview;
|
Preview = d?.Preview;
|
||||||
Playing.TriggerChange();
|
updatePreviewTrack(Playing);
|
||||||
loading = false;
|
loading = false;
|
||||||
|
|
||||||
Add(trackLoader);
|
Add(trackLoader);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -59,13 +59,13 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
|||||||
|
|
||||||
panel.PreviewPlaying.ValueChanged += isPlaying =>
|
panel.PreviewPlaying.ValueChanged += isPlaying =>
|
||||||
{
|
{
|
||||||
if (!isPlaying) return;
|
StopPlayingPreview();
|
||||||
|
|
||||||
BeganPlayingPreview?.Invoke(this);
|
if (isPlaying)
|
||||||
if (currentlyPlaying != null && currentlyPlaying != panel)
|
{
|
||||||
StopPlayingPreview();
|
BeganPlayingPreview?.Invoke(this);
|
||||||
|
currentlyPlaying = panel;
|
||||||
currentlyPlaying = panel;
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -75,8 +75,9 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
|
|||||||
|
|
||||||
public void StopPlayingPreview()
|
public void StopPlayingPreview()
|
||||||
{
|
{
|
||||||
if (currentlyPlaying != null)
|
if (currentlyPlaying == null) return;
|
||||||
currentlyPlaying.PreviewPlaying.Value = false;
|
currentlyPlaying.PreviewPlaying.Value = false;
|
||||||
|
currentlyPlaying = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,10 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
|
|
||||||
foreach (var paginatedBeatmapContainer in Children.OfType<PaginatedBeatmapContainer>())
|
foreach (var paginatedBeatmapContainer in Children.OfType<PaginatedBeatmapContainer>())
|
||||||
{
|
{
|
||||||
paginatedBeatmapContainer.BeganPlayingPreview += beatmapContainer =>
|
paginatedBeatmapContainer.BeganPlayingPreview += _ =>
|
||||||
{
|
{
|
||||||
foreach (var bc in Children.OfType<PaginatedBeatmapContainer>())
|
foreach (var bc in Children.OfType<PaginatedBeatmapContainer>())
|
||||||
{
|
bc.StopPlayingPreview();
|
||||||
if (bc != beatmapContainer)
|
|
||||||
bc.StopPlayingPreview();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user