mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Propagate clock state from gameplay test back to editor
This commit is contained in:
@ -11,15 +11,17 @@ namespace osu.Game.Screens.Edit.GameplayTest
|
||||
{
|
||||
public class EditorPlayer : Player
|
||||
{
|
||||
private readonly Editor editor;
|
||||
private readonly EditorState editorState;
|
||||
|
||||
[Resolved]
|
||||
private MusicController musicController { get; set; }
|
||||
|
||||
public EditorPlayer(EditorState editorState)
|
||||
public EditorPlayer(Editor editor)
|
||||
: base(new PlayerConfiguration { ShowResults = false })
|
||||
{
|
||||
this.editorState = editorState;
|
||||
this.editor = editor;
|
||||
editorState = editor.GetState();
|
||||
}
|
||||
|
||||
protected override GameplayClockContainer CreateGameplayClockContainer(WorkingBeatmap beatmap, double gameplayStart)
|
||||
@ -45,6 +47,9 @@ namespace osu.Game.Screens.Edit.GameplayTest
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
musicController.Stop();
|
||||
|
||||
editorState.Time = GameplayClockContainer.CurrentTime;
|
||||
editor.RestoreState(editorState);
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user