mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 00:02:56 +08:00
Add support for playing a SkinnableSample without restarting it
This commit is contained in:
parent
40f020c683
commit
8a6857f151
@ -67,7 +67,7 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Play()
|
public override void Play(bool restart = true)
|
||||||
{
|
{
|
||||||
cancelPendingStart();
|
cancelPendingStart();
|
||||||
RequestedPlaying = true;
|
RequestedPlaying = true;
|
||||||
@ -75,7 +75,7 @@ namespace osu.Game.Skinning
|
|||||||
if (samplePlaybackDisabled.Value)
|
if (samplePlaybackDisabled.Value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
base.Play();
|
base.Play(restart);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Stop()
|
public override void Stop()
|
||||||
|
@ -119,12 +119,13 @@ namespace osu.Game.Skinning
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Plays the samples.
|
/// Plays the samples.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Play()
|
/// <param name="restart">Whether to play the sample from the beginning.</param>
|
||||||
|
public virtual void Play(bool restart = true)
|
||||||
{
|
{
|
||||||
samplesContainer.ForEach(c =>
|
samplesContainer.ForEach(c =>
|
||||||
{
|
{
|
||||||
if (PlayWhenZeroVolume || c.AggregateVolume.Value > 0)
|
if (PlayWhenZeroVolume || c.AggregateVolume.Value > 0)
|
||||||
c.Play();
|
c.Play(restart);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user