mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 21:07:59 +09:00
Updated DrawableStoryboardSample to use GetBoundCopy()
This commit is contained in:
parent
b220939650
commit
07ec0c0e0b
@ -18,6 +18,10 @@ namespace osu.Game.Skinning
|
|||||||
|
|
||||||
protected bool RequestedPlaying { get; private set; }
|
protected bool RequestedPlaying { get; private set; }
|
||||||
|
|
||||||
|
protected IBindable<bool> SamplePlaybackDisabled => samplePlaybackDisabled;
|
||||||
|
|
||||||
|
private readonly Bindable<bool> samplePlaybackDisabled = new Bindable<bool>();
|
||||||
|
|
||||||
public PausableSkinnableSound()
|
public PausableSkinnableSound()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -32,8 +36,6 @@ namespace osu.Game.Skinning
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected readonly IBindable<bool> SamplePlaybackDisabled = new Bindable<bool>();
|
|
||||||
|
|
||||||
private ScheduledDelegate scheduledStart;
|
private ScheduledDelegate scheduledStart;
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
|
@ -21,11 +21,29 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
|
|
||||||
public override bool RemoveWhenNotAlive => false;
|
public override bool RemoveWhenNotAlive => false;
|
||||||
|
|
||||||
|
private readonly IBindable<bool> samplePlaybackDisabled;
|
||||||
|
|
||||||
public DrawableStoryboardSample(StoryboardSampleInfo sampleInfo)
|
public DrawableStoryboardSample(StoryboardSampleInfo sampleInfo)
|
||||||
: base(sampleInfo)
|
: base(sampleInfo)
|
||||||
{
|
{
|
||||||
this.sampleInfo = sampleInfo;
|
this.sampleInfo = sampleInfo;
|
||||||
LifetimeStart = sampleInfo.StartTime;
|
LifetimeStart = sampleInfo.StartTime;
|
||||||
|
|
||||||
|
samplePlaybackDisabled = SamplePlaybackDisabled.GetBoundCopy();
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader(true)]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
samplePlaybackDisabled.BindValueChanged(disabled =>
|
||||||
|
{
|
||||||
|
if (!RequestedPlaying) return;
|
||||||
|
|
||||||
|
// Since storyboard samples can be very long we want to stop the playback regardless of
|
||||||
|
// whether or not the sample is looping or not
|
||||||
|
if (disabled.NewValue)
|
||||||
|
Stop();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
@ -40,16 +58,6 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
foreach (var sample in DrawableSamples)
|
foreach (var sample in DrawableSamples)
|
||||||
mod.ApplyToSample(sample);
|
mod.ApplyToSample(sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
SamplePlaybackDisabled.BindValueChanged(disabled =>
|
|
||||||
{
|
|
||||||
if (!RequestedPlaying) return;
|
|
||||||
|
|
||||||
// Since storyboard samples can be very long we want to stop the playback regardless of
|
|
||||||
// whether or not the sample is looping or not
|
|
||||||
if (disabled.NewValue)
|
|
||||||
Stop();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user