public override void OnApplicationStart()
        {
            Instance = this;

            Directory.CreateDirectory("./UserData/FavCatImport");

            ClassInjector.RegisterTypeInIl2Cpp <CustomPickerList>();
            ClassInjector.RegisterTypeInIl2Cpp <CustomPicker>();

            ApiSnifferPatch.DoPatch();

            FavCatSettings.RegisterSettings();

            MelonLogger.Log("Creating database");
            Database = new LocalStoreDatabase(FavCatSettings.DatabasePath, FavCatSettings.ImageCachePath);

            Database.ImageHandler.TrimCache(FavCatSettings.MaxCacheSizeBytes).NoAwait();

            ExpansionKitApi.RegisterWaitConditionBeforeDecorating(WaitForInitDone());

            foreach (var methodInfo in typeof(AvatarPedestal).GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public).Where(it => it.Name.StartsWith("Method_Private_Void_ApiContainer_") && it.GetParameters().Length == 1))
            {
                Harmony.Patch(methodInfo, new HarmonyMethod(typeof(FavCatMod), nameof(AvatarPedestalPatch)));
            }
        }
Exemple #2
0
        public override void OnApplicationStart()
        {
            Instance = this;
            if (!CheckWasSuccessful || !MustStayTrue || MustStayFalse)
            {
                return;
            }

            Directory.CreateDirectory("./UserData/FavCatImport");

            ClassInjector.RegisterTypeInIl2Cpp <CustomPickerList>();
            ClassInjector.RegisterTypeInIl2Cpp <CustomPicker>();

            ApiSnifferPatch.DoPatch();

            FavCatSettings.RegisterSettings();

            MelonLogger.Msg("Creating database");
            Database = new LocalStoreDatabase(FavCatSettings.DatabasePath.Value, FavCatSettings.ImageCachePath.Value);

            Database.ImageHandler.TrimCache(FavCatSettings.MaxCacheSizeBytes).NoAwait();

            foreach (var methodInfo in typeof(AvatarPedestal).GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public).Where(it => it.Name.StartsWith("Method_Private_Void_ApiContainer_") && it.GetParameters().Length == 1))
            {
                HarmonyInstance.Patch(methodInfo, new HarmonyMethod(typeof(FavCatMod), nameof(AvatarPedestalPatch)));
            }

            DoAfterUiManagerInit(OnUiManagerInit);
        }
Exemple #3
0
        public override void OnApplicationStart()
        {
            Instance = this;

            Directory.CreateDirectory("./UserData/FavCatImport");

            ClassInjector.RegisterTypeInIl2Cpp <CustomPickerList>();
            ClassInjector.RegisterTypeInIl2Cpp <CustomPicker>();

            ApiSnifferPatch.DoPatch();

            FavCatSettings.RegisterSettings();

            MelonLogger.Log("Creating database");
            Database = new LocalStoreDatabase(FavCatSettings.DatabasePath, FavCatSettings.ImageCachePath);

            Database.ImageHandler.TrimCache(FavCatSettings.MaxCacheSizeBytes).NoAwait();

            ExpansionKitApi.RegisterWaitConditionBeforeDecorating(WaitForInitDone());
        }