Skip to content

Commit

Permalink
Merge pull request ppy#26149 from rushiiMachine/fix-skin-editor-init-…
Browse files Browse the repository at this point in the history
…fail

Fix `SkinEditorOverlay` freezing when `ReplayPlayer` screen exits early
  • Loading branch information
bdach authored Feb 22, 2024
2 parents 82b2edd + f9e92c6 commit 9018579
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ protected override void PopIn()
{
globallyDisableBeatmapSkinSetting();

if (lastTargetScreen is MainMenu)
PresentGameplay();

if (skinEditor != null)
{
disableNestedInputManagers();
skinEditor.Show();

if (lastTargetScreen is MainMenu)
PresentGameplay();

return;
}

Expand All @@ -126,6 +127,9 @@ protected override void PopIn()
AddInternal(editor);
if (lastTargetScreen is MainMenu)
PresentGameplay();
Debug.Assert(lastTargetScreen != null);
SetTarget(lastTargetScreen);
Expand Down Expand Up @@ -270,7 +274,7 @@ private void setTarget(OsuScreen? target)

Debug.Assert(skinEditor != null);

if (!target.IsLoaded)
if (!target.IsLoaded || !skinEditor.IsLoaded)
{
Scheduler.AddOnce(setTarget, target);
return;
Expand Down Expand Up @@ -350,7 +354,7 @@ protected override void LoadComplete()
base.LoadComplete();

if (!LoadedBeatmapSuccessfully)
Scheduler.AddDelayed(this.Exit, 3000);
Scheduler.AddDelayed(this.Exit, 1000);
}

protected override void Update()
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ private IBeatmap loadPlayableBeatmap(Mod[] gameplayMods, CancellationToken cance

if (playable.HitObjects.Count == 0)
{
Logger.Log("Beatmap contains no hit objects!", level: LogLevel.Error);
Logger.Log("Beatmap contains no hit objects!", level: LogLevel.Important);
return null;
}
}
Expand Down

0 comments on commit 9018579

Please sign in to comment.