mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Propagate clock state from editor to gameplay test
This commit is contained in:
@ -325,6 +325,19 @@ namespace osu.Game.Screens.Edit
|
||||
/// </summary>
|
||||
public void UpdateClockSource() => clock.ChangeSource(Beatmap.Value.Track);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="EditorState"/> instance representing the current state of the editor.
|
||||
/// </summary>
|
||||
/// <param name="nextBeatmap">
|
||||
/// The next beatmap to be shown, in the case of difficulty switch.
|
||||
/// <see langword="null"/> indicates that the beatmap will not be changing.
|
||||
/// </param>
|
||||
private EditorState getState([CanBeNull] BeatmapInfo nextBeatmap = null) => new EditorState
|
||||
{
|
||||
Time = clock.CurrentTimeAccurate,
|
||||
ClipboardContent = nextBeatmap == null || editorBeatmap.BeatmapInfo.RulesetID == nextBeatmap.RulesetID ? Clipboard.Content.Value : string.Empty
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Restore the editor to a provided state.
|
||||
/// </summary>
|
||||
@ -780,11 +793,7 @@ namespace osu.Game.Screens.Edit
|
||||
return new DifficultyMenuItem(beatmapInfo, isCurrentDifficulty, SwitchToDifficulty);
|
||||
}
|
||||
|
||||
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleDifficultySwitch(nextBeatmap, new EditorState
|
||||
{
|
||||
Time = clock.CurrentTimeAccurate,
|
||||
ClipboardContent = editorBeatmap.BeatmapInfo.RulesetID == nextBeatmap.RulesetID ? Clipboard.Content.Value : string.Empty
|
||||
});
|
||||
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleDifficultySwitch(nextBeatmap, getState(nextBeatmap));
|
||||
|
||||
private void cancelExit()
|
||||
{
|
||||
@ -807,7 +816,7 @@ namespace osu.Game.Screens.Edit
|
||||
pushEditorPlayer();
|
||||
}
|
||||
|
||||
void pushEditorPlayer() => this.Push(new EditorPlayerLoader());
|
||||
void pushEditorPlayer() => this.Push(new EditorPlayerLoader(getState()));
|
||||
}
|
||||
|
||||
public double SnapTime(double time, double? referenceTime) => editorBeatmap.SnapTime(time, referenceTime);
|
||||
|
Reference in New Issue
Block a user