Skip to content

Commit

Permalink
Fix refresh patch on internal restart
Browse files Browse the repository at this point in the history
  • Loading branch information
Meivyn committed Jun 12, 2024
1 parent 37dbd1e commit 1ceb86b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
15 changes: 0 additions & 15 deletions PlaylistManager/HarmonyPatches/SongCore_MenuLoaded.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ public void Initialize()
{
playlistDownloader.PopupEvent += OnPopupRequested;
playlistDownloader.QueueUpdatedEvent += UpdateQueue;
SongCore_MenuLoaded.MenuLoadedEvent += OnMenuLoaded;
SceneManager.activeSceneChanged += OnMenuLoaded;
}

public void Dispose()
{
playlistDownloader.PopupEvent -= OnPopupRequested;
playlistDownloader.QueueUpdatedEvent -= UpdateQueue;
SongCore_MenuLoaded.MenuLoadedEvent -= OnMenuLoaded;
SceneManager.activeSceneChanged -= OnMenuLoaded;
}

[UIAction("#post-parse")]
Expand Down Expand Up @@ -113,9 +113,9 @@ private void UpdateQueue()
}
}

private void OnMenuLoaded()
private void OnMenuLoaded(Scene previousScene, Scene newScene)
{
if (refreshRequested)
if (refreshRequested && newScene.name == "MainMenu")
{
refreshRequested = false;
playlistDownloader.OnQueueClear();
Expand Down

0 comments on commit 1ceb86b

Please sign in to comment.