Add nullref safety to FrameStablePlayback boolean (#5834)

Add nullref safety to FrameStablePlayback boolean
This commit is contained in:
Dean Herbert 2019-08-26 18:58:27 +09:00 committed by GitHub
commit b41bed8ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,13 +62,20 @@ namespace osu.Game.Rulesets.UI
public override GameplayClock FrameStableClock => frameStabilityContainer.GameplayClock;
private bool frameStablePlayback = true;
/// <summary>
/// Whether to enable frame-stable playback.
/// </summary>
internal bool FrameStablePlayback
{
get => frameStabilityContainer.FrameStablePlayback;
set => frameStabilityContainer.FrameStablePlayback = value;
get => frameStablePlayback;
set
{
frameStablePlayback = false;
if (frameStabilityContainer != null)
frameStabilityContainer.FrameStablePlayback = value;
}
}
/// <summary>
@ -156,6 +163,7 @@ namespace osu.Game.Rulesets.UI
{
frameStabilityContainer = new FrameStabilityContainer(GameplayStartTime)
{
FrameStablePlayback = FrameStablePlayback,
Child = KeyBindingInputManager
.WithChild(CreatePlayfieldAdjustmentContainer()
.WithChild(Playfield)