private void InitSliders(PushupController pushUpController)
            {
                var cvsBreast = CustomBase.Instance.gameObject.GetComponentInChildren <CvsBreast>(true);

                SetupSlider(pushUpController.BaseData.Size, f => pushUpController.BaseData.Size = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexSize] = f, "BustSize", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.VerticalPosition, f => pushUpController.BaseData.VerticalPosition     = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexVerticalPosition] = f, "BustY", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.HorizontalAngle, f => pushUpController.BaseData.HorizontalAngle       = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexHorizontalAngle] = f, "BustRotX", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.HorizontalPosition, f => pushUpController.BaseData.HorizontalPosition = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexHorizontalPosition] = f, "BustX", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.VerticalAngle, f => pushUpController.BaseData.VerticalAngle           = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexVerticalAngle] = f, "BustRotY", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.Depth, f => pushUpController.BaseData.Depth         = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexDepth] = f, "BustSharp", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.Roundness, f => pushUpController.BaseData.Roundness = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexRoundness] = f, "BustForm", pushUpController, cvsBreast);

                SetupSlider(pushUpController.BaseData.Softness, f => pushUpController.BaseData.Softness = f, f => pushUpController.ChaControl.fileBody.bustSoftness = f, "BustSoftness", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.Weight, f => pushUpController.BaseData.Weight     = f, f => pushUpController.ChaControl.fileBody.bustWeight = f, "BustWeight", pushUpController, cvsBreast);

                SetupSlider(pushUpController.BaseData.AreolaDepth, f => pushUpController.BaseData.AreolaDepth = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexAreolaDepth] = f, "AreolaBulge", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.NippleWidth, f => pushUpController.BaseData.NippleWidth = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexNippleWidth] = f, "NipWeight", pushUpController, cvsBreast);
                SetupSlider(pushUpController.BaseData.NippleDepth, f => pushUpController.BaseData.NippleDepth = f, f => pushUpController.ChaControl.fileBody.shapeValueBody[PushupConstants.IndexNippleDepth] = f, "NipStand", pushUpController, cvsBreast);
            }
Ejemplo n.º 2
0
        private static void ReloadPushup()
        {
            _pushUpController = GetMakerController();
            if (_sliderManager == null)
            {
                _sliderManager = new SliderManager(_pushUpController);
            }
            _activeClothData = SelectButtons.Value == 0 ? _pushUpController.CurrentBraData : _pushUpController.CurrentTopData;

            _sliderManager.ReinitSliders(_pushUpController);

            UpdateToggleSubscription(EnablePushupToggle, _activeClothData.EnablePushup, b => { _activeClothData.EnablePushup = b; });

            UpdateSliderSubscription(PushSizeSlider, _activeClothData.Size, f => { _activeClothData.Size = f; });
            UpdateSliderSubscription(PushVerticalPositionSlider, _activeClothData.VerticalPosition, f => { _activeClothData.VerticalPosition = f; });
            UpdateSliderSubscription(PushHorizontalAngleSlider, _activeClothData.HorizontalAngle, f => { _activeClothData.HorizontalAngle = f; });
            UpdateSliderSubscription(PushHorizontalPositionSlider, _activeClothData.HorizontalPosition, f => { _activeClothData.HorizontalPosition = f; });
            UpdateSliderSubscription(PushVerticalAngleSlider, _activeClothData.VerticalAngle, f => { _activeClothData.VerticalAngle = f; });
            UpdateSliderSubscription(PushDepthSlider, _activeClothData.Depth, f => { _activeClothData.Depth = f; });
            UpdateSliderSubscription(PushRoundnessSlider, _activeClothData.Roundness, f => { _activeClothData.Roundness = f; });

            UpdateSliderSubscription(PushSoftnessSlider, _activeClothData.Softness, f => { _activeClothData.Softness = f; });
            UpdateSliderSubscription(PushWeightSlider, _activeClothData.Weight, f => { _activeClothData.Weight = f; });

            UpdateSliderSubscription(PushAreolaDepthSlider, _activeClothData.AreolaDepth, f => { _activeClothData.AreolaDepth = f; });
            UpdateSliderSubscription(PushNippleWidthSlider, _activeClothData.NippleWidth, f => { _activeClothData.NippleWidth = f; });
            UpdateSliderSubscription(PushNippleDepthSlider, _activeClothData.NippleDepth, f => { _activeClothData.NippleDepth = f; });

            UpdateSliderSubscription(FirmnessSlider, _activeClothData.Firmness, f => { _activeClothData.Firmness = f; });
            UpdateSliderSubscription(LiftSlider, _activeClothData.Lift, f => { _activeClothData.Lift = f; });
            UpdateSliderSubscription(PushTogetherSlider, _activeClothData.PushTogether, f => { _activeClothData.PushTogether = f; });
            UpdateSliderSubscription(SqueezeSlider, _activeClothData.Squeeze, f => { _activeClothData.Squeeze = f; });
            UpdateSliderSubscription(CenterSlider, _activeClothData.CenterNipples, f => { _activeClothData.CenterNipples = f; });

            UpdateToggleSubscription(FlattenNippleToggle, _activeClothData.FlattenNipples, b => { _activeClothData.FlattenNipples = b; });

            UpdateToggleSubscription(AdvancedModeToggle, _activeClothData.UseAdvanced, b => { _activeClothData.UseAdvanced = b; });
        }
Ejemplo n.º 3
0
 private void MakerExiting(object sender, EventArgs e)
 {
     _pushUpController = null;
     _sliderManager    = null;
 }
            private void SetupSlider(float baseValue, Action <float> sliderSetter, Action <float> bodySetter, string fieldname, PushupController pushupController, object cvsBreast)
            {
                //Find the sliders for the chest area
                var slider = (Slider)Traverse.Create(cvsBreast).Field($"sld{fieldname}").GetValue();
                var input  = (TMP_InputField)Traverse.Create(cvsBreast).Field($"inp{fieldname}").GetValue();

                bodySetter(baseValue);

                slider.value = baseValue;
                input.text   = CustomBase.ConvertTextFromRate(0, 100, baseValue);

                if (!DoEvents)
                {
                    return;
                }
                slider.onValueChanged.AsObservable().Subscribe(value =>
                {
                    if (!DoEvents)
                    {
                        return;
                    }

                    //When user is updating the chest sliders set the BaseData
                    sliderSetter(value);
                    input.text = Math.Round(value * 100).ToString(CultureInfo.InvariantCulture);
                    pushupController.RecalculateBody();
                });
            }
 public void ReinitSliders(PushupController pushUpController)
 {
     DoEvents = false;
     InitSliders(pushUpController);
     DoEvents = true;
 }
 internal SliderManager(PushupController pushUpController) => InitSliders(pushUpController);