mirror of
https://github.com/ppy/osu.git
synced 2025-01-21 06:42: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,
|
Precision = 0.1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public readonly Bindable<bool> AllowControls = new BindableBool(true);
|
||||||
|
|
||||||
private readonly PlayerSliderBar<double> rateSlider;
|
private readonly PlayerSliderBar<double> rateSlider;
|
||||||
|
|
||||||
private readonly OsuSpriteText multiplierText;
|
private readonly OsuSpriteText multiplierText;
|
||||||
@ -71,6 +73,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Icon = FontAwesome.Solid.FastBackward,
|
Icon = FontAwesome.Solid.FastBackward,
|
||||||
Action = () => seek(-1, seek_fast_amount),
|
Action = () => seek(-1, seek_fast_amount),
|
||||||
|
Enabled = { BindTarget = AllowControls },
|
||||||
},
|
},
|
||||||
new SeekButton
|
new SeekButton
|
||||||
{
|
{
|
||||||
@ -78,6 +81,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Icon = FontAwesome.Solid.Backward,
|
Icon = FontAwesome.Solid.Backward,
|
||||||
Action = () => seek(-1, seek_amount),
|
Action = () => seek(-1, seek_amount),
|
||||||
|
Enabled = { BindTarget = AllowControls },
|
||||||
},
|
},
|
||||||
play = new IconButton
|
play = new IconButton
|
||||||
{
|
{
|
||||||
@ -95,7 +99,8 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
else
|
else
|
||||||
gameplayClock.Start();
|
gameplayClock.Start();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
Enabled = { BindTarget = AllowControls },
|
||||||
},
|
},
|
||||||
new SeekButton
|
new SeekButton
|
||||||
{
|
{
|
||||||
@ -103,6 +108,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Icon = FontAwesome.Solid.Forward,
|
Icon = FontAwesome.Solid.Forward,
|
||||||
Action = () => seek(1, seek_amount),
|
Action = () => seek(1, seek_amount),
|
||||||
|
Enabled = { BindTarget = AllowControls },
|
||||||
},
|
},
|
||||||
new SeekButton
|
new SeekButton
|
||||||
{
|
{
|
||||||
@ -110,6 +116,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Icon = FontAwesome.Solid.FastForward,
|
Icon = FontAwesome.Solid.FastForward,
|
||||||
Action = () => seek(1, seek_fast_amount),
|
Action = () => seek(1, seek_fast_amount),
|
||||||
|
Enabled = { BindTarget = AllowControls },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -150,7 +157,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
rateSlider.Current.BindValueChanged(multiplier => multiplierText.Text = $"{multiplier.NewValue:0.0}x", true);
|
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
|
private partial class SeekButton : IconButton
|
||||||
|
@ -68,6 +68,8 @@ namespace osu.Game.Screens.Play
|
|||||||
master.UserPlaybackRate.Value = 1;
|
master.UserPlaybackRate.Value = 1;
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
HUDOverlay.PlayerSettingsOverlay.PlaybackSettings.AllowControls.Value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user