Exemplo n.º 1
0
        public static void SaveUnlock(ICLIFlags flags, Unlock unlock, string path, string eventKey,
                                      Dictionary <string, ParsedArg> config,
                                      Dictionary <string, TagExpectedValue> tags, VoiceSet voiceSet, STUHero hero)
        {
            string rarity;

            if (tags != null)
            {
                if (unlock.STU.m_0B1BA7C1 == null)
                {
                    rarity             = unlock.Rarity.ToString();
                    tags["leagueTeam"] = new TagExpectedValue("none");
                }
                else
                {
                    TeamDefinition teamDef = new TeamDefinition(unlock.STU.m_0B1BA7C1);
                    tags["leagueTeam"] = new TagExpectedValue(teamDef.Abbreviation, // NY
                                                              teamDef.Location,     // New York
                                                              teamDef.Name,         // Excelsior
                                                              teamDef.FullName,     // New York Excelsior
                                                              (teamDef.Division == Enum_5A789F71.None && teamDef.Abbreviation == null) ? "none" : "*",
                                                              "*");                 // all

                    // nice file structure
                    rarity   = "";
                    eventKey = "League";
                }
                tags["rarity"] = new TagExpectedValue(unlock.Rarity.ToString());

                tags["special"] = new TagExpectedValue(unlock.Tag ?? "none");
            }
            else
            {
                rarity = ""; // for general unlocks
            }

            var eventMap = GetEventConfig();

            if (unlock.STU.m_BEE9BCDA != null)
            {
                var formalEventKey = unlock.STU.m_BEE9BCDA.FirstOrDefault(x => eventMap.ContainsKey(x));
                if (eventMap.ContainsKey(formalEventKey))
                {
                    eventKey = eventMap[formalEventKey];
                }
            }

            string thisPath = Path.Combine(path, unlock.GetTypeNameEnum(), eventKey, rarity, GetValidFilename(unlock.GetName()));

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_SprayPaint)))
            {
                SprayAndIcon.Save(flags, thisPath, unlock);
            }
            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_AvatarPortrait)))
            {
                SprayAndIcon.Save(flags, thisPath, unlock);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_POTGAnimation)))
            {
                AnimationItem.Save(flags, thisPath, unlock);
            }
            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_Emote)))
            {
                AnimationItem.Save(flags, thisPath, unlock);
            }
            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_Pose)))
            {
                AnimationItem.Save(flags, thisPath, unlock);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_VoiceLine)))
            {
                VoiceLine.Save(flags, thisPath, unlock, voiceSet);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_SkinTheme)))
            {
                SkinTheme.Save(flags, thisPath, unlock, hero);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_PortraitFrame)))
            {
                thisPath = Path.Combine(path, unlock.Type);
                PortraitFrame.Save(flags, thisPath, unlock);
            }
        }
Exemplo n.º 2
0
        public static void SaveUnlock(ICLIFlags flags, Unlock unlock, string path, string eventKey,
                                      Dictionary <string, ParsedArg> config,
                                      Dictionary <string, TagExpectedValue> tags, VoiceSet voiceSet, STUHero hero)
        {
            string rarity;

            if (tags != null)
            {
                if (unlock.STU.m_0B1BA7C1 == null)
                {
                    rarity             = unlock.Rarity.ToString();
                    tags["leagueTeam"] = new TagExpectedValue("none");
                }
                else
                {
                    TeamDefinition teamDef = new TeamDefinition(unlock.STU.m_0B1BA7C1);
                    tags["leagueTeam"] = new TagExpectedValue(teamDef.Abbreviation, // NY
                                                              teamDef.Location,     // New York
                                                              teamDef.Name,         // Excelsior
                                                              teamDef.FullName,     // New York Excelsior
                                                              "*");                 // all

                    // nice file structure
                    rarity   = "";
                    eventKey = "League";
                }
                tags["rarity"] = new TagExpectedValue(unlock.Rarity.ToString());

                //if (UnlockData.SummerGames2016.Contains(unlock.GUID)) {
                //    tags["special"] = new TagExpectedValue("sg2016");
                //} if (UnlockData.SummerGames2017.Contains(unlock.GUID)) {
                //    tags["special"] = new TagExpectedValue("sg2017");
                //} else
                if (UnlockData.SummerGames2018.Contains(unlock.GUID))
                {
                    tags["special"] = new TagExpectedValue("sg2018");
                }
                else
                {
                    tags["special"] = new TagExpectedValue("none");
                }
            }
            else
            {
                rarity = ""; // for general unlocks
            }

            string thisPath = Path.Combine(path, unlock.Type, eventKey, rarity, GetValidFilename(unlock.GetName()));

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_SprayPaint)))
            {
                SprayAndIcon.Save(flags, thisPath, unlock);
            }
            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_AvatarPortrait)))
            {
                SprayAndIcon.Save(flags, thisPath, unlock);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_POTGAnimation)))
            {
                AnimationItem.Save(flags, thisPath, unlock);
            }
            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_Emote)))
            {
                AnimationItem.Save(flags, thisPath, unlock);
            }
            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_Pose)))
            {
                AnimationItem.Save(flags, thisPath, unlock);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_VoiceLine)))
            {
                VoiceLine.Save(flags, thisPath, unlock, voiceSet);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_SkinTheme)))
            {
                SkinTheme.Save(flags, thisPath, unlock, hero);
            }

            if (ShouldDo(unlock, config, tags, typeof(STUUnlock_PortraitFrame)))
            {
                thisPath = Path.Combine(path, unlock.Type);
                PortraitFrame.Save(flags, thisPath, unlock);
            }
        }
Exemplo n.º 3
0
 private void LoadPortraitFrame()
 {
     _portraitFrame = gameObject.GetComponentInChildren <PortraitFrame>();
 }
        public override int GetHashCode()
        {
            int hash = 1;

            if (BaselineSrc != 0)
            {
                hash ^= BaselineSrc.GetHashCode();
            }
            if (PortraitFormat != 0)
            {
                hash ^= PortraitFormat.GetHashCode();
            }
            if (PortraitAction != 0)
            {
                hash ^= PortraitAction.GetHashCode();
            }
            if (PortraitLensTop.Length != 0)
            {
                hash ^= PortraitLensTop.GetHashCode();
            }
            if (PortraitLensMid.Length != 0)
            {
                hash ^= PortraitLensMid.GetHashCode();
            }
            if (PortraitLensBottom.Length != 0)
            {
                hash ^= PortraitLensBottom.GetHashCode();
            }
            if (PortraitFrame.Length != 0)
            {
                hash ^= PortraitFrame.GetHashCode();
            }
            if (PortraitFilter.Length != 0)
            {
                hash ^= PortraitFilter.GetHashCode();
            }
            hash ^= portraitStickerIds_.GetHashCode();
            if (PortraitStickerCount != 0)
            {
                hash ^= PortraitStickerCount.GetHashCode();
            }
            if (ShareSource != 0)
            {
                hash ^= ShareSource.GetHashCode();
            }
            if (ShareType != 0)
            {
                hash ^= ShareType.GetHashCode();
            }
            if (ShareNetwork.Length != 0)
            {
                hash ^= ShareNetwork.GetHashCode();
            }
            if (DownloadSource != 0)
            {
                hash ^= DownloadSource.GetHashCode();
            }
            if (DownloadType != 0)
            {
                hash ^= DownloadType.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }