mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Restore editor clock time after difficulty switch
This commit is contained in:
@ -476,6 +476,8 @@ namespace osu.Game.Screens.Edit
|
||||
});
|
||||
|
||||
resetTrack(true);
|
||||
if (loader?.State != null)
|
||||
restoreState(loader.State);
|
||||
}
|
||||
|
||||
public override bool OnExiting(IScreen next)
|
||||
@ -740,7 +742,16 @@ namespace osu.Game.Screens.Edit
|
||||
return new DifficultyMenuItem(beatmapInfo, isCurrentDifficulty, SwitchToDifficulty);
|
||||
}
|
||||
|
||||
protected void SwitchToDifficulty(BeatmapInfo beatmapInfo) => loader?.ScheduleDifficultySwitch(beatmapInfo);
|
||||
protected void SwitchToDifficulty(BeatmapInfo nextBeatmap) => loader?.ScheduleDifficultySwitch(nextBeatmap, new EditorState
|
||||
{
|
||||
Time = clock.CurrentTimeAccurate
|
||||
});
|
||||
|
||||
private void restoreState([NotNull] EditorState state)
|
||||
{
|
||||
if (state.Time != null)
|
||||
clock.Seek(state.Time.Value);
|
||||
}
|
||||
|
||||
private void cancelExit() => loader?.CancelPendingDifficultySwitch();
|
||||
|
||||
|
Reference in New Issue
Block a user