예제 #1
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());

            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)));
            }
        }
예제 #2
0
파일: FavCatMod.cs 프로젝트: knah/VRCMods
        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);
        }
예제 #3
0
파일: FavCatMod.cs 프로젝트: the12t/VRCMods
        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());
        }