Ejemplo n.º 1
0
        // Token: 0x0600077F RID: 1919 RVA: 0x00022DFC File Offset: 0x00020FFC
        public static void add_to_list(ApiAvatar api)
        {
            if (api == null)
            {
                return;
            }

            if (api.releaseStatus == "private" && api.authorId != APIUser.CurrentUser.id)
            {
                return;
            }

            if (!AvatarConfig.AvatarList.Any((AvatarStruct x) => x.AvatarID == api.id))
            {
                AvatarConfig.AvatarList.Reverse();
                AvatarConfig.AvatarList.Add(new AvatarStruct
                {
                    AvatarID          = api.id,
                    Name              = api.name,
                    ThumbnailImageUrl = api.thumbnailImageUrl
                });
                AvatarConfig.AvatarList.Reverse();
            }

            else
            {
                AvatarConfig.AvatarList.RemoveAll((AvatarStruct x) => x.AvatarID == api.id);
            }

            AvatarConfig.Save();
        }
Ejemplo n.º 2
0
        public static void Load()
        {
            if (!File.Exists(Path.Combine(Environment.CurrentDirectory, "UserData\\IceBurn2\\AvatarFav\\Avatars.json")))
            {
                AvatarConfig.config = new AvatarConfig();
                AvatarConfig.Save();
                return;
            }

            if (AvatarConfig.config == null)
            {
                AvatarConfig.config = new AvatarConfig();
            }

            AvatarConfig.AvatarList.Clear();
            AvatarConfig.AvatarList = JsonConvert.DeserializeObject <List <AvatarStruct> >(File.ReadAllText(Path.Combine(Environment.CurrentDirectory, "UserData\\IceBurn2\\AvatarFav\\Avatars.json")));
        }