-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added performance increase on loading tag menu (thanks TGM!)
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} | ||
} |