mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +08:00
Restore clipboard content after difficulty switch
This commit is contained in:
parent
79d0f4835e
commit
35ee889e5b
@ -744,13 +744,16 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleDifficultySwitch(nextBeatmap, new EditorState
|
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleDifficultySwitch(nextBeatmap, new EditorState
|
||||||
{
|
{
|
||||||
Time = clock.CurrentTimeAccurate
|
Time = clock.CurrentTimeAccurate,
|
||||||
|
ClipboardContent = editorBeatmap.BeatmapInfo.RulesetID == nextBeatmap.RulesetID ? clipboard.Value : null
|
||||||
});
|
});
|
||||||
|
|
||||||
private void restoreState([NotNull] EditorState state)
|
private void restoreState([NotNull] EditorState state)
|
||||||
{
|
{
|
||||||
if (state.Time != null)
|
if (state.Time != null)
|
||||||
clock.Seek(state.Time.Value);
|
clock.Seek(state.Time.Value);
|
||||||
|
|
||||||
|
clipboard.Value = state.ClipboardContent ?? clipboard.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void cancelExit() => loader?.CancelPendingDifficultySwitch();
|
private void cancelExit() => loader?.CancelPendingDifficultySwitch();
|
||||||
|
@ -15,5 +15,10 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// The current clock time when a difficulty switch was requested.
|
/// The current clock time when a difficulty switch was requested.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double? Time { get; set; }
|
public double? Time { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current editor clipboard content at the time when a difficulty switch was requested.
|
||||||
|
/// </summary>
|
||||||
|
public string? ClipboardContent { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user