internal void CalculatePush(Wearing wearing) { if (wearing == Wearing.Bra) { CalculatePushFromClothes(CurrentBraData, CurrentBraData.UseAdvanced); return; } else if (wearing == Wearing.Top) { CalculatePushFromClothes(CurrentTopData, CurrentTopData.UseAdvanced); return; } else if (CurrentTopData.UseAdvanced) { CalculatePushFromClothes(CurrentTopData, true); return; } else if (CurrentBraData.UseAdvanced) { CalculatePushFromClothes(CurrentBraData, true); return; } var combo = new ClothData(); combo.Firmness = Math.Max(CurrentBraData.Firmness, CurrentTopData.Firmness); combo.Lift = Math.Max(CurrentBraData.Lift, CurrentTopData.Lift); combo.Squeeze = Math.Max(CurrentBraData.Squeeze, CurrentTopData.Squeeze); combo.PushTogether = Math.Max(CurrentBraData.PushTogether, CurrentTopData.PushTogether); combo.CenterNipples = Math.Max(CurrentBraData.CenterNipples, CurrentTopData.CenterNipples); combo.FlattenNipples = CurrentBraData.FlattenNipples || CurrentTopData.FlattenNipples; combo.EnablePushup = true; CalculatePushFromClothes(combo, false); }
public ActionResult AddWearingToWardrobe(Wearing wearing) { try { _context.Wearing.Add(wearing); _context.SaveChanges(); } catch { return(Conflict()); } return(CreatedAtRoute("GetWearing", new { id = wearing.id }, wearing)); }
/// <summary> /// Recalculate the body based on the clothing state and Pushup settings. /// </summary> /// <param name="recalculateIfCharacterLoading">Whether to perform recalculation when the character is in the process of loading. Set this to false if it would cause problems.</param> /// <param name="coroutine">If true, wait one frame before recalculating.</param> public void RecalculateBody(bool recalculateIfCharacterLoading = true, bool coroutine = false) { if (CharacterLoading && !recalculateIfCharacterLoading) { return; } //Body will sometimes be null in main game, wait for it to not be null if (ChaControl.objBody == null) { coroutine = true; } if (coroutine) { StartCoroutine(RecalculateBodyCoroutine()); return; } if (MakerAPI.InsideMaker && !MakerAPI.InsideAndLoaded) { return; } //Set all the sliders to the base body values SliderManager.SlidersActive = true; MapBodyInfoToChaFile(BaseData); Wearing nowWearing = CurrentlyWearing; if (nowWearing != Wearing.None) { SliderManager.SlidersActive = false; CalculatePush(nowWearing); MapBodyInfoToChaFile(CurrentPushupData); } SliderManager.SlidersActive = true; }
/// <summary> /// Recalculate the body based on the clothing state and Pushup settings. /// </summary> /// <param name="recalculateIfCharacterLoading">Whether to perform recalculation when the character is in the process of loading. Set this to false if it would cause problems.</param> /// <param name="coroutine">If true, wait one frame before recalculating.</param> public void RecalculateBody(bool recalculateIfCharacterLoading = true, bool coroutine = false) { if (CharacterLoading && !recalculateIfCharacterLoading) { return; } //Body will sometimes be null in main game, wait for it to not be null if (ChaControl.objBody == null) { coroutine = true; } if (coroutine) { StartCoroutine(RecalculateBodyCoroutine()); return; } if (MakerAPI.InsideMaker && !MakerAPI.InsideAndLoaded) { return; } Wearing nowWearing = CurrentlyWearing; if (nowWearing == Wearing.None) { MapBodyInfoToChaFile(BaseData); } else { CalculatePush(nowWearing); MapBodyInfoToChaFile(CurrentPushupData); } }