mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Use PlayerConfiguration
to convey no-seek state
This commit is contained in:
@ -25,7 +25,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
|||||||
/// <param name="score">The score containing the player's replay.</param>
|
/// <param name="score">The score containing the player's replay.</param>
|
||||||
/// <param name="spectatorPlayerClock">The clock controlling the gameplay running state.</param>
|
/// <param name="spectatorPlayerClock">The clock controlling the gameplay running state.</param>
|
||||||
public MultiSpectatorPlayer([NotNull] Score score, [NotNull] ISpectatorPlayerClock spectatorPlayerClock)
|
public MultiSpectatorPlayer([NotNull] Score score, [NotNull] ISpectatorPlayerClock spectatorPlayerClock)
|
||||||
: base(score)
|
: base(score, new PlayerConfiguration { AllowSeeking = false })
|
||||||
{
|
{
|
||||||
this.spectatorPlayerClock = spectatorPlayerClock;
|
this.spectatorPlayerClock = spectatorPlayerClock;
|
||||||
}
|
}
|
||||||
@ -35,8 +35,6 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Spectate
|
|||||||
{
|
{
|
||||||
spectatorPlayerClock.WaitingOnFrames.BindTo(waitingOnFrames);
|
spectatorPlayerClock.WaitingOnFrames.BindTo(waitingOnFrames);
|
||||||
|
|
||||||
AllowUserSeekingState.Value = false;
|
|
||||||
AllowUserSeekingState.Disabled = true;
|
|
||||||
HUDOverlay.PlayerSettingsOverlay.Expire();
|
HUDOverlay.PlayerSettingsOverlay.Expire();
|
||||||
HUDOverlay.HoldToQuit.Expire();
|
HUDOverlay.HoldToQuit.Expire();
|
||||||
}
|
}
|
||||||
|
@ -77,9 +77,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected readonly Bindable<bool> LocalUserPlaying = new Bindable<bool>();
|
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;
|
public int RestartCount;
|
||||||
|
|
||||||
@ -275,8 +275,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(r =>
|
DrawableRuleset.HasReplayLoaded.BindValueChanged(r =>
|
||||||
{
|
{
|
||||||
if (!AllowUserSeekingState.Disabled)
|
if (Configuration.AllowSeeking)
|
||||||
AllowUserSeekingState.Value = r.NewValue;
|
allowUserSeeking.Value = r.NewValue;
|
||||||
|
|
||||||
updateGameplayState();
|
updateGameplayState();
|
||||||
});
|
});
|
||||||
|
@ -20,6 +20,11 @@ namespace osu.Game.Screens.Play
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool AllowRestart { get; set; } = true;
|
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>
|
/// <summary>
|
||||||
/// Whether the player should be allowed to skip intros/outros, advancing to the start of gameplay or the end of a storyboard.
|
/// Whether the player should be allowed to skip intros/outros, advancing to the start of gameplay or the end of a storyboard.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -23,7 +23,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
protected override bool CheckModsAllowFailure() => false; // todo: better support starting mid-way through beatmap
|
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;
|
this.score = score;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user