mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 13:33:03 +08:00
Merge branch 'master' into add-match-start-sound
This commit is contained in:
commit
49103a4421
@ -355,7 +355,11 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
protected override bool PauseOnFocusLost => false;
|
||||
|
||||
public ScoreAccessibleReplayPlayer(Score score)
|
||||
: base(score, false, false)
|
||||
: base(score, new PlayerConfiguration
|
||||
{
|
||||
AllowPause = false,
|
||||
ShowResults = false,
|
||||
})
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -176,7 +176,11 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
protected override bool PauseOnFocusLost => false;
|
||||
|
||||
public ScoreAccessibleReplayPlayer(Score score)
|
||||
: base(score, false, false)
|
||||
: base(score, new PlayerConfiguration
|
||||
{
|
||||
AllowPause = false,
|
||||
ShowResults = false,
|
||||
})
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,11 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
private readonly bool userHasCustomColours;
|
||||
|
||||
public ExposedPlayer(bool userHasCustomColours)
|
||||
: base(false, false)
|
||||
: base(new PlayerConfiguration
|
||||
{
|
||||
AllowPause = false,
|
||||
ShowResults = false,
|
||||
})
|
||||
{
|
||||
this.userHasCustomColours = userHasCustomColours;
|
||||
}
|
||||
|
@ -439,7 +439,11 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
protected override bool PauseOnFocusLost => false;
|
||||
|
||||
public ScoreAccessibleReplayPlayer(Score score)
|
||||
: base(score, false, false)
|
||||
: base(score, new PlayerConfiguration
|
||||
{
|
||||
AllowPause = false,
|
||||
ShowResults = false,
|
||||
})
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -378,7 +378,11 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
protected override bool PauseOnFocusLost => false;
|
||||
|
||||
public ScoreAccessibleReplayPlayer(Score score)
|
||||
: base(score, false, false)
|
||||
: base(score, new PlayerConfiguration
|
||||
{
|
||||
AllowPause = false,
|
||||
ShowResults = false,
|
||||
})
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,11 @@ namespace osu.Game.Online.Spectator
|
||||
[Serializable]
|
||||
public class FrameHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// The current accuracy of the score.
|
||||
/// </summary>
|
||||
public double Accuracy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The current combo of the score.
|
||||
/// </summary>
|
||||
@ -42,16 +47,18 @@ namespace osu.Game.Online.Spectator
|
||||
{
|
||||
Combo = score.Combo;
|
||||
MaxCombo = score.MaxCombo;
|
||||
Accuracy = score.Accuracy;
|
||||
|
||||
// copy for safety
|
||||
Statistics = new Dictionary<HitResult, int>(score.Statistics);
|
||||
}
|
||||
|
||||
[JsonConstructor]
|
||||
public FrameHeader(int combo, int maxCombo, Dictionary<HitResult, int> statistics, DateTimeOffset receivedTime)
|
||||
public FrameHeader(int combo, int maxCombo, double accuracy, Dictionary<HitResult, int> statistics, DateTimeOffset receivedTime)
|
||||
{
|
||||
Combo = combo;
|
||||
MaxCombo = maxCombo;
|
||||
Accuracy = accuracy;
|
||||
Statistics = statistics;
|
||||
ReceivedTime = receivedTime;
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
private void updateScore()
|
||||
{
|
||||
if (rollingMaxBaseScore != 0)
|
||||
Accuracy.Value = baseScore / rollingMaxBaseScore;
|
||||
Accuracy.Value = calculateAccuracyRatio(baseScore, true);
|
||||
|
||||
TotalScore.Value = getScore(Mode.Value);
|
||||
}
|
||||
@ -233,13 +233,13 @@ namespace osu.Game.Rulesets.Scoring
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a minimal set of inputs, return the computed score and accuracy for the tracked beatmap / mods combination, at the current point in time.
|
||||
/// Given a minimal set of inputs, return the computed score for the tracked beatmap / mods combination, at the current point in time.
|
||||
/// </summary>
|
||||
/// <param name="mode">The <see cref="ScoringMode"/> to compute the total score in.</param>
|
||||
/// <param name="maxCombo">The maximum combo achievable in the beatmap.</param>
|
||||
/// <param name="statistics">Statistics to be used for calculating accuracy, bonus score, etc.</param>
|
||||
/// <returns>The computed score and accuracy for provided inputs.</returns>
|
||||
public (double score, double accuracy) GetScoreAndAccuracy(ScoringMode mode, int maxCombo, Dictionary<HitResult, int> statistics)
|
||||
/// <returns>The computed score for provided inputs.</returns>
|
||||
public double GetImmediateScore(ScoringMode mode, int maxCombo, Dictionary<HitResult, int> statistics)
|
||||
{
|
||||
// calculate base score from statistics pairs
|
||||
int computedBaseScore = 0;
|
||||
@ -252,12 +252,7 @@ namespace osu.Game.Rulesets.Scoring
|
||||
computedBaseScore += Judgement.ToNumericResult(pair.Key) * pair.Value;
|
||||
}
|
||||
|
||||
double pointInTimeAccuracy = calculateAccuracyRatio(computedBaseScore, true);
|
||||
double comboRatio = calculateComboRatio(maxCombo);
|
||||
|
||||
double score = GetScore(mode, maxAchievableCombo, calculateAccuracyRatio(computedBaseScore), comboRatio, scoreResultCounts);
|
||||
|
||||
return (score, pointInTimeAccuracy);
|
||||
return GetScore(mode, maxAchievableCombo, calculateAccuracyRatio(computedBaseScore), calculateComboRatio(maxCombo), scoreResultCounts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -37,8 +37,8 @@ namespace osu.Game.Screens.Multi.Play
|
||||
[Resolved]
|
||||
private IBindable<RulesetInfo> ruleset { get; set; }
|
||||
|
||||
public TimeshiftPlayer(PlaylistItem playlistItem, bool allowPause = true)
|
||||
: base(allowPause)
|
||||
public TimeshiftPlayer(PlaylistItem playlistItem, PlayerConfiguration configuration = null)
|
||||
: base(configuration)
|
||||
{
|
||||
PlaylistItem = playlistItem;
|
||||
}
|
||||
|
@ -3,16 +3,17 @@
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.Multiplayer;
|
||||
using osu.Game.Online.RealtimeMultiplayer;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Multi.Play;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Screens.Ranking;
|
||||
using osuTK;
|
||||
@ -33,20 +34,25 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
private IBindable<bool> isConnected;
|
||||
|
||||
private readonly TaskCompletionSource<bool> resultsReady = new TaskCompletionSource<bool>();
|
||||
private readonly ManualResetEventSlim startedEvent = new ManualResetEventSlim();
|
||||
|
||||
[CanBeNull]
|
||||
private MultiplayerGameplayLeaderboard leaderboard;
|
||||
|
||||
private readonly int[] userIds;
|
||||
|
||||
private LoadingLayer loadingDisplay;
|
||||
|
||||
/// <summary>
|
||||
/// Construct a multiplayer player.
|
||||
/// </summary>
|
||||
/// <param name="playlistItem">The playlist item to be played.</param>
|
||||
/// <param name="userIds">The users which are participating in this game.</param>
|
||||
public RealtimePlayer(PlaylistItem playlistItem, int[] userIds)
|
||||
: base(playlistItem, false)
|
||||
: base(playlistItem, new PlayerConfiguration
|
||||
{
|
||||
AllowPause = false,
|
||||
AllowRestart = false,
|
||||
})
|
||||
{
|
||||
this.userIds = userIds;
|
||||
}
|
||||
@ -60,6 +66,12 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
client.MatchStarted += onMatchStarted;
|
||||
client.ResultsReady += onResultsReady;
|
||||
|
||||
ScoreProcessor.HasCompleted.BindValueChanged(completed =>
|
||||
{
|
||||
// wait for server to tell us that results are ready (see SubmitScore implementation)
|
||||
loadingDisplay.Show();
|
||||
});
|
||||
|
||||
isConnected = client.IsConnected.GetBoundCopy();
|
||||
isConnected.BindValueChanged(connected =>
|
||||
{
|
||||
@ -70,19 +82,20 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
}
|
||||
}, true);
|
||||
|
||||
client.ChangeState(MultiplayerUserState.Loaded)
|
||||
.ContinueWith(task => failAndBail(task.Exception?.Message ?? "Server error"), TaskContinuationOptions.NotOnRanToCompletion);
|
||||
|
||||
if (!startedEvent.Wait(TimeSpan.FromSeconds(30)))
|
||||
{
|
||||
failAndBail("Failed to start the multiplayer match in time.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Assert(client.Room != null);
|
||||
|
||||
// todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
|
||||
LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);
|
||||
|
||||
HUDOverlay.Add(loadingDisplay = new LoadingLayer(DrawableRuleset) { Depth = float.MaxValue });
|
||||
}
|
||||
|
||||
protected override void StartGameplay()
|
||||
{
|
||||
// block base call, but let the server know we are ready to start.
|
||||
loadingDisplay.Show();
|
||||
|
||||
client.ChangeState(MultiplayerUserState.Loaded).ContinueWith(task => failAndBail(task.Exception?.Message ?? "Server error"), TaskContinuationOptions.NotOnRanToCompletion);
|
||||
}
|
||||
|
||||
private void failAndBail(string message = null)
|
||||
@ -90,7 +103,6 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
if (!string.IsNullOrEmpty(message))
|
||||
Logger.Log(message, LoggingTarget.Runtime, LogLevel.Important);
|
||||
|
||||
startedEvent.Set();
|
||||
Schedule(() => PerformExit(false));
|
||||
}
|
||||
|
||||
@ -112,7 +124,11 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
padding + HUDOverlay.TopScoringElementsHeight);
|
||||
}
|
||||
|
||||
private void onMatchStarted() => startedEvent.Set();
|
||||
private void onMatchStarted() => Scheduler.Add(() =>
|
||||
{
|
||||
loadingDisplay.Hide();
|
||||
base.StartGameplay();
|
||||
});
|
||||
|
||||
private void onResultsReady() => resultsReady.SetResult(true);
|
||||
|
||||
@ -122,9 +138,9 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
|
||||
|
||||
await client.ChangeState(MultiplayerUserState.FinishedPlay);
|
||||
|
||||
// Await up to 30 seconds for results to become available (3 api request timeouts).
|
||||
// Await up to 60 seconds for results to become available (6 api request timeouts).
|
||||
// This is arbitrary just to not leave the player in an essentially deadlocked state if any connection issues occur.
|
||||
await Task.WhenAny(resultsReady.Task, Task.Delay(TimeSpan.FromSeconds(30)));
|
||||
await Task.WhenAny(resultsReady.Task, Task.Delay(TimeSpan.FromSeconds(60)));
|
||||
}
|
||||
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score)
|
||||
|
@ -122,8 +122,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
if (LastHeader == null)
|
||||
return;
|
||||
|
||||
(score.Value, accuracy.Value) = processor.GetScoreAndAccuracy(mode, LastHeader.MaxCombo, LastHeader.Statistics);
|
||||
|
||||
score.Value = processor.GetImmediateScore(mode, LastHeader.MaxCombo, LastHeader.Statistics);
|
||||
accuracy.Value = LastHeader.Accuracy;
|
||||
currentCombo.Value = LastHeader.Combo;
|
||||
}
|
||||
}
|
||||
|
@ -128,18 +128,14 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
protected virtual bool CheckModsAllowFailure() => Mods.Value.OfType<IApplicableFailOverride>().All(m => m.PerformFail());
|
||||
|
||||
private readonly bool allowPause;
|
||||
private readonly bool showResults;
|
||||
public readonly PlayerConfiguration Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new player instance.
|
||||
/// </summary>
|
||||
/// <param name="allowPause">Whether pausing should be allowed. If not allowed, attempting to pause will quit.</param>
|
||||
/// <param name="showResults">Whether results screen should be pushed on completion.</param>
|
||||
public Player(bool allowPause = true, bool showResults = true)
|
||||
public Player(PlayerConfiguration configuration = null)
|
||||
{
|
||||
this.allowPause = allowPause;
|
||||
this.showResults = showResults;
|
||||
Configuration = configuration ?? new PlayerConfiguration();
|
||||
}
|
||||
|
||||
private GameplayBeatmap gameplayBeatmap;
|
||||
@ -317,59 +313,77 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
};
|
||||
|
||||
private Drawable createOverlayComponents(WorkingBeatmap working) => new Container
|
||||
private Drawable createOverlayComponents(WorkingBeatmap working)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new[]
|
||||
var container = new Container
|
||||
{
|
||||
DimmableStoryboard.OverlayLayerContainer.CreateProxy(),
|
||||
BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new[]
|
||||
{
|
||||
Clock = DrawableRuleset.FrameStableClock,
|
||||
ProcessCustomClock = false,
|
||||
Breaks = working.Beatmap.Breaks
|
||||
},
|
||||
// display the cursor above some HUD elements.
|
||||
DrawableRuleset.Cursor?.CreateProxy() ?? new Container(),
|
||||
DrawableRuleset.ResumeOverlay?.CreateProxy() ?? new Container(),
|
||||
HUDOverlay = new HUDOverlay(ScoreProcessor, HealthProcessor, DrawableRuleset, Mods.Value)
|
||||
{
|
||||
HoldToQuit =
|
||||
DimmableStoryboard.OverlayLayerContainer.CreateProxy(),
|
||||
BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
|
||||
{
|
||||
Action = performUserRequestedExit,
|
||||
IsPaused = { BindTarget = GameplayClockContainer.IsPaused }
|
||||
Clock = DrawableRuleset.FrameStableClock,
|
||||
ProcessCustomClock = false,
|
||||
Breaks = working.Beatmap.Breaks
|
||||
},
|
||||
PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } },
|
||||
KeyCounter =
|
||||
// display the cursor above some HUD elements.
|
||||
DrawableRuleset.Cursor?.CreateProxy() ?? new Container(),
|
||||
DrawableRuleset.ResumeOverlay?.CreateProxy() ?? new Container(),
|
||||
HUDOverlay = new HUDOverlay(ScoreProcessor, HealthProcessor, DrawableRuleset, Mods.Value)
|
||||
{
|
||||
AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded },
|
||||
IsCounting = false
|
||||
HoldToQuit =
|
||||
{
|
||||
Action = performUserRequestedExit,
|
||||
IsPaused = { BindTarget = GameplayClockContainer.IsPaused }
|
||||
},
|
||||
PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } },
|
||||
KeyCounter =
|
||||
{
|
||||
AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded },
|
||||
IsCounting = false
|
||||
},
|
||||
RequestSeek = time =>
|
||||
{
|
||||
GameplayClockContainer.Seek(time);
|
||||
GameplayClockContainer.Start();
|
||||
},
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
},
|
||||
RequestSeek = time =>
|
||||
skipOverlay = new SkipOverlay(DrawableRuleset.GameplayStartTime)
|
||||
{
|
||||
GameplayClockContainer.Seek(time);
|
||||
GameplayClockContainer.Start();
|
||||
RequestSkip = GameplayClockContainer.Skip
|
||||
},
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre
|
||||
},
|
||||
skipOverlay = new SkipOverlay(DrawableRuleset.GameplayStartTime)
|
||||
{
|
||||
RequestSkip = GameplayClockContainer.Skip
|
||||
},
|
||||
FailOverlay = new FailOverlay
|
||||
{
|
||||
OnRetry = Restart,
|
||||
OnQuit = performUserRequestedExit,
|
||||
},
|
||||
PauseOverlay = new PauseOverlay
|
||||
{
|
||||
OnResume = Resume,
|
||||
Retries = RestartCount,
|
||||
OnRetry = Restart,
|
||||
OnQuit = performUserRequestedExit,
|
||||
},
|
||||
new HotkeyRetryOverlay
|
||||
FailOverlay = new FailOverlay
|
||||
{
|
||||
OnRetry = Restart,
|
||||
OnQuit = performUserRequestedExit,
|
||||
},
|
||||
PauseOverlay = new PauseOverlay
|
||||
{
|
||||
OnResume = Resume,
|
||||
Retries = RestartCount,
|
||||
OnRetry = Restart,
|
||||
OnQuit = performUserRequestedExit,
|
||||
},
|
||||
new HotkeyExitOverlay
|
||||
{
|
||||
Action = () =>
|
||||
{
|
||||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
fadeOut(true);
|
||||
PerformExit(true);
|
||||
},
|
||||
},
|
||||
failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, },
|
||||
}
|
||||
};
|
||||
|
||||
if (Configuration.AllowRestart)
|
||||
{
|
||||
container.Add(new HotkeyRetryOverlay
|
||||
{
|
||||
Action = () =>
|
||||
{
|
||||
@ -378,20 +392,11 @@ namespace osu.Game.Screens.Play
|
||||
fadeOut(true);
|
||||
Restart();
|
||||
},
|
||||
},
|
||||
new HotkeyExitOverlay
|
||||
{
|
||||
Action = () =>
|
||||
{
|
||||
if (!this.IsCurrentScreen()) return;
|
||||
|
||||
fadeOut(true);
|
||||
PerformExit(true);
|
||||
},
|
||||
},
|
||||
failAnimation = new FailAnimation(DrawableRuleset) { OnComplete = onFailComplete, },
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime)
|
||||
{
|
||||
@ -500,6 +505,9 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public void Restart()
|
||||
{
|
||||
if (!Configuration.AllowRestart)
|
||||
return;
|
||||
|
||||
// at the point of restarting the track should either already be paused or the volume should be zero.
|
||||
// stopping here is to ensure music doesn't become audible after exiting back to PlayerLoader.
|
||||
musicController.Stop();
|
||||
@ -539,7 +547,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
ValidForResume = false;
|
||||
|
||||
if (!showResults) return;
|
||||
if (!Configuration.ShowResults) return;
|
||||
|
||||
scoreSubmissionTask ??= Task.Run(async () =>
|
||||
{
|
||||
@ -638,7 +646,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private bool canPause =>
|
||||
// must pass basic screen conditions (beatmap loaded, instance allows pause)
|
||||
LoadedBeatmapSuccessfully && allowPause && ValidForResume
|
||||
LoadedBeatmapSuccessfully && Configuration.AllowPause && ValidForResume
|
||||
// replays cannot be paused and exit immediately
|
||||
&& !DrawableRuleset.HasReplayLoaded.Value
|
||||
// cannot pause if we are already in a fail state
|
||||
@ -723,9 +731,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
storyboardReplacesBackground.Value = Beatmap.Value.Storyboard.ReplacesBackground && Beatmap.Value.Storyboard.HasDrawable;
|
||||
|
||||
GameplayClockContainer.Restart();
|
||||
GameplayClockContainer.FadeInFromZero(750, Easing.OutQuint);
|
||||
|
||||
foreach (var mod in Mods.Value.OfType<IApplicableToPlayer>())
|
||||
mod.ApplyToPlayer(this);
|
||||
|
||||
@ -740,6 +745,21 @@ namespace osu.Game.Screens.Play
|
||||
mod.ApplyToTrack(musicController.CurrentTrack);
|
||||
|
||||
updateGameplayState();
|
||||
|
||||
GameplayClockContainer.FadeInFromZero(750, Easing.OutQuint);
|
||||
StartGameplay();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called to trigger the starting of the gameplay clock and underlying gameplay.
|
||||
/// This will be called on entering the player screen once. A derived class may block the first call to this to delay the start of gameplay.
|
||||
/// </summary>
|
||||
protected virtual void StartGameplay()
|
||||
{
|
||||
if (GameplayClockContainer.GameplayClock.IsRunning)
|
||||
throw new InvalidOperationException($"{nameof(StartGameplay)} should not be called when the gameplay clock is already running");
|
||||
|
||||
GameplayClockContainer.Restart();
|
||||
}
|
||||
|
||||
public override void OnSuspending(IScreen next)
|
||||
|
23
osu.Game/Screens/Play/PlayerConfiguration.cs
Normal file
23
osu.Game/Screens/Play/PlayerConfiguration.cs
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class PlayerConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether pausing should be allowed. If not allowed, attempting to pause will quit.
|
||||
/// </summary>
|
||||
public bool AllowPause { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether results screen should be pushed on completion.
|
||||
/// </summary>
|
||||
public bool ShowResults { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the player should be allowed to trigger a restart.
|
||||
/// </summary>
|
||||
public bool AllowRestart { get; set; } = true;
|
||||
}
|
||||
}
|
@ -16,8 +16,8 @@ namespace osu.Game.Screens.Play
|
||||
// Disallow replays from failing. (see https://github.com/ppy/osu/issues/6108)
|
||||
protected override bool CheckModsAllowFailure() => false;
|
||||
|
||||
public ReplayPlayer(Score score, bool allowPause = true, bool showResults = true)
|
||||
: base(allowPause, showResults)
|
||||
public ReplayPlayer(Score score, PlayerConfiguration configuration = null)
|
||||
: base(configuration)
|
||||
{
|
||||
Score = score;
|
||||
}
|
||||
|
@ -37,7 +37,11 @@ namespace osu.Game.Tests.Visual
|
||||
public readonly List<JudgementResult> Results = new List<JudgementResult>();
|
||||
|
||||
public TestPlayer(bool allowPause = true, bool showResults = true, bool pauseOnFocusLost = false)
|
||||
: base(allowPause, showResults)
|
||||
: base(new PlayerConfiguration
|
||||
{
|
||||
AllowPause = allowPause,
|
||||
ShowResults = showResults
|
||||
})
|
||||
{
|
||||
PauseOnFocusLost = pauseOnFocusLost;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user