Exemplo n.º 1
0
        public void SaveItemInfo(ItemInfo itemInfo, string basePath, string heroFileName, ICLIFlags flags, STUHero hero,
                                 string eventKey, Dictionary <string, ParsedArg> config, Dictionary <string, TagExpectedValue> tags, List <ItemInfo> weaponSkins)
        {
            if (itemInfo?.Unlock == null)
            {
                return;
            }

            if (itemInfo.Unlock.LeagueTeam != null)
            {
                STULeagueTeam team = GetInstance <STULeagueTeam>(itemInfo.Unlock.LeagueTeam);
                tags["leagueTeam"] = new TagExpectedValue(GetString(team.Abbreviation),                         // NXL
                                                          GetString(team.Location),                             // New York
                                                          GetString(team.Name),                                 // Excelsior
                                                          $"{GetString(team.Location)} {GetString(team.Name)}", // New York Excelsior
                                                          "*");                                                 // all
                eventKey        = "League";
                itemInfo.Rarity = "";
            }
            else
            {
                tags["leagueTeam"] = new TagExpectedValue("none");
            }

            if (eventKey == "Achievement" && itemInfo.Type == "Skin")
            {
                itemInfo.Rarity = "";
            }


            tags["rarity"] = new TagExpectedValue(itemInfo.Rarity);

            if (itemInfo.Type == "Spray" && config.ContainsKey("spray") && config["spray"].ShouldDo(itemInfo.Name, tags))
            {
                SprayAndIcon.SaveItem(basePath, heroFileName, RootDir, eventKey, flags, itemInfo);
            }
            if (itemInfo.Type == "PlayerIcon" && config.ContainsKey("icon") && config["icon"].ShouldDo(itemInfo.Name, tags))
            {
                SprayAndIcon.SaveItem(basePath, heroFileName, RootDir, eventKey, flags, itemInfo);
            }
            if (itemInfo.Type == "Skin" && config.ContainsKey("skin") && config["skin"].ShouldDo(itemInfo.Name, tags))
            {
                Skin.Save(flags, $"{basePath}\\{RootDir}", hero, $"{eventKey}\\{itemInfo.Rarity}", itemInfo.Unlock as STUUnlock_Skin, weaponSkins, null, false);
            }
            if (itemInfo.Type == "Pose" && config.ContainsKey("victorypose") && config["victorypose"].ShouldDo(itemInfo.Name, tags))
            {
                AnimationItem.SaveItem(basePath, heroFileName, RootDir, eventKey, flags, itemInfo);
            }
            if (itemInfo.Type == "HighlightIntro" && config.ContainsKey("highlightintro") && config["highlightintro"].ShouldDo(itemInfo.Name, tags))
            {
                AnimationItem.SaveItem(basePath, heroFileName, RootDir, eventKey, flags, itemInfo);
            }
            if (itemInfo.Type == "Emote" && config.ContainsKey("emote") && config["emote"].ShouldDo(itemInfo.Name, tags))
            {
                AnimationItem.SaveItem(basePath, heroFileName, RootDir, eventKey, flags, itemInfo);
            }
            if (itemInfo.Type == "VoiceLine" && config.ContainsKey("voiceline") && config["voiceline"].ShouldDo(itemInfo.Name, tags))
            {
                VoiceLine.SaveItem(basePath, heroFileName, RootDir, eventKey, flags, itemInfo, hero);
            }
        }