mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Detach gameplay score from replay recorder before importing
Closes #13320.
This commit is contained in:
@ -267,6 +267,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
if (!(KeyBindingInputManager is IHasRecordingHandler recordingInputManager))
|
if (!(KeyBindingInputManager is IHasRecordingHandler recordingInputManager))
|
||||||
throw new InvalidOperationException($"A {nameof(KeyBindingInputManager)} which supports recording is not available");
|
throw new InvalidOperationException($"A {nameof(KeyBindingInputManager)} which supports recording is not available");
|
||||||
|
|
||||||
|
if (score == null)
|
||||||
|
{
|
||||||
|
recordingInputManager.Recorder = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var recorder = CreateReplayRecorder(score);
|
var recorder = CreateReplayRecorder(score);
|
||||||
|
|
||||||
if (recorder == null)
|
if (recorder == null)
|
||||||
@ -511,7 +517,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// Sets a replay to be used to record gameplay.
|
/// Sets a replay to be used to record gameplay.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="score">The target to be recorded to.</param>
|
/// <param name="score">The target to be recorded to.</param>
|
||||||
public abstract void SetRecordTarget(Score score);
|
public abstract void SetRecordTarget([CanBeNull] Score score);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked when the interactive user requests resuming from a paused state.
|
/// Invoked when the interactive user requests resuming from a paused state.
|
||||||
|
@ -30,11 +30,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (recorder != null)
|
if (value != null && recorder != null)
|
||||||
throw new InvalidOperationException("Cannot attach more than one recorder");
|
throw new InvalidOperationException("Cannot attach more than one recorder");
|
||||||
|
|
||||||
|
recorder?.Expire();
|
||||||
recorder = value;
|
recorder = value;
|
||||||
|
|
||||||
|
if (recorder != null)
|
||||||
KeyBindingContainer.Add(recorder);
|
KeyBindingContainer.Add(recorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -636,6 +636,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
ValidForResume = false;
|
ValidForResume = false;
|
||||||
|
|
||||||
|
// ensure we are not writing to the replay any more, as we are about to consume and store the score.
|
||||||
|
DrawableRuleset.SetRecordTarget(null);
|
||||||
|
|
||||||
if (!Configuration.ShowResults) return;
|
if (!Configuration.ShowResults) return;
|
||||||
|
|
||||||
prepareScoreForDisplayTask ??= Task.Run(async () =>
|
prepareScoreForDisplayTask ??= Task.Run(async () =>
|
||||||
|
Reference in New Issue
Block a user