mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:52:54 +08:00
Fix binding order of IsPaused
bindable and disable playback controls in spectator mode.
This commit is contained in:
parent
c081ca2145
commit
484e9e8ee6
@ -27,6 +27,8 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
Precision = 0.1,
|
||||
};
|
||||
|
||||
public readonly Bindable<bool> AllowControls = new BindableBool(true);
|
||||
|
||||
private readonly PlayerSliderBar<double> rateSlider;
|
||||
|
||||
private readonly OsuSpriteText multiplierText;
|
||||
@ -71,6 +73,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.Solid.FastBackward,
|
||||
Action = () => seek(-1, seek_fast_amount),
|
||||
Enabled = { BindTarget = AllowControls },
|
||||
},
|
||||
new SeekButton
|
||||
{
|
||||
@ -78,6 +81,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.Solid.Backward,
|
||||
Action = () => seek(-1, seek_amount),
|
||||
Enabled = { BindTarget = AllowControls },
|
||||
},
|
||||
play = new IconButton
|
||||
{
|
||||
@ -95,7 +99,8 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
else
|
||||
gameplayClock.Start();
|
||||
}
|
||||
}
|
||||
},
|
||||
Enabled = { BindTarget = AllowControls },
|
||||
},
|
||||
new SeekButton
|
||||
{
|
||||
@ -103,6 +108,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.Solid.Forward,
|
||||
Action = () => seek(1, seek_amount),
|
||||
Enabled = { BindTarget = AllowControls },
|
||||
},
|
||||
new SeekButton
|
||||
{
|
||||
@ -110,6 +116,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
Origin = Anchor.Centre,
|
||||
Icon = FontAwesome.Solid.FastForward,
|
||||
Action = () => seek(1, seek_fast_amount),
|
||||
Enabled = { BindTarget = AllowControls },
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -150,7 +157,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
||||
{
|
||||
base.LoadComplete();
|
||||
rateSlider.Current.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier.NewValue:0.0}x", true);
|
||||
gameplayClock?.IsPaused.BindTo(isPaused);
|
||||
|
||||
if (gameplayClock != null)
|
||||
isPaused.BindTarget = gameplayClock.IsPaused;
|
||||
}
|
||||
|
||||
private partial class SeekButton : IconButton
|
||||
|
@ -68,6 +68,8 @@ namespace osu.Game.Screens.Play
|
||||
master.UserPlaybackRate.Value = 1;
|
||||
}
|
||||
}, true);
|
||||
|
||||
HUDOverlay.PlayerSettingsOverlay.PlaybackSettings.AllowControls.Value = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user