Skip to content

Commit

Permalink
Merge pull request #64 from Meivyn/fix/1.31.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rithik-b authored Sep 11, 2023
2 parents 24af3c9 + 2dda00f commit b3462c3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions PlaylistManager/Managers/PlaylistDataManager.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using IPA.Utilities;
using System;
using System.Collections.Generic;
using PlaylistManager.HarmonyPatches;
using PlaylistManager.Interfaces;
using PlaylistManager.UI;
using PlaylistManager.Utilities;
using System;
using System.Collections.Generic;
using UnityEngine;
using Zenject;

namespace PlaylistManager
Expand Down Expand Up @@ -88,7 +88,7 @@ private void LevelPackDetailViewController_didActivateEvent(bool firstActivation
}
}

private void LevelFilteringNavigationController_didSelectAnnotatedBeatmapLevelCollectionEvent(LevelFilteringNavigationController _, IAnnotatedBeatmapLevelCollection annotatedBeatmapLevelCollection, UnityEngine.GameObject __, BeatmapCharacteristicSO ___)
private void LevelFilteringNavigationController_didSelectAnnotatedBeatmapLevelCollectionEvent(LevelFilteringNavigationController controller, IAnnotatedBeatmapLevelCollection annotatedBeatmapLevelCollection, GameObject noDataInfoPrefab, bool sortAlphabetically, BeatmapCharacteristicSO preferredBeatmapCharacteristic)
{
AnnotatedBeatmapLevelCollectionsViewController_didSelectAnnotatedBeatmapLevelCollectionEvent(annotatedBeatmapLevelCollection);
}
Expand Down
14 changes: 8 additions & 6 deletions PlaylistManager/UI/RefreshButtonUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using SongCore;
using SongCore.UI;
using System;
using IPA.Utilities.Async;
using System.Threading.Tasks;
using Zenject;

namespace PlaylistManager.UI
Expand All @@ -28,11 +28,13 @@ private async void SongsLoaded(Loader _, System.Collections.Concurrent.Concurren
progressBar = ProgressBar.Create();
}

var numPlaylists = await UnityMainThreadTaskScheduler.Factory.StartNew(() =>
{
PlaylistLibUtils.playlistManager.RefreshPlaylists(true);
return PlaylistLibUtils.playlistManager.GetPlaylistCount(true);
}).ConfigureAwait(false);
PlaylistLibUtils.playlistManager.RefreshPlaylists(true);
var numPlaylists = PlaylistLibUtils.playlistManager.GetPlaylistCount(true);

// This event handler is loading sprites and accessing Unity objects so it must be done on the main thread.
// Although SongsLoadedEvent is already invoked on the main thread, the default event handler in ProgressBar
// will overwrite our message. We're essentially skipping a frame to let the default event handler run first.
await Task.Yield();

progressBar.enabled = true;
progressBar.ShowMessage($"\n{numPlaylists} playlists loaded.", kMessageTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ private void RemoveSong()
if ((PluginConfig.Instance.AuthorName.IndexOf("GOOBIE", StringComparison.OrdinalIgnoreCase) >= 0 || PluginConfig.Instance.AuthorName.IndexOf("ERIS", StringComparison.OrdinalIgnoreCase) >= 0 ||
PluginConfig.Instance.AuthorName.IndexOf("PINK", StringComparison.OrdinalIgnoreCase) >= 0 || PluginConfig.Instance.AuthorName.IndexOf("CANDL3", StringComparison.OrdinalIgnoreCase) >= 0) && PluginConfig.Instance.EasterEggs)
{
levelCollectionNavigationController.SetDataForPack(selectedPlaylist, true, true, $"{PluginConfig.Instance.AuthorName} Cute");
levelCollectionNavigationController.SetDataForPack(selectedPlaylist, true, true, $"{PluginConfig.Instance.AuthorName} Cute", false);
}
else if (PluginConfig.Instance.AuthorName.IndexOf("JOSHABI", StringComparison.OrdinalIgnoreCase) >= 0)
{
levelCollectionNavigationController.SetDataForPack(selectedPlaylist, true, true, $"*Sneeze*");
levelCollectionNavigationController.SetDataForPack(selectedPlaylist, true, true, $"*Sneeze*", false);
}
else
{
levelCollectionNavigationController.SetDataForPack(selectedPlaylist, true, true, "Play");
levelCollectionNavigationController.SetDataForPack(selectedPlaylist, true, true, "Play", false);
}

levelCollectionNavigationController.HideDetailViewController();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ private void ReadOnlyToggled(bool playlistReadOnly)
{
if (playlistReadOnly)
{
playlistReadOnly = true;
PlaylistReadOnly = true;
}
else if (PlaylistAllowDuplicates != PlaylistReadOnly)
else if (PlaylistReadOnly != playlistReadOnly)
{
popupModalsController.ShowYesNoModal(modalTransform, "To turn off read only, this playlist will be cloned and writing will be enabled on the clone. Proceed?", ClonePlaylist, noButtonPressedCallback: UpdateReadOnly, animateParentCanvas: false);
}
Expand Down
6 changes: 3 additions & 3 deletions PlaylistManager/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
"id": "PlaylistManager",
"name": "PlaylistManager",
"author": "PixelBoom",
"version": "1.6.7",
"version": "1.6.8",
"description": [
"#![PlaylistManager.Description.md]",
"Load, Create, Edit, Organize Playlists and Download their Songs in Beat Saber."
],
"gameVersion": "1.31.0",
"gameVersion": "1.31.1",
"icon": "PlaylistManager.Icons.Logo.png",
"dependsOn": {
"BSIPA": "^4.3.0",
"SongCore": "^3.9.5",
"BeatSaberMarkupLanguage": "^1.7.5",
"SiraUtil": "^3.0.0",
"BeatSaberPlaylistsLib": "^1.6.7",
"BeatSaverSharp": "^3.3.0",
"BeatSaverSharp": "^3.4.5",
"System.IO.Compression": "^4.6.57",
"System.IO.Compression.FileSystem": "^4.7.3056"
},
Expand Down

0 comments on commit b3462c3

Please sign in to comment.