1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 09:02:55 +08:00

Use PlayerConfiguration to convey no-seek state

This commit is contained in:
Dean Herbert 2021-08-16 16:16:02 +09:00
parent 53c3eccfb5
commit 81480ac4fc
4 changed files with 12 additions and 8 deletions

View File

@ -25,7 +25,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
/// <param name="score">The score containing the player's replay.</param>
/// <param name="spectatorPlayerClock">The clock controlling the gameplay running state.</param>
public MultiSpectatorPlayer([NotNull] Score score, [NotNull] ISpectatorPlayerClock spectatorPlayerClock)
: base(score)
: base(score, new PlayerConfiguration { AllowSeeking = false })
{
this.spectatorPlayerClock = spectatorPlayerClock;
}
@ -35,8 +35,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
{
spectatorPlayerClock.WaitingOnFrames.BindTo(waitingOnFrames);
AllowUserSeekingState.Value = false;
AllowUserSeekingState.Disabled = true;
HUDOverlay.PlayerSettingsOverlay.Expire();
HUDOverlay.HoldToQuit.Expire();
}

View File

@ -77,9 +77,9 @@ namespace osu.Game.Screens.Play
protected readonly Bindable<bool> LocalUserPlaying = new Bindable<bool>();
protected readonly Bindable<bool> AllowUserSeekingState = new Bindable<bool>();
private readonly Bindable<bool> allowUserSeeking = new Bindable<bool>();
public IBindable<bool> AllowUserSeeking => AllowUserSeekingState;
public IBindable<bool> AllowUserSeeking => allowUserSeeking;
public int RestartCount;
@ -275,8 +275,8 @@ namespace osu.Game.Screens.Play
DrawableRuleset.HasReplayLoaded.BindValueChanged(r =>
{
if (!AllowUserSeekingState.Disabled)
AllowUserSeekingState.Value = r.NewValue;
if (Configuration.AllowSeeking)
allowUserSeeking.Value = r.NewValue;
updateGameplayState();
});

View File

@ -20,6 +20,11 @@ namespace osu.Game.Screens.Play
/// </summary>
public bool AllowRestart { get; set; } = true;
/// <summary>
/// Whether the player should be allowed to seek in a displayed replay.
/// </summary>
public bool AllowSeeking { get; set; } = true;
/// <summary>
/// Whether the player should be allowed to skip intros/outros, advancing to the start of gameplay or the end of a storyboard.
/// </summary>

View File

@ -23,7 +23,8 @@ namespace osu.Game.Screens.Play
protected override bool CheckModsAllowFailure() => false; // todo: better support starting mid-way through beatmap
public SpectatorPlayer(Score score)
public SpectatorPlayer(Score score, PlayerConfiguration configuration = null)
: base(configuration)
{
this.score = score;
}