コード例 #1
0
            // Token: 0x0600192C RID: 6444 RVA: 0x0006CC28 File Offset: 0x0006AE28
            public LoadoutBuilder(SerializableLoadout serializedLoadout)
            {
                SerializableLoadout.BodyLoadout[] bodyLoadouts              = serializedLoadout.bodyLoadouts;
                List <SerializableLoadout.LoadoutBuilder.SkillSetter> list  = new List <SerializableLoadout.LoadoutBuilder.SkillSetter>(8);
                List <SerializableLoadout.LoadoutBuilder.SkinSetter>  list2 = new List <SerializableLoadout.LoadoutBuilder.SkinSetter>(bodyLoadouts.Length);

                for (int i = 0; i < bodyLoadouts.Length; i++)
                {
                    ref SerializableLoadout.BodyLoadout ptr = ref bodyLoadouts[i];
                    CharacterBody body = ptr.body;
                    if (body)
                    {
                        int            bodyIndex            = body.bodyIndex;
                        GenericSkill[] bodyPrefabSkillSlots = BodyCatalog.GetBodyPrefabSkillSlots(bodyIndex);
                        SerializableLoadout.BodyLoadout.SkillChoice[] skillChoices = ptr.skillChoices;
                        int j = 0;
                        while (j < skillChoices.Length)
                        {
                            ref SerializableLoadout.BodyLoadout.SkillChoice ptr2 = ref skillChoices[j];
                            int num  = SerializableLoadout.LoadoutBuilder.FindSkillSlotIndex(bodyPrefabSkillSlots, ptr2.skillFamily);
                            int num2 = SerializableLoadout.LoadoutBuilder.FindSkillVariantIndex(ptr2.skillFamily, ptr2.variant);
                            if (num != -1 && num2 != -1)
                            {
                                list.Add(new SerializableLoadout.LoadoutBuilder.SkillSetter(bodyIndex, num, (uint)num2));
                            }
                            i++;
                        }
                        int num3 = Array.IndexOf <SkinDef>(BodyCatalog.GetBodySkins(bodyIndex), ptr.skinChoice);
                        if (num3 != -1)
                        {
                            list2.Add(new SerializableLoadout.LoadoutBuilder.SkinSetter(bodyIndex, (uint)num3));
                        }
                    }
コード例 #2
0
        // Token: 0x06001723 RID: 5923 RVA: 0x00064A78 File Offset: 0x00062C78
        private static void GenerateViewables()
        {
            StringBuilder stringBuilder = new StringBuilder();

            ViewablesCatalog.Node node   = new ViewablesCatalog.Node("Loadout", true, null);
            ViewablesCatalog.Node parent = new ViewablesCatalog.Node("Bodies", true, node);
            for (int i = 0; i < BodyCatalog.bodyCount; i++)
            {
                if (SurvivorCatalog.GetSurvivorIndexFromBodyIndex(i) != SurvivorIndex.None)
                {
                    string                bodyName             = BodyCatalog.GetBodyName(i);
                    GenericSkill[]        bodyPrefabSkillSlots = BodyCatalog.GetBodyPrefabSkillSlots(i);
                    ViewablesCatalog.Node parent2 = new ViewablesCatalog.Node(bodyName, true, parent);
                    for (int j = 0; j < bodyPrefabSkillSlots.Length; j++)
                    {
                        SkillFamily skillFamily = bodyPrefabSkillSlots[j].skillFamily;
                        if (skillFamily.variants.Length > 1)
                        {
                            string skillFamilyName = SkillCatalog.GetSkillFamilyName(skillFamily.catalogIndex);
                            uint   num             = 0U;
                            while ((ulong)num < (ulong)((long)skillFamily.variants.Length))
                            {
                                ref SkillFamily.Variant ptr = ref skillFamily.variants[(int)num];
                                string unlockableName       = ptr.unlockableName;
                                if (!string.IsNullOrEmpty(unlockableName))
                                {
                                    string skillName = SkillCatalog.GetSkillName(ptr.skillDef.skillIndex);
                                    stringBuilder.Append(skillFamilyName).Append(".").Append(skillName);
                                    string name = stringBuilder.ToString();
                                    stringBuilder.Clear();
                                    ViewablesCatalog.Node variantNode = new ViewablesCatalog.Node(name, false, parent2);
                                    ptr.viewableNode = variantNode;
                                    variantNode.shouldShowUnviewed = ((UserProfile userProfile) => !userProfile.HasViewedViewable(variantNode.fullName) && userProfile.HasUnlockable(unlockableName));
                                }
                                num += 1U;
                            }
                        }
                    }
                    SkinDef[] bodySkins = BodyCatalog.GetBodySkins(i);
                    if (bodySkins.Length > 1)
                    {
                        ViewablesCatalog.Node parent3 = new ViewablesCatalog.Node("Skins", true, parent2);
                        for (int k = 0; k < bodySkins.Length; k++)
                        {
                            string unlockableName = bodySkins[k].unlockableName;
                            if (!string.IsNullOrEmpty(unlockableName))
                            {
                                ViewablesCatalog.Node skinNode = new ViewablesCatalog.Node(bodySkins[k].name, false, parent3);
                                skinNode.shouldShowUnviewed = ((UserProfile userProfile) => !userProfile.HasViewedViewable(skinNode.fullName) && userProfile.HasUnlockable(unlockableName));
                            }
                        }
                    }
                }
            }