mirror of
https://github.com/osukey/osukey.git
synced 2025-05-05 13:47:19 +09:00
Add activeBeatmapPreview variable for tracking beatmap preview playback
This commit is contained in:
parent
306f05b7bd
commit
eda9f83836
@ -18,6 +18,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
{
|
{
|
||||||
public class PlayButton : Container
|
public class PlayButton : Container
|
||||||
{
|
{
|
||||||
|
private static PlayButton activeBeatmapPreview;
|
||||||
public readonly Bindable<bool> Playing = new Bindable<bool>();
|
public readonly Bindable<bool> Playing = new Bindable<bool>();
|
||||||
public Track Preview { get; private set; }
|
public Track Preview { get; private set; }
|
||||||
|
|
||||||
@ -131,6 +132,9 @@ namespace osu.Game.Overlays.Direct
|
|||||||
|
|
||||||
if (playing)
|
if (playing)
|
||||||
{
|
{
|
||||||
|
if (activeBeatmapPreview != null)
|
||||||
|
activeBeatmapPreview.Playing.Value = false;
|
||||||
|
|
||||||
if (Preview == null)
|
if (Preview == null)
|
||||||
{
|
{
|
||||||
beginAudioLoad();
|
beginAudioLoad();
|
||||||
@ -140,6 +144,7 @@ namespace osu.Game.Overlays.Direct
|
|||||||
Preview.Restart();
|
Preview.Restart();
|
||||||
|
|
||||||
audio.Track.AddAdjustment(AdjustableProperty.Volume, muteBindable);
|
audio.Track.AddAdjustment(AdjustableProperty.Volume, muteBindable);
|
||||||
|
activeBeatmapPreview = this;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user