Example #1
0
        /// <summary>
        /// Occurs Every Frame Rendered
        /// </summary>
        public override void OnUpdate()
        {
            if (RoomManager.prop_Boolean_3)
            {
                if (APIUser.CurrentUser != null && VRCPlayer.field_Internal_Static_VRCPlayer_0 != null && VRCPlayer.field_Internal_Static_VRCPlayer_0.prop_VRCAvatarManager_0.prop_EnumNPublicSealedvaUnLoErBlSaSuPeCu9vUnique_0 == VRCAvatarManager.EnumNPublicSealedvaUnLoErBlSaSuPeCu9vUnique.Custom /*Custom Avatar Loaded*/ && !LoggedIn)
                {
                    Helpers.Log("Logging In To emmVRCNetwork..");

                    if (NetworkLib.Login())
                    {
                        CustomAvatarFavorites.Initialize();
                        CustomAvatarFavorites.Show();
                        MelonCoroutines.Start(CustomAvatarFavorites.PopulateList());

                        Helpers.Log("Logged In!");
                    }

                    LoggedIn = true;
                }
            }

            if (LoggedIn)
            {
                CustomAvatarFavorites.OnUpdate();
            }
        }
Example #2
0
 public static IEnumerator FavoriteAvatars(List <ApiAvatar> avatars, bool errored)
 {
     foreach (ApiAvatar apiAvatar in avatars)
     {
         if (apiAvatar.releaseStatus == "public" || apiAvatar.authorId == APIUser.CurrentUser.id)
         {
             yield return(CustomAvatarFavorites.FavoriteAvatar(apiAvatar));
         }
         else
         {
             errored = true;
         }
         yield return(new WaitForSeconds(1f));
     }
     List <ApiAvatar> .Enumerator enumerator = default(List <ApiAvatar> .Enumerator);
     CustomAvatarFavorites.MigrateButton.SetActive(false);
     File.Move(Path.Combine(Environment.CurrentDirectory, "404Mods/AviFavorites/avatars.json"), Path.Combine(Environment.CurrentDirectory, "404Mods/AviFavorites/avatars.old.json"));
     yield break;
     yield break;
 }