Skip to content

Commit

Permalink
Added performance increase on loading tag menu (thanks TGM!)
Browse files Browse the repository at this point in the history
  • Loading branch information
SB15-MD committed Jan 22, 2024
1 parent cfdbe4d commit 4c51c77
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Patches/MusicTagManagerPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Il2Cpp;
using Il2CppAssets.Scripts.Database;
using HarmonyLib;
using Il2CppAssets.Scripts.PeroTools.Commons;
using Il2CppAssets.Scripts.PeroTools.Managers;

namespace CustomAlbums.Patches
{
internal class MusicTagManagerPatch
{
/// <summary>
/// Makes the game think (correctly) that there are not 1000 albums upon loading the tag menu.
/// Increases performance substantially upon loading the tag menu.
/// </summary>
[HarmonyPatch(typeof(MusicTagManager), nameof(MusicTagManager.InitDatas))]
internal static class Fix1000AlbumsPatch
{
private static void Postfix()
{
var configObject = Singleton<ConfigManager>.instance.GetConfigObject<DBConfigAlbums>();
configObject.m_MaxAlbumUid = configObject.count - 3;
}
}
}
}

0 comments on commit 4c51c77

Please sign in to comment.