public static SimOutfit GetOutfit(SimDescriptionCore sim, Key key, bool alternate) { if (sim == null) { return(null); } ArrayList outfits = GetOutfits(sim, key.mCategory, alternate); if (outfits == null) { return(null); } int index = key.GetIndex(sim, alternate); if (index == -1) { return(null); } if (index < outfits.Count) { return(outfits[index] as SimOutfit); } else { return(null); } }
public static void SpeciallyUnMark(SimDescriptionCore sd) { if (mkvali == null) { return; } int numRandomMkv = 0; int checkLoop = 200; do { numRandomMkv = RandomUtil.GetInt(int.MaxValue); checkLoop--; }while (IsSpeciallyMarked(numRandomMkv) && checkLoop > 0); if (checkLoop == 0) { return; } FieldInfo field = sd.GetType().GetField(mkvali, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && IsSpeciallyMarked(sd)) { int mark = (int)field.GetValue(sd); mark &= -14606321; mark |= (numRandomMkv & 0xDEDFF0); field.SetValue(sd, mark); } }
public void Apply(SimDescriptionCore sim) { Color[] color = ExtractHairColor(mHairPreset); if (color != null) { sim.ActiveHairColors = color; } color = ExtractHairColor(mBeardPreset); if (color != null) { sim.ActiveFacialHairColors = color; } /* * color = ExtractEyebrowColor(mEyebrowsPreset); * if ((color != null) && (color.Length > 0)) * { * sim.ActiveEyebrowColor = color[0]; * } * * color = ExtractEyebrowColor(mBodyHairPreset); * if ((color != null) && (color.Length > 0)) * { * sim.ActiveBodyHairColor = color[0]; * } */ }
public static void RemoveOutfits(SimDescriptionCore sim, OutfitCategories category, bool alternate) { for (int i = GetOutfitCount(sim, category, alternate) - 1; i >= 0; i--) { RemoveOutfit(sim, new Key(category, i), alternate); } }
public static bool isnraasloaded = false; //AssemblyCheckByNiec.IsInstalled("NRaasMasterController"); public static void NRCASParts_RemoveOutfits(SimDescriptionCore sim, OutfitCategories category, bool alternate) { //if (!isnraasloaded) { sim.RemoveOutfits(category, true); return; } //NiecNraTask.NraFunction temp = delegate //{ // NRaas.CommonSpace.Helpers.CASParts.RemoveOutfits(sim, category, alternate); //}; //temp(); sim.RemoveOutfits(category, true); }
public static ArrayList GetOutfits(SimDescriptionCore sim, OutfitCategories category, bool alternate) { if (alternate) { return(sim.Outfits[category] as ArrayList); } else { return(sim.GetCurrentOutfits()[category] as ArrayList); } }
public int GetIndex(SimDescriptionCore sim, bool alternate) { if ((mCategory == OutfitCategories.Special) && (!string.IsNullOrEmpty(mSpecialKey))) { return(sim.GetSpecialOutfitIndexFromKey(ResourceUtils.HashString32(mSpecialKey))); } else { return(mIndex); } }
public OutfitBuilder(SimDescriptionCore sim, Key key, SimOutfit outfit, bool alternate) { mBuilder = new SimBuilder(); mSim = sim; mKey = key; mAlternate = alternate; mOutfit = outfit; if (mOutfit != null) { OutfitUtils.SetOutfit(mBuilder, mOutfit, sim); } }
public bool ApplyColors(SimDescriptionCore sim, CASParts.Key key) { SavedOutfit outfit = Load(key); if (outfit == null) { return(false); } outfit.mStore.Apply(sim); return(true); }
public Item(CASParts.Key key, SimDescriptionCore sim) : this(key) { if (sim != null) { SimOutfit outfit = CASParts.GetOutfit(sim, key, false); if (outfit != null) { mThumbnail = new ThumbnailKey(outfit, 0x0, ThumbnailSize.Medium, ThumbnailCamera.Body); } } }
public static int GetOutfitCount(SimDescriptionCore sim, OutfitCategories category, bool alternate) { ArrayList outfits = CASParts.GetOutfits(sim, OutfitCategories.Special, alternate); if (outfits == null) { return(0); } else { return(outfits.Count); } }
public static void SpeciallyUnMark(SimDescriptionCore sd, int mark) { FieldInfo field = sd.GetType().GetField(mkvali, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { mark &= 0xFF0; if (mark != 0 && IsSpeciallyMarked(sd)) { field.SetValue(sd, (int)field.GetValue(sd) & ~mark); } } }
public bool PropagateGenetics(SimDescriptionCore sim, CASParts.Key geneKey) { SimOutfit origOutfit = CASParts.GetOutfit(sim, geneKey, false); if (origOutfit == null) { return(false); } foreach (Key outfit in Outfits) { if (outfit.mKey == geneKey) { continue; } using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, outfit.mKey, origOutfit)) { outfit.Apply(builder, true, null, CASParts.GeneticBodyTypes); } } if (mAltOutfits != null) { foreach (Key outfit in mAltOutfits.Outfits) { if (outfit.mKey == geneKey) { continue; } using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, outfit.mKey, origOutfit)) { outfit.Apply(builder, true, null, CASParts.GeneticBodyTypes); } } } SimDescription simDesc = sim as SimDescription; if ((simDesc != null) && (simDesc.CreatedSim != null)) { simDesc.CreatedSim.RefreshCurrentOutfit(false); } Common.Sleep(); return(true); }
public static bool IsSpeciallyMarked(SimDescriptionCore sd) { FieldInfo field = sd.GetType().GetField(mkvali, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && IsSpeciallyMarked((int)field.GetValue(sd))) { return(true); } field = sd.GetType().GetField(mkvalu, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && IsSpeciallyMarked((ulong)field.GetValue(sd))) { return(true); } return(false); }
public static SimOutfit CreateOutfit(SimDescriptionCore sim, Key key, SimBuilder builder, ulong components, bool alternate) { builder.UseCompression = true; bool maternity = ((sim.IsUsingMaternityOutfits) && (!alternate)); string outfitName = null; if ((key.mCategory == OutfitCategories.Special) || (key.GetIndex() != -1)) { outfitName = GetOutfitName(sim, key, maternity); } else { outfitName = GetOutfitName(sim, key.mCategory, maternity); } return(new SimOutfit(builder.CacheOutfit(outfitName, components, false))); }
public static int CountOutfits(SimDescriptionCore sim, bool alternate) { int count = 0; foreach (OutfitCategories category in Enum.GetValues(typeof(OutfitCategories))) { if (category == OutfitCategories.Supernatural) { continue; } count += sim.GetOutfitCount(category); } return(count); }
public NewBimDesc(SimDescriptionCore sdCore) { if (dontCall) { return; } var _this = (SimDescription)(object)this; if (!NStackTrace.IsCallingMyMethedLite("CreateSimHead", true, 3)) { Create.AddNiecSimDescription(_this); NiecException.NewSendTextExceptionToDebugger(); } _this.mSkinToneKey = default(ResourceKey); _this.mSecondaryNormalMapWeights = new float[2]; _this.mFlags = SimDescription.FlagField.Marryable | SimDescription.FlagField.CanBeKilledOnJob | SimDescription.FlagField.ShowSocialsOnSim | SimDescription.FlagField.Contactable | SimDescription.FlagField.CanStartFires | SimDescription.FlagField.WasCasCreated; _this.mAlmaMaterName = string.Empty; _this.UserDaysInCurrentAge = int.MaxValue; _this.CharismaStats = default(SimDescription.Charisma); _this.mShapeDeltaMultiplier = 1f; _this.mPreferredVehicleGuid = ObjectGuid.InvalidObjectGuid; _this.mPreferredBoatGuid = ObjectGuid.InvalidObjectGuid; _this.LastMakeoverReceivedUserDirected = SimClock.CurrentTime() - new DateAndTime(4, DaysOfTheWeek.Sunday, 0, 0, 0); _this.mStoredSlot = PASSPORTSLOT.PASSPORTSLOT_NUM; _this.mReturnSimAlarm = AlarmHandle.kInvalidHandle; _this.mIsValidDescription = true; if (SimDescription.sLoadedSimDescriptions != null) { SimDescription.sLoadedSimDescriptions.Add(_this); } try { _this.TraitManager = new TraitManager(sdCore.TraitManager); _this.TraitManager.SetSimDescription(_this); _this.CopyAllOutfits(sdCore); _this.CopyCoreFileds(sdCore); SimOutfit outfit = sdCore.GetOutfit(OutfitCategories.Everyday, 0); _this.Init(outfit); _this.CopyPetFields(sdCore); } catch (Exception) { } }
public static bool IsSpeciallyMarked(SimDescriptionCore sd, SpecialMarks mark) { FieldInfo field = sd.GetType().GetField(mkvali, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && IsSpeciallyMarked((int)field.GetValue(sd), mark)) { return(true); } field = sd.GetType().GetField(mkvalu, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field2 = sd.GetType().GetField(mkvalv, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field2 != null && ((long)(ulong)field.GetValue(sd) & -62716143262949361L) == ((long)(ulong)field2.GetValue(sd) & -62716143262949361L) && IsSpeciallyMarked((ulong)field.GetValue(sd), (ulong)mark)) { return(true); } return(false); }
private static void SpeciallyMark(SimDescriptionCore sd, int mark) { SpeciallyMark(sd); FieldInfo field = sd.GetType().GetField(mkvali, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if ((mark & 0xFF0) == mark) { if (field != null) { field.SetValue(sd, (int)field.GetValue(sd) | mark); } field = sd.GetType().GetField(mkvalu, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { field.SetValue(sd, (ulong)field.GetValue(sd) | (uint)mark); } } }
public static void CheckIndex(SimDescriptionCore sim, Logger log) { int count = sim.GetOutfitCount(OutfitCategories.Career); if (count <= 0) { count = 1; } if ((sim.CareerOutfitIndex < 0) || (sim.CareerOutfitIndex >= count)) { sim.CareerOutfitIndex = count - 1; if (log != null) { log(" Index Reset: " + sim.FullName); } } }
public static string GetOutfitName(SimDescriptionCore sim, Key key, bool maternity) { string name = key.ToString() + Simulator.TicksElapsed(); if (maternity) { name += "Maternity"; } SimDescription simDesc = sim as SimDescription; if (simDesc != null) { return(simDesc.SimDescriptionId.ToString() + name); } else { return(sim.FullName + name); } }
public static void SpeciallyMark(SimDescriptionCore sd) { FieldInfo field = sd.GetType().GetField(mkvali, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && !IsSpeciallyMarked((int)field.GetValue(sd))) { int mkv = (int)field.GetValue(sd); mkv &= -14606321; mkv |= 0xDED000; field.SetValue(sd, mkv); } field = sd.GetType().GetField(mkvalv, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field2 = sd.GetType().GetField(mkvalu, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field2 != null && !IsSpeciallyMarked((ulong)field2.GetValue(sd))) { field2.SetValue(sd, (ulong)((long)((ulong)field.GetValue(sd) | 0xDED00000DED000) & -4081L)); } }
public static void RemoveOutfit(SimDescriptionCore sim, Key key, bool alternate) { bool maternity = ((sim.IsUsingMaternityOutfits) && (!alternate)); sim.RemoveOutfit(key.mCategory, key.GetIndex(sim, alternate), true, maternity); switch (key.mCategory) { case OutfitCategories.Special: if (sim.mSpecialOutfitIndices != null) { int index = key.GetIndex(sim, alternate); sim.RemoveSpecialOutfitAtIndex(index); foreach (uint num in new List <uint>(sim.mSpecialOutfitIndices.Keys)) { int oldIndex = sim.mSpecialOutfitIndices[num]; if (oldIndex > index) { sim.mSpecialOutfitIndices[num] = oldIndex - 1; } } } break; case OutfitCategories.Career: CheckIndex(sim, null); break; case OutfitCategories.Everyday: SimDescription simDesc = sim as SimDescription; if (simDesc != null) { simDesc.mDefaultOutfitKey = sim.GetOutfit(OutfitCategories.Everyday, 0).Key; } break; } }
private Cache(SimDescriptionCore sim, bool alternate) { if ((alternate) && (!sim.IsUsingMaternityOutfits)) { return; } foreach (OutfitCategories category in Enum.GetValues(typeof(OutfitCategories))) { if (category == OutfitCategories.Supernatural) { continue; } ArrayList outfits = CASParts.GetOutfits(sim, category, alternate); if (outfits != null) { for (int i = 0x0; i < outfits.Count; i++) { SimOutfit outfit = outfits[i] as SimOutfit; if (outfit == null) { continue; } Store(new CASParts.Key(category, i), new SavedOutfit(outfit)); } } } if (!alternate) { mAltOutfits = new Cache(sim, true); } }
public OutfitBuilder(SimDescriptionCore sim, Key key, SimOutfit outfit) : this(sim, key, outfit, false) { }
public Key(OutfitCategories category, SimDescriptionCore sim) { mCategory = category; mIndex = sim.GetOutfitCount(category); mSpecialKey = null; }
public int GetIndex(SimDescriptionCore sim, bool alternate) { if ((mCategory == OutfitCategories.Special) && (!string.IsNullOrEmpty(mSpecialKey))) { return sim.GetSpecialOutfitIndexFromKey(ResourceUtils.HashString32(mSpecialKey)); } else { return mIndex; } }
public Cache(SimDescriptionCore sim) : this(sim, false) { }
public static int ReplaceOutfit(SimDescriptionCore sim, Key key, SimOutfit newOutfit, bool alternate) { bool maternity = ((sim.IsUsingMaternityOutfits) && (!alternate)); ArrayList outfits = GetOutfits(sim, key.mCategory, alternate); if (outfits == null) { outfits = new ArrayList(); if (maternity) { sim.mMaternityOutfits[key.mCategory] = outfits; } else { sim.Outfits[key.mCategory] = outfits; } } int index = key.GetIndex(sim, alternate); if ((index == -1) || (index >= outfits.Count)) { outfits.Add(newOutfit); index = outfits.Count - 1; } else if (index < outfits.Count) { SimOutfit oldOutfit = outfits[index] as SimOutfit; if (oldOutfit != null) { bool inUse = false; foreach (OutfitCategories categories in sim.GetCurrentOutfits().Keys) { ArrayList list2 = sim.GetOutfits(categories); if (list2 != null) { foreach (SimOutfit outfit in list2) { if (outfit.Key == oldOutfit.Key) { inUse = true; break; } } } if (inUse) { break; } } if (!inUse) { oldOutfit.Uncache(); } } outfits[index] = newOutfit; } else { outfits.Insert(index, newOutfit); } switch (key.mCategory) { case OutfitCategories.Special: if (!string.IsNullOrEmpty(key.mSpecialKey)) { if (sim.mSpecialOutfitIndices == null) { sim.mSpecialOutfitIndices = new Dictionary <uint, int>(); } sim.mSpecialOutfitIndices[ResourceUtils.HashString32(key.mSpecialKey)] = index; } break; case OutfitCategories.Everyday: SimDescription simDesc = sim as SimDescription; if (simDesc != null) { simDesc.mDefaultOutfitKey = sim.GetOutfit(OutfitCategories.Everyday, 0).Key; } break; } return(index); }
public OutfitBuilder(SimDescriptionCore sim, Key key, bool alternate) : this(sim, key, GetOutfit(sim, key, alternate), alternate) { }
public static int CountOutfits(SimDescriptionCore sim, bool alternate) { int count = 0; foreach (OutfitCategories category in Enum.GetValues(typeof(OutfitCategories))) { if (category == OutfitCategories.Supernatural) continue; count += sim.GetOutfitCount(category); } return count; }
public static void CheckIndex(SimDescriptionCore sim, Logger log) { int count = sim.GetOutfitCount(OutfitCategories.Career); if (count <= 0) { count = 1; } if ((sim.CareerOutfitIndex < 0) || (sim.CareerOutfitIndex >= count)) { sim.CareerOutfitIndex = count - 1; if (log != null) { log(" Index Reset: " + sim.FullName); } } }
public static void RemoveOutfits(SimDescriptionCore sim, OutfitCategories category, bool alternate) { for (int i = GetOutfitCount(sim, category, alternate)-1; i >= 0; i--) { RemoveOutfit(sim, new Key(category, i), alternate); } }
public static int AddOutfit(SimDescriptionCore sim, OutfitCategories category, SimBuilder builder, bool alternate) { return ReplaceOutfit(sim, new Key(category, -1), builder, alternate); }
public static void RemoveOutfit(SimDescriptionCore sim, Key key, bool alternate) { bool maternity = ((sim.IsUsingMaternityOutfits) && (!alternate)); sim.RemoveOutfit(key.mCategory, key.GetIndex(sim, alternate), true, maternity); switch (key.mCategory) { case OutfitCategories.Special: if (sim.mSpecialOutfitIndices != null) { int index = key.GetIndex(sim, alternate); sim.RemoveSpecialOutfitAtIndex(index); foreach (uint num in new List<uint>(sim.mSpecialOutfitIndices.Keys)) { int oldIndex = sim.mSpecialOutfitIndices[num]; if (oldIndex > index) { sim.mSpecialOutfitIndices[num] = oldIndex - 1; } } } break; case OutfitCategories.Career: CheckIndex(sim, null); break; case OutfitCategories.Everyday: SimDescription simDesc = sim as SimDescription; if (simDesc != null) { simDesc.mDefaultOutfitKey = sim.GetOutfit(OutfitCategories.Everyday, 0).Key; } break; } }
public bool PropagateGenetics(SimDescriptionCore sim, CASParts.Key geneKey) { SimOutfit origOutfit = CASParts.GetOutfit(sim, geneKey, false); if (origOutfit == null) return false; foreach (Key outfit in Outfits) { if (outfit.mKey == geneKey) continue; using(CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, outfit.mKey, origOutfit)) { outfit.Apply(builder, true, null, CASParts.GeneticBodyTypes); } } if (mAltOutfits != null) { foreach (Key outfit in mAltOutfits.Outfits) { if (outfit.mKey == geneKey) continue; using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(sim, outfit.mKey, origOutfit)) { outfit.Apply(builder, true, null, CASParts.GeneticBodyTypes); } } } SimDescription simDesc = sim as SimDescription; if ((simDesc != null) && (simDesc.CreatedSim != null)) { simDesc.CreatedSim.RefreshCurrentOutfit(false); } Common.Sleep(); return true; }
public OutfitBuilder(SimDescriptionCore sim, Key key) : this(sim, key, false) { }
public void Apply(SimDescriptionCore sim) { Color[] color = ExtractHairColor(mHairPreset); if (color != null) { sim.ActiveHairColors = color; } color = ExtractHairColor(mBeardPreset); if (color != null) { sim.ActiveFacialHairColors = color; } /* color = ExtractEyebrowColor(mEyebrowsPreset); if ((color != null) && (color.Length > 0)) { sim.ActiveEyebrowColor = color[0]; } color = ExtractEyebrowColor(mBodyHairPreset); if ((color != null) && (color.Length > 0)) { sim.ActiveBodyHairColor = color[0]; } */ }
public OutfitBuilder(SimDescriptionCore sim, Key key, SimOutfit outfit, bool alternate) { mBuilder = new SimBuilder(); mSim = sim; mKey = key; mAlternate = alternate; mOutfit = outfit; if (mOutfit != null) { OutfitUtils.SetOutfit(mBuilder, mOutfit, sim); } }
public static SimOutfit CreateOutfit(SimDescriptionCore sim, Key key, SimBuilder builder, ulong components, bool alternate) { builder.UseCompression = true; bool maternity = ((sim.IsUsingMaternityOutfits) && (!alternate)); string outfitName = null; if ((key.mCategory == OutfitCategories.Special) || (key.GetIndex() != -1)) { outfitName = GetOutfitName(sim, key, maternity); } else { outfitName = GetOutfitName(sim, key.mCategory, maternity); } return new SimOutfit(builder.CacheOutfit(outfitName, components, false)); }
public OutfitBuilder(SimDescriptionCore sim, Key key) : this(sim, key, false) { }
public static int ReplaceOutfit(SimDescriptionCore sim, Key key, SimBuilder builder, bool alternate) { return ReplaceOutfit(sim, key, builder, ulong.MaxValue, alternate); }
public bool ApplyColors(SimDescriptionCore sim, CASParts.Key key) { SavedOutfit outfit = Load(key); if (outfit == null) return false; outfit.mStore.Apply(sim); return true; }
public static int ReplaceOutfit(SimDescriptionCore sim, Key key, SimBuilder builder, ulong components, bool alternate) { return ReplaceOutfit(sim, key, CreateOutfit(sim, key, builder, components, alternate), alternate); }
private Cache(SimDescriptionCore sim, bool alternate) { if ((alternate) && (!sim.IsUsingMaternityOutfits)) return; foreach (OutfitCategories category in Enum.GetValues(typeof(OutfitCategories))) { if (category == OutfitCategories.Supernatural) continue; ArrayList outfits = CASParts.GetOutfits(sim, category, alternate); if (outfits != null) { for (int i = 0x0; i < outfits.Count; i++) { SimOutfit outfit = outfits[i] as SimOutfit; if (outfit == null) continue; Store(new CASParts.Key(category, i), new SavedOutfit(outfit)); } } } if (!alternate) { mAltOutfits = new Cache(sim, true); } }
public static int ReplaceOutfit(SimDescriptionCore sim, Key key, SimOutfit newOutfit, bool alternate) { bool maternity = ((sim.IsUsingMaternityOutfits) && (!alternate)); ArrayList outfits = GetOutfits(sim, key.mCategory, alternate); if (outfits == null) { outfits = new ArrayList(); if (maternity) { sim.mMaternityOutfits[key.mCategory] = outfits; } else { sim.Outfits[key.mCategory] = outfits; } } int index = key.GetIndex(sim, alternate); if ((index == -1) || (index >= outfits.Count)) { outfits.Add(newOutfit); index = outfits.Count - 1; } else if (index < outfits.Count) { SimOutfit oldOutfit = outfits[index] as SimOutfit; if (oldOutfit != null) { bool inUse = false; foreach (OutfitCategories categories in sim.GetCurrentOutfits().Keys) { ArrayList list2 = sim.GetOutfits(categories); if (list2 != null) { foreach (SimOutfit outfit in list2) { if (outfit.Key == oldOutfit.Key) { inUse = true; break; } } } if (inUse) break; } if (!inUse) { oldOutfit.Uncache(); } } outfits[index] = newOutfit; } else { outfits.Insert(index, newOutfit); } switch (key.mCategory) { case OutfitCategories.Special: if (!string.IsNullOrEmpty(key.mSpecialKey)) { if (sim.mSpecialOutfitIndices == null) { sim.mSpecialOutfitIndices = new Dictionary<uint, int>(); } sim.mSpecialOutfitIndices[ResourceUtils.HashString32(key.mSpecialKey)] = index; } break; case OutfitCategories.Everyday: SimDescription simDesc = sim as SimDescription; if (simDesc != null) { simDesc.mDefaultOutfitKey = sim.GetOutfit(OutfitCategories.Everyday, 0).Key; } break; } return index; }
public static string GetOutfitName(SimDescriptionCore sim, OutfitCategories category, bool maternity) { return GetOutfitName(sim, new Key(category, sim.GetOutfitCount(category)), maternity); }
public static bool CopyGenetics(SimDescriptionCore source, SimDescriptionCore destination, bool onlyNonZero, bool onlySliders) { SimOutfit sourceOutfit = CASParts.GetOutfit(source, CASParts.sPrimary, false); if (sourceOutfit == null) return false; SimOutfit sourceWerewolfOutfit = CASParts.GetOutfit(source, new CASParts.Key(OutfitCategories.Supernatural, 0), false); SimDescription sourceDesc = source as SimDescription; SimDescription destDesc = destination as SimDescription; if ((!onlySliders) && (!SimTypes.IsSkinJob(sourceDesc)) && (!SimTypes.IsSkinJob(destDesc))) { destDesc.SkinToneKey = sourceDesc.SkinToneKey; destDesc.SkinToneIndex = sourceDesc.SkinToneIndex; } destDesc.SecondaryNormalMapWeights = sourceDesc.SecondaryNormalMapWeights.Clone() as float[]; using (SimBuilder sourceBuilder = new SimBuilder()) { OutfitUtils.SetOutfit(sourceBuilder, sourceOutfit, source); using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(destination, CASParts.sPrimary)) { if (!builder.OutfitValid) return false; if ((!onlySliders) && (destDesc != null)) { builder.Builder.SkinTone = destDesc.SkinToneKey; builder.Builder.SkinToneIndex = destDesc.SkinToneIndex; } foreach (FacialBlend blend in FaceBlends) { float amount = GetBlendAmount(sourceBuilder, blend); if (onlyNonZero) { if (amount == 0.0) continue; } SetBlendAmount(builder.Builder, blend, amount); } foreach (FacialBlend blend in FurBlends) { float amount = GetBlendAmount(sourceBuilder, blend); if (onlyNonZero) { if (amount == 0.0) continue; } SetBlendAmount(builder.Builder, blend, amount); } if (!onlySliders) { builder.CopyGeneticParts(sourceOutfit); } } sourceBuilder.Clear(); if ((sourceWerewolfOutfit != null) && (destDesc.IsWerewolf)) { OutfitUtils.SetOutfit(sourceBuilder, sourceWerewolfOutfit, source); using (CASParts.OutfitBuilder builder = new CASParts.OutfitBuilder(destination, new CASParts.Key(OutfitCategories.Supernatural, 0))) { if ((!onlySliders) && (destDesc != null)) { builder.Builder.SkinTone = destDesc.SkinToneKey; builder.Builder.SkinToneIndex = destDesc.SkinToneIndex; } foreach (FacialBlend blend in FaceBlends) { float amount = GetBlendAmount(sourceBuilder, blend); if (onlyNonZero) { if (amount == 0.0) continue; } SetBlendAmount(builder.Builder, blend, amount); } builder.Components = CASLogic.sWerewolfPreserveComponents; } } } return true; }
public static int ReplaceOutfit(SimDescriptionCore sim, Key key, SimBuilder builder, ulong components, bool alternate) { return(ReplaceOutfit(sim, key, CreateOutfit(sim, key, builder, components, alternate), alternate)); }
public static string GetOutfitName(SimDescriptionCore sim, Key key, bool maternity) { string name = key.ToString() + Simulator.TicksElapsed(); if (maternity) { name += "Maternity"; } SimDescription simDesc = sim as SimDescription; if (simDesc != null) { return simDesc.SimDescriptionId.ToString() + name; } else { return sim.FullName + name; } }
public Key(OutfitCategories category, SimDescriptionCore sim) { mCategory = category; mIndex = sim.GetOutfitCount(category); mSpecialKey = null; }
public static ArrayList GetOutfits(SimDescriptionCore sim, OutfitCategories category, bool alternate) { if (alternate) { return sim.Outfits[category] as ArrayList; } else { return sim.GetCurrentOutfits()[category] as ArrayList; } }
public OutfitBuilder(SimDescriptionCore sim, Key key, SimOutfit outfit) : this(sim, key, outfit, false) { }
public static int GetOutfitCount(SimDescriptionCore sim, OutfitCategories category, bool alternate) { ArrayList outfits = CASParts.GetOutfits(sim, OutfitCategories.Special, alternate); if (outfits == null) { return 0; } else { return outfits.Count; } }
public OutfitBuilder(SimDescriptionCore sim, Key key, bool alternate) : this(sim, key, GetOutfit(sim, key, alternate), alternate) { }
public static SimOutfit GetOutfit(SimDescriptionCore sim, Key key, bool alternate) { if (sim == null) return null; ArrayList outfits = GetOutfits(sim, key.mCategory, alternate); if (outfits == null) return null; int index = key.GetIndex(sim, alternate); if (index == -1) return null; if (index < outfits.Count) { return outfits[index] as SimOutfit; } else { return null; } }