예제 #1
0
파일: CASParts.cs 프로젝트: yakoder/NRaas
            public List <CASParts.PartPreset> GetPresets()
            {
                List <CASParts.PartPreset> presets = new List <CASParts.PartPreset>();

                CASParts.PartPreset preset = new CASParts.PartPreset(mPart);
                if (preset.Valid)
                {
                    presets.Add(preset);
                }

                for (uint index = 0; index < CASUtils.PartDataNumPresets(mPart.Key); index++)
                {
                    preset = new CASParts.PartPreset(mPart, index);
                    if (preset.Valid)
                    {
                        presets.Add(preset);
                    }
                }

                return(presets);
            }
예제 #2
0
            public List<CASParts.PartPreset> GetPresets()
            {
                List<CASParts.PartPreset> presets = new List<CASParts.PartPreset>();

                CASParts.PartPreset preset = new CASParts.PartPreset(mPart);
                if (preset.Valid)
                {
                    presets.Add(preset);
                }

                for (uint index = 0; index < CASUtils.PartDataNumPresets(mPart.Key); index++)
                {
                    preset = new CASParts.PartPreset(mPart, index);
                    if (preset.Valid)
                    {
                        presets.Add(preset);
                    }
                }

                return presets;
            }
예제 #3
0
        public static void OnAddition(OccultUnicorn ths, SimDescription simDes, bool alterOutfit)
        {
            if (alterOutfit)
            {
                if (simDes.HorseManager == null)
                {
                    return;
                }

                Color[] maneColors = simDes.HorseManager.ActiveManeHairColors;
                simDes.HorseManager.ActiveUnicornBeardHairColors = maneColors;

                if (sParts == null)
                {
                    sParts = CASParts.GetParts(PartMatches);
                }

                List <CASParts.PartPreset> parts = new List <CASParts.PartPreset>();
                foreach (CASParts.Wrapper part in sParts)
                {
                    if (!part.ValidFor(simDes))
                    {
                        continue;
                    }

                    CASParts.PartPreset preset = part.GetRandomPreset();
                    if (preset == null)
                    {
                        continue;
                    }

                    parts.Add(preset);
                }

                if (parts.Count > 0)
                {
                    GeneticsPet.SpeciesSpecificData speciesData = new GeneticsPet.SpeciesSpecificData();
                    speciesData.UnicornBeardHairColors = simDes.HorseManager.ActiveUnicornBeardHairColors;

                    foreach (OutfitCategories category in simDes.ListOfCategories)
                    {
                        switch (category)
                        {
                        case OutfitCategories.All:
                        case OutfitCategories.CategoryMask:
                        case OutfitCategories.None:
                        case OutfitCategories.PrimaryCategories:
                        case OutfitCategories.PrimaryHorseCategories:
                        case OutfitCategories.Special:
                            continue;

                        default:
                            for (int i = 0x0; i < simDes.GetOutfitCount(category); i++)
                            {
                                using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(simDes, new CASParts.Key(category, i)))
                                {
                                    foreach (CASParts.PartPreset part in parts)
                                    {
                                        builder.Builder.RemoveParts(new BodyTypes[] { part.mPart.BodyType });
                                        builder.ApplyPartPreset(part);
                                        if (part.mPart.BodyType == BodyTypes.PetBeard)
                                        {
                                            OutfitUtils.AdjustPresetForHorseHairColor(builder.Builder, part.mPart, speciesData);
                                        }
                                    }
                                }
                            }
                            break;
                        }
                    }

                    if (simDes.CreatedSim != null)
                    {
                        simDes.CreatedSim.UpdateOutfitInfo();
                        simDes.CreatedSim.RefreshCurrentOutfit(false);
                    }
                }
            }
        }