Implement in player

This commit is contained in:
Dean Herbert
2020-03-23 19:31:43 +09:00
parent 14a85a84bf
commit 617149fb27
4 changed files with 42 additions and 3 deletions

View File

@ -262,6 +262,17 @@ namespace osu.Game.Rulesets.UI
Playfield.Add(drawableObject);
}
public override void SetRecordTarget(Replay recordingReplay)
{
if (!(KeyBindingInputManager is IHasRecordingHandler recordingInputHandler))
throw new InvalidOperationException($"A {nameof(KeyBindingInputManager)} which supports recording is not available");
var recorder = CreateReplayRecorder(recordingReplay);
recorder.ScreenSpaceToGamefield = Playfield.ScreenSpaceToGamefield;
recordingInputHandler.Recorder = recorder;
}
public override void SetReplayScore(Score replayScore)
{
if (!(KeyBindingInputManager is IHasReplayHandler replayInputManager))
@ -472,6 +483,12 @@ namespace osu.Game.Rulesets.UI
/// <param name="replayScore">The replay, null for local input.</param>
public abstract void SetReplayScore(Score replayScore);
/// <summary>
/// Sets a replay to be used to record gameplay.
/// </summary>
/// <param name="recordingReplay">The target to be recorded to.</param>
public abstract void SetRecordTarget(Replay recordingReplay);
/// <summary>
/// Invoked when the interactive user requests resuming from a paused state.
/// Allows potentially delaying the resume process until an interaction is performed.