mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Move ISampleDisabler implementation to Player and FrameStabilityContainer
This commit is contained in:
@ -35,7 +35,8 @@ using osu.Game.Users;
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
[Cached]
|
||||
public class Player : ScreenWithBeatmapBackground
|
||||
[Cached(typeof(ISamplePlaybackDisabler))]
|
||||
public class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisabler
|
||||
{
|
||||
/// <summary>
|
||||
/// The delay upon completion of the beatmap before displaying the results screen.
|
||||
@ -55,6 +56,8 @@ namespace osu.Game.Screens.Play
|
||||
// We are managing our own adjustments (see OnEntering/OnExiting).
|
||||
public override bool AllowRateAdjustments => false;
|
||||
|
||||
private readonly Bindable<bool> samplePlaybackDisabled = new Bindable<bool>();
|
||||
|
||||
/// <summary>
|
||||
/// Whether gameplay should pause when the game window focus is lost.
|
||||
/// </summary>
|
||||
@ -229,7 +232,11 @@ namespace osu.Game.Screens.Play
|
||||
skipOverlay.Hide();
|
||||
}
|
||||
|
||||
DrawableRuleset.IsPaused.BindValueChanged(_ => updateGameplayState());
|
||||
DrawableRuleset.IsPaused.BindValueChanged(paused =>
|
||||
{
|
||||
updateGameplayState();
|
||||
samplePlaybackDisabled.Value = paused.NewValue;
|
||||
});
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateGameplayState());
|
||||
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
||||
@ -752,5 +759,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
IBindable<bool> ISamplePlaybackDisabler.SamplePlaybackDisabled => samplePlaybackDisabled;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user