Пример #1
0
        private static void RegisterMakerControls(Stiletto plugin, RegisterSubCategoriesEvent e)
        {
            // Doesn't apply to male characters
            if (MakerAPI.GetMakerSex() == 0)
            {
                return;
            }

            var shoesCategory = MakerConstants.Clothes.OuterShoes;
            var category      = new MakerCategory(shoesCategory.CategoryName, "stiletto", shoesCategory.Position + 1, "Stiletto");

            e.AddSubCategory(category);

            slider_AngleAnkle = e.AddControl(new MakerSlider(category, "AngleAnkle", 0f, 60f, 0f, plugin)
            {
                StringToValue = CreateStringToValueFunc(10f), ValueToString = CreateValueToStringFunc(10f),
            });
            slider_AngleLeg = e.AddControl(new MakerSlider(category, "AngleLeg", 0f, 60f, 0f, plugin)
            {
                StringToValue = CreateStringToValueFunc(10f), ValueToString = CreateValueToStringFunc(10f)
            });
            slider_Height = e.AddControl(new MakerSlider(category, "Height", 0f, 0.5f, 0f, plugin)
            {
                StringToValue = CreateStringToValueFunc(1000f), ValueToString = CreateValueToStringFunc(1000f)
            });

            slider_AngleAnkle.ValueChanged.Subscribe(x => MakerAPI.GetCharacterControl().GetComponent <HeelInfo>().SafeProc(y => y.AnkleAnglef = x));
            slider_AngleLeg.ValueChanged.Subscribe(x => MakerAPI.GetCharacterControl().GetComponent <HeelInfo>().SafeProc(y => y.LegAnglef     = x));
            slider_Height.ValueChanged.Subscribe(x => MakerAPI.GetCharacterControl().GetComponent <HeelInfo>().SafeProc(y => y.Heightf         = x));
        }
Пример #2
0
        internal static CharacterSex GuessSex(this ICharaFileInfo fileInfo)
        {
            try
            {
                if (MakerAPI.InsideMaker)
                {
                    return((CharacterSex)MakerAPI.GetMakerSex());
                }
            }
            catch (Exception err)
            {
                Logger?.LogException(err, $"{nameof(GuessSex)}: Unexpected error determining sex from Maker");
            }

            try
            {
                return((CharacterSex)Configuration.GuessSex(fileInfo.Club, fileInfo.Personality));
            }
            catch (Exception err)
            {
                Logger?.LogException(err,
                                     $"{nameof(GuessSex)}: Unexpected error attempting to guess sex for {fileInfo.GetPrettyTypeFullName()}");
            }

            return(CharacterSex.Unspecified);
        }
Пример #3
0
 private void RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
 {
     if (MakerAPI.GetMakerSex() == 0)
     {
         _toggleEnabled = e.AddControl(new MakerToggle(MakerConstants.Parameter.Character, "Character is a trap or a futa (changes gameplay)", this));
         _toggleEnabled.ValueChanged.Subscribe(val => GetMakerController().IsTrap = val);
     }
 }
Пример #4
0
        private static void MakerAPI_MakerBaseLoaded(object sender, RegisterSubCategoriesEvent e)
        {
            var female = MakerAPI.GetMakerSex() != 0;

            // This category is inaccessible from class maker
            var cat = new MakerCategory(MakerConstants.Body.CategoryName, "Pregnancy");

            e.AddSubCategory(cat);

            var hintColor = new Color(0.7f, 0.7f, 0.7f);

            var gameplayToggle = e.AddControl(new MakerToggle(cat, "Enable pregnancy progression", true, _pluginInstance));

            gameplayToggle.BindToFunctionController <PregnancyCharaController, bool>(controller => controller.Data.GameplayEnabled, (controller, value) => controller.Data.GameplayEnabled = value);
            e.AddControl(new MakerText(female ?
                                       "If off, the character can't get pregnant and current pregnancy will stop progressing." :
                                       "If on, belly will progressively get bigger. No other effects.",
                                       cat, _pluginInstance)
            {
                TextColor = hintColor
            });

            if (female)
            {
                var fertilityToggle = e.AddControl(new MakerSlider(cat, "Fertility", 0f, 1f, PregnancyData.DefaultFertility, _pluginInstance));
                fertilityToggle.BindToFunctionController <PregnancyCharaController, float>(controller => controller.Data.Fertility, (controller, value) => controller.Data.Fertility = value);

                e.AddControl(new MakerText("How likely this character is to get pregnant.", cat, _pluginInstance)
                {
                    TextColor = hintColor
                });
            }

            var weeksSlider = e.AddControl(new MakerSlider(cat, "Week of pregnancy", 0f, PregnancyData.LeaveSchoolWeek - 1f, 0f, _pluginInstance));

            weeksSlider.ValueToString = f => Mathf.RoundToInt(f).ToString();
            weeksSlider.StringToValue = s => int.Parse(s);
            weeksSlider.BindToFunctionController <PregnancyCharaController, float>(controller => controller.Data.Week, (controller, value) => controller.Data.Week = Mathf.RoundToInt(value));

            e.AddControl(new MakerText(female ?
                                       "If the character is pregnant when added to the game, the pregnancy will continue from this point." :
                                       "The only way for male characters to get pregnant is to manually set this slider above 0.",
                                       cat, _pluginInstance)
            {
                TextColor = hintColor
            });

            if (female)
            {
                var scheduleToggle = e.AddControl(new MakerRadioButtons(cat, _pluginInstance, "Menstruation schedule", "Default", "More risky", "Always safe", "Always risky"));
                scheduleToggle.BindToFunctionController <PregnancyCharaController, int>(controller => (int)controller.Data.MenstruationSchedule, (controller, value) => controller.Data.MenstruationSchedule = (MenstruationSchedule)value);

                e.AddControl(new MakerText("Changes how many risky days the character has in a cycle. Default is more safe days than risky days.", cat, _pluginInstance)
                {
                    TextColor = hintColor
                });
            }
        }
Пример #5
0
 private void MakerAPI_MakerFinishedLoading(object sender, EventArgs e)
 {
     if (MakerAPI.GetMakerSex() == 0)
     {
         CvsF_FaceType faceType = GameObject.Find("CharaCustom").transform.GetComponentInChildren <CvsF_FaceType>();
         faceType.transform.Find("Setting/Setting01/title").gameObject.SetActive(true);
         faceType.transform.Find("Setting/Setting01/SelectBox").gameObject.SetActive(true);
         faceType.transform.Find("Setting/Setting01/separate").gameObject.SetActive(true);
     }
 }
Пример #6
0
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            if (MakerAPI.GetMakerSex() != MaleSex)
            {
                var makerToggle = e.AddControl(new MakerToggle(MakerConstants.Body.All, "Male walking animations", this));

                makerToggle.BindToFunctionController <ReverseTrapController, bool>(
                    controller => controller.ForceMaleAnimations,
                    (controller, value) => controller.ForceMaleAnimations = value);
            }
        }
        internal static void InitHookLoad(CvsO_CharaLoad __instance)
        {
            _folderTreeView.DefaultPath = Path.Combine(Utils.NormalizePath(UserData.Path),
                                                       MakerAPI.GetMakerSex() == 0 ? "chara/male" : @"chara/female");
            _folderTreeView.CurrentFolder = _folderTreeView.DefaultPath;
            //_targetScene = GetAddSceneName();

            _makerCanvas = __instance.GetComponentInParent <Canvas>().gameObject;

            _charaLoad        = __instance;
            _charaLoadVisible = __instance.GetComponentsInParent <CanvasGroup>(true);
        }
Пример #8
0
        private static void RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            if (MakerAPI.GetMakerSex() == 0)
            {
                var category = MakerConstants.Parameter.Character;

                _toggleEnabled = e.AddControl(new MakerToggle(category, "Character is a trap or a futa (changes gameplay)", BecomeTrap.Instance));
                _toggleEnabled.ValueChanged.Subscribe(val => GetMakerController().IsTrap = val);

                _animType = e.AddControl(new MakerDropdown("Idle trap animation", _idleAnimations.Select(x => x.Value).ToArray(), category, 0, BecomeTrap.Instance));
                _animType.ValueChanged.Subscribe(i => GetMakerController().IdleAnimation = _idleAnimations[i].Key);
            }
        }
Пример #9
0
        private void PenisDropdownChanged(int ID)
        {
            var controller = GetController(MakerAPI.GetCharacterControl());

#if KK || KKS
            controller.PenisGUID    = ID == 0 || ID == 1 ? null : PenisList[ID];
            controller.DisplayPenis = ID != 1;
#elif AI || HS2
            controller.PenisGUID = ID == 0 ? null : PenisList[ID];
#else
            controller.PenisGUID    = ID == 0 ? null : PenisList[ID];
            controller.DisplayPenis = MakerAPI.GetMakerSex() == 0;
#endif
            controller.UpdateUncensor();
        }
Пример #10
0
        private static void RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            if (MakerAPI.GetMakerSex() == 0)
            {
                var category = MakerConstants.Parameter.Character;

                var isTrap = e.AddControl(new MakerToggle(category, "Character is a trap or a futa (changes gameplay)", BecomeTrap.Instance));
                isTrap.BindToFunctionController <BecomeTrapController, bool>(
                    (controller) => controller.IsTrap,
                    (controller, value) => controller.IsTrap = value);
                //todo change animation in maker as preview, surprisingly difficult might need to make anim override controller and override everything
                var animType = e.AddControl(new MakerDropdown("Idle trap animation", _idleAnimations.Select(x => x.Value).ToArray(), category, 0, BecomeTrap.Instance));
                animType.BindToFunctionController <BecomeTrapController, int>(
                    (controller) => Mathf.Max(0, _idleAnimations.FindIndex(pair => pair.Key == controller.IdleAnimation)),
                    (controller, value) => controller.IdleAnimation = _idleAnimations[value].Key);
            }
        }
Пример #11
0
        private static void RegisterMakerControls(object sender, RegisterSubCategoriesEvent e)
        {
            // Doesn't apply for male characters
            if (MakerAPI.GetMakerSex() == 0)
            {
                return;
            }

            var cat = MakerConstants.GetBuiltInCategory("05_ParameterTop", "tglH");

            _stretched = e.AddControl(new MakerToggle(cat, "Stretched hymen", false, _skinEffectsPlugin));
            _stretched.ValueChanged.Subscribe(b => GetMakerController().StretchedHymen = b);
            e.AddControl(new MakerText("Makes it much less likely that she will bleed during the first time.", cat, _skinEffectsPlugin)).TextColor = new Color(0.7f, 0.7f, 0.7f);
            _regen = e.AddControl(new MakerToggle(cat, "Hymen regenerates", false, _skinEffectsPlugin));
            _regen.ValueChanged.Subscribe(b => GetMakerController().HymenRegen = b);
            e.AddControl(new MakerText("The hymen grows back after a good night's sleep (to the state before sex).", cat, _skinEffectsPlugin)).TextColor = new Color(0.7f, 0.7f, 0.7f);
            _fragile = e.AddControl(new MakerToggle(cat, "Fragile v****a", false, _skinEffectsPlugin));
            _fragile.ValueChanged.Subscribe(b => GetMakerController().FragileVag = b);
            e.AddControl(new MakerText("When going at it very roughly has a chance to bleed, be gentle!", cat, _skinEffectsPlugin)).TextColor = new Color(0.7f, 0.7f, 0.7f);
        }
Пример #12
0
        private static void RegisterMakerControls(BaseUnityPlugin skinEffectsPlugin, RegisterCustomControlsEvent e)
        {
            // Doesn't apply to male characters
            if (MakerAPI.GetMakerSex() == 0)
            {
                return;
            }

            var cat = MakerConstants.GetBuiltInCategory("05_ParameterTop", "tglH");

            e.AddControl(new MakerToggle(cat, "Stretched hymen", false, skinEffectsPlugin))
            .BindToFunctionController <SkinEffectsController, bool>(controller => controller.StretchedHymen, (controller, value) => controller.StretchedHymen = value);
            e.AddControl(new MakerText("Makes it much less likely that she will bleed during the first time.", cat, skinEffectsPlugin)).TextColor             = new Color(0.7f, 0.7f, 0.7f);

            e.AddControl(new MakerToggle(cat, "Hymen regenerates", false, skinEffectsPlugin))
            .BindToFunctionController <SkinEffectsController, bool>(controller => controller.HymenRegen, (controller, value) => controller.HymenRegen   = value);
            e.AddControl(new MakerText("The hymen grows back after a good night's sleep (to the state before sex).", cat, skinEffectsPlugin)).TextColor = new Color(0.7f, 0.7f, 0.7f);

            e.AddControl(new MakerToggle(cat, "Fragile v****a", false, skinEffectsPlugin))
            .BindToFunctionController <SkinEffectsController, bool>(controller => controller.FragileVag, (controller, value) => controller.FragileVag = value);
            e.AddControl(new MakerText("When going at it very roughly has a chance to bleed, be gentle!", cat, skinEffectsPlugin)).TextColor          = new Color(0.7f, 0.7f, 0.7f);
        }
Пример #13
0
 private static void SelectTextCallback(IComponentTranslationContext context)
 {
     if (!_pointerCallbackRegistered || !MakerAPI.InsideMaker)
     {
         return;
     }
     // ReSharper disable once InvertIf
     if (ComponentTranslationHelpers.TryTranslateFullName(context,
                                                          t => t != null && PointerCallbackActiveTexts.Contains(t),
                                                          () => null, (CharacterSex)MakerAPI.GetMakerSex()))
     {
         context.IgnoreComponent();
     }
 }
Пример #14
0
        /// <summary>
        /// Initialize the character maker GUI
        /// </summary>
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            DoDropdownEvents = false;
            e.AddControl(new MakerText(PluginName, MakerConstants.Body.All, this));

            BodyList.Clear();
            BodyListDisplay.Clear();

            BodyList.Add("Default");
            BodyListDisplay.Add("Default");

            var characterSex = (byte)MakerAPI.GetMakerSex();

            foreach (BodyData bodyData in BodyDictionary.Select(x => x.Value)
                     .OrderByDescending(x => x.Sex == characterSex)
                     .ThenBy(x => x.Sex)
                     .ThenBy(x => x.DisplayName))
            {
                if (BodyAllowedInMaker(bodyData.Sex, characterSex))
                {
                    BodyList.Add(bodyData.BodyGUID);
                    BodyListDisplay.Add(BodyGuidToDisplayName(bodyData.BodyGUID));
                }
            }

            BodyDropdown = e.AddControl(new MakerDropdown("Body", BodyListDisplay.ToArray(), MakerConstants.Body.All, 0, this));
            BodyDropdown.ValueChanged.Subscribe(Observer.Create <int>(BodyDropdownChanged));
            void BodyDropdownChanged(int ID)
            {
                if (DoDropdownEvents == false)
                {
                    return;
                }

                var controller = GetController(MakerAPI.GetCharacterControl());

                controller.BodyGUID = ID == 0 ? null : BodyList[ID];
                controller.UpdateUncensor();
            }

            PenisList.Clear();
            PenisListDisplay.Clear();

            PenisList.Add("Default");
            PenisListDisplay.Add("Default");
            PenisList.Add("None");
            PenisListDisplay.Add("None");

            foreach (PenisData penis in PenisDictionary.Select(x => x.Value).OrderByDescending(x => x.DisplayName))
            {
                PenisList.Add(penis.PenisGUID);
                PenisListDisplay.Add(penis.DisplayName);
            }

            PenisDropdown = e.AddControl(new MakerDropdown("Penis", PenisListDisplay.ToArray(), MakerConstants.Body.All, characterSex == 0 ? 0 : 1, this));
            PenisDropdown.ValueChanged.Subscribe(Observer.Create <int>(PenisDropdownChanged));
            void PenisDropdownChanged(int ID)
            {
                if (DoDropdownEvents == false)
                {
                    return;
                }

                var controller = GetController(MakerAPI.GetCharacterControl());

                controller.PenisGUID    = ID == 0 || ID == 1 ? null : PenisList[ID];
                controller.DisplayPenis = ID == 1 ? false : true;
                controller.UpdateUncensor();
            }

            BallsList.Clear();
            BallsListDisplay.Clear();

            BallsList.Add("Default");
            BallsListDisplay.Add("Default");
            BallsList.Add("None");
            BallsListDisplay.Add("None");

            foreach (BallsData balls in BallsDictionary.Select(x => x.Value).OrderByDescending(x => x.DisplayName))
            {
                BallsList.Add(balls.BallsGUID);
                BallsListDisplay.Add(balls.DisplayName);
            }

            BallsDropdown = e.AddControl(new MakerDropdown("Balls", BallsListDisplay.ToArray(), MakerConstants.Body.All, characterSex == 0 ? 0 : 1, this));
            BallsDropdown.ValueChanged.Subscribe(Observer.Create <int>(BallsDropdownChanged));
            void BallsDropdownChanged(int ID)
            {
                if (DoDropdownEvents == false)
                {
                    return;
                }

                var controller = GetController(MakerAPI.GetCharacterControl());

                controller.BallsGUID    = ID == 0 || ID == 1 ? null : BallsList[ID];
                controller.DisplayBalls = ID == 1 ? false : true;
                controller.UpdateUncensor();
            }
        }
Пример #15
0
        internal static void MakerAPI_MakerBaseLoaded(object sender, RegisterSubCategoriesEvent e)
        {
            // Only female characters, unless plugin config says otherwise
            if (!PregnancyPlusPlugin.AllowMale.Value && MakerAPI.GetMakerSex() == 0)
            {
                return;
            }

            //clear last
            sliders = new List <MakerSlider>();

            //Set the menu location of the p+ sliders
            #if KK
            var cat = new MakerCategory(MakerConstants.Parameter.Character.CategoryName, "Pregnancy+");
            #elif HS2 || AI
            var cat = new MakerCategory(MakerConstants.Body.CategoryName, "Pregnancy+");
            #endif

            e.AddSubCategory(cat);

            var hintColor = new Color(0.7f, 0.7f, 0.7f);

            var gameplayToggle = e.AddControl(new MakerToggle(cat, "Enable Pregnancy+", true, _pluginInstance));
            gameplayToggle.BindToFunctionController <PregnancyPlusCharaController, bool>(controller => controller.infConfig.GameplayEnabled, (controller, value) => {
                var oldVal = controller.infConfig.GameplayEnabled;
                controller.infConfig.GameplayEnabled = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("If disabled, you won't see any pregnant effects.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });


            var size = e.AddControl(new MakerSlider(cat, inflationSizeMaker, SliderRange.inflationSize[0], SliderRange.inflationSize[1], ppDataDefaults.inflationSize, _pluginInstance));
            size.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationSize, (controller, value) => {
                var oldVal = controller.infConfig.inflationSize;
                controller.infConfig.inflationSize = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("The equivalent to number of weeks pregnant for Pregnancy+.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(size);


            var multiplier = e.AddControl(new MakerSlider(cat, inflationMultiplierMaker, SliderRange.inflationMultiplier[0], SliderRange.inflationMultiplier[1], ppDataDefaults.inflationMultiplier, _pluginInstance));
            multiplier.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationMultiplier, (controller, value) => {
                var oldVal = controller.infConfig.inflationMultiplier;
                controller.infConfig.inflationMultiplier = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Multiplies the base inflation size by this value.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(multiplier);


            var roundness = e.AddControl(new MakerSlider(cat, inflationRoundnessMaker, SliderRange.inflationRoundness[0] * scaleLimits, SliderRange.inflationRoundness[1] * scaleLimits, ppDataDefaults.inflationRoundness, _pluginInstance));
            roundness.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationRoundness, (controller, value) => {
                var oldVal = controller.infConfig.inflationRoundness;
                controller.infConfig.inflationRoundness = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Make the front of the belly more or less round", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(roundness);


            var moveY = e.AddControl(new MakerSlider(cat, inflationMoveYMaker, SliderRange.inflationMoveY[0] * scaleLimits, SliderRange.inflationMoveY[1] * scaleLimits, ppDataDefaults.inflationMoveY, _pluginInstance));
            moveY.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationMoveY, (controller, value) => {
                var oldVal = controller.infConfig.inflationMoveY;
                controller.infConfig.inflationMoveY = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Moves the belly sphere up and down.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(moveY);


            var moveZ = e.AddControl(new MakerSlider(cat, inflationMoveZMaker, SliderRange.inflationMoveZ[0] * scaleLimits, SliderRange.inflationMoveZ[1] * scaleLimits, ppDataDefaults.inflationMoveZ, _pluginInstance));
            moveZ.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationMoveZ, (controller, value) => {
                var oldVal = controller.infConfig.inflationMoveZ;
                controller.infConfig.inflationMoveZ = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Moves the belly sphere forward and back.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(moveZ);


            var stretchX = e.AddControl(new MakerSlider(cat, inflationStretchXMaker, SliderRange.inflationStretchX[0] * scaleLimits, SliderRange.inflationStretchX[1] * scaleLimits, ppDataDefaults.inflationStretchX, _pluginInstance));
            stretchX.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationStretchX, (controller, value) => {
                var oldVal = controller.infConfig.inflationStretchX;
                controller.infConfig.inflationStretchX = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Stretch the belly wider in the X direction.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(stretchX);


            var stretchY = e.AddControl(new MakerSlider(cat, inflationStretchYMaker, SliderRange.inflationStretchY[0] * scaleLimits, SliderRange.inflationStretchY[1] * scaleLimits, ppDataDefaults.inflationStretchY, _pluginInstance));
            stretchY.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationStretchY, (controller, value) => {
                var oldVal = controller.infConfig.inflationStretchY;
                controller.infConfig.inflationStretchY = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Stretch the belly taller in the Y direction.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(stretchY);


            var shiftY = e.AddControl(new MakerSlider(cat, inflationShiftYMaker, SliderRange.inflationShiftY[0] * scaleLimits, SliderRange.inflationShiftY[1] * scaleLimits, ppDataDefaults.inflationShiftY, _pluginInstance));
            shiftY.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationShiftY, (controller, value) => {
                var oldVal = controller.infConfig.inflationShiftY;
                controller.infConfig.inflationShiftY = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Shift the front of the belly up and down.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(shiftY);


            var shiftZ = e.AddControl(new MakerSlider(cat, inflationShiftZMaker, SliderRange.inflationShiftZ[0] * scaleLimits, SliderRange.inflationShiftZ[1] * scaleLimits, ppDataDefaults.inflationShiftZ, _pluginInstance));
            shiftZ.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationShiftZ, (controller, value) => {
                var oldVal = controller.infConfig.inflationShiftZ;
                controller.infConfig.inflationShiftZ = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Shift the front of the belly forward and back.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(shiftZ);


            var taperY = e.AddControl(new MakerSlider(cat, inflationTaperYMaker, SliderRange.inflationTaperY[0] * scaleLimits, SliderRange.inflationTaperY[1] * scaleLimits, ppDataDefaults.inflationTaperY, _pluginInstance));
            taperY.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationTaperY, (controller, value) => {
                var oldVal = controller.infConfig.inflationTaperY;
                controller.infConfig.inflationTaperY = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Taper the sides of the belly in at the top and out at the bottom.  Makes an egg like shape.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(taperY);


            var taperZ = e.AddControl(new MakerSlider(cat, inflationTaperZMaker, SliderRange.inflationTaperZ[0] * scaleLimits, SliderRange.inflationTaperZ[1] * scaleLimits, ppDataDefaults.inflationTaperZ, _pluginInstance));
            taperZ.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationTaperZ, (controller, value) => {
                var oldVal = controller.infConfig.inflationTaperZ;
                controller.infConfig.inflationTaperZ = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Taper the front of the belly in at the top and out at the bottom.  Gives the belly an angle at the front.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(taperZ);


            var clothOffset = e.AddControl(new MakerSlider(cat, inflationClothOffsetMaker, SliderRange.inflationClothOffset[0] * scaleLimits, SliderRange.inflationClothOffset[1] * scaleLimits, ppDataDefaults.inflationClothOffset, _pluginInstance));
            clothOffset.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationClothOffset, (controller, value) => {
                var oldVal = controller.infConfig.inflationClothOffset;
                controller.infConfig.inflationClothOffset = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Control the distance between each clothing layer.  Will help reduce clipping.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(clothOffset);


            var fatFold = e.AddControl(new MakerSlider(cat, inflationFatFoldMaker, SliderRange.inflationFatFold[0], SliderRange.inflationFatFold[1], ppDataDefaults.inflationFatFold, _pluginInstance));
            fatFold.BindToFunctionController <PregnancyPlusCharaController, float>(controller => controller.infConfig.inflationFatFold, (controller, value) => {
                var oldVal = controller.infConfig.inflationFatFold;
                controller.infConfig.inflationFatFold = value;
                if (oldVal != value)
                {
                    OnMakerSettingsChanged(controller);
                }
            });
            e.AddControl(new MakerText("Control the size of the fat fold on the characters belly.  0 for none.  Use the 'Inflation Size' slider first.", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
            sliders.Add(fatFold);



            //Maker state buttons
            var resetBtn = e.AddControl(new MakerButton("Reset All", cat, _pluginInstance));
            resetBtn.OnClick.AddListener(() => {
                OnResetAll(sliders);
            });
            e.AddControl(new MakerText("Will reset all Pregnancy+ sliders to their default value", cat, _pluginInstance)
            {
                TextColor = hintColor
            });


            var restoreBtn = e.AddControl(new MakerButton("Restore Last Shape", cat, _pluginInstance));
            restoreBtn.OnClick.AddListener(() => {
                OnRestore(sliders);
            });
            e.AddControl(new MakerText("Restores the last set belly shape", cat, _pluginInstance)
            {
                TextColor = hintColor
            });
        }
Пример #16
0
        /// <summary>
        /// Initialize the character maker GUI
        /// </summary>
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            bool DoDropdownEvents = false;

            e.AddControl(new MakerText(PluginName, MakerConstants.Body.All, this));

            BodyList.Clear();
            BodyListDisplay.Clear();

            BodyList.Add("Default");
            BodyListDisplay.Add("Default");

            var characterSex = (byte)MakerAPI.GetMakerSex();

            foreach (BodyData bodyData in BodyDictionary.Select(x => x.Value)
                     .OrderByDescending(x => x.Sex == characterSex)
                     .ThenBy(x => x.Sex)
                     .ThenBy(x => x.DisplayName))
            {
                if (BodyAllowedInMaker(bodyData.Sex, characterSex))
                {
                    BodyList.Add(bodyData.BodyGUID);
                    BodyListDisplay.Add(BodyGuidToDisplayName(bodyData.BodyGUID));
                }
            }

            BodyDropdown = e.AddControl(new MakerDropdown("Body", BodyListDisplay.ToArray(), MakerConstants.Body.All, 0, this));
            BodyDropdown.ValueChanged.Subscribe(Observer.Create <int>(BodyDropdownChanged));
            void BodyDropdownChanged(int ID)
            {
                if (DoDropdownEvents == false)
                {
                    return;
                }

                var controller = GetController(MakerAPI.GetCharacterControl());

                controller.BodyGUID = ID == 0 ? null : BodyList[ID];
                controller.UpdateUncensor();
            }

            PenisList.Clear();
            PenisListDisplay.Clear();

            PenisList.Add("Default");
            PenisListDisplay.Add("Default");
#if KK
            PenisList.Add("None");
            PenisListDisplay.Add("None");
#endif

            foreach (PenisData penis in PenisDictionary.Select(x => x.Value).OrderByDescending(x => x.DisplayName))
            {
                PenisList.Add(penis.PenisGUID);
                PenisListDisplay.Add(penis.DisplayName);
            }

#if KK
            PenisDropdown = e.AddControl(new MakerDropdown("Penis", PenisListDisplay.ToArray(), MakerConstants.Body.All, characterSex == 0 ? 0 : 1, this));
#elif EC
            PenisDropdown = e.AddControl(new MakerDropdown("Penis", PenisListDisplay.ToArray(), MakerConstants.Body.All, 0, this));
#endif
            PenisDropdown.ValueChanged.Subscribe(Observer.Create <int>(PenisDropdownChanged));
            void PenisDropdownChanged(int ID)
            {
                if (DoDropdownEvents == false)
                {
                    return;
                }

                var controller = GetController(MakerAPI.GetCharacterControl());

#if KK
                controller.PenisGUID    = ID == 0 || ID == 1 ? null : PenisList[ID];
                controller.DisplayPenis = ID == 1 ? false : true;
#elif EC
                controller.PenisGUID    = ID == 0 ? null : PenisList[ID];
                controller.DisplayPenis = characterSex == 0;
#endif
                controller.UpdateUncensor();
            }

            BallsList.Clear();
            BallsListDisplay.Clear();

            BallsList.Add("Default");
            BallsListDisplay.Add("Default");
            BallsList.Add("None");
            BallsListDisplay.Add("None");

            foreach (BallsData balls in BallsDictionary.Select(x => x.Value).OrderByDescending(x => x.DisplayName))
            {
                BallsList.Add(balls.BallsGUID);
                BallsListDisplay.Add(balls.DisplayName);
            }

            int ballsInitialValue = characterSex == 0 ? 0 : DefaultFemaleDisplayBalls.Value == true ? 0 : 1;
            BallsDropdown = e.AddControl(new MakerDropdown("Balls", BallsListDisplay.ToArray(), MakerConstants.Body.All, ballsInitialValue, this));
            BallsDropdown.ValueChanged.Subscribe(Observer.Create <int>(BallsDropdownChanged));
            void BallsDropdownChanged(int ID)
            {
                if (DoDropdownEvents == false)
                {
                    return;
                }

                var controller = GetController(MakerAPI.GetCharacterControl());

                controller.BallsGUID    = ID == 0 || ID == 1 ? null : BallsList[ID];
                controller.DisplayBalls = ID == 1 ? false : true;
                controller.UpdateUncensor();
            }

#if EC
            if (characterSex == 1)
            {
                var dickToggle = e.AddControl(new MakerToggle(MakerConstants.Body.All, "Toggle Penis Display", characterSex == 0, this));
                dickToggle.ValueChanged.Subscribe(Observer.Create <bool>(delegate { MakerAPI.GetCharacterControl().fileStatus.visibleSonAlways = dickToggle.Value; }));
            }
#endif

            DoDropdownEvents = true;
        }
Пример #17
0
        /// <summary>
        /// Initialize the character maker GUI
        /// </summary>
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            bool DoDropdownEvents = false;

            e.AddControl(new MakerText(PluginName, MakerConstants.Body.All, this));

            BodyList.Clear();
            BodyListDisplay.Clear();

            BodyList.Add("Default");
            BodyListDisplay.Add("Default");

            var characterSex = (byte)MakerAPI.GetMakerSex();

            foreach (BodyData bodyData in BodyDictionary.Select(x => x.Value)
                     .OrderByDescending(x => x.Sex == characterSex)
                     .ThenBy(x => x.Sex)
                     .ThenBy(x => x.DisplayName))
            {
                if (BodyAllowedInMaker(bodyData.Sex, characterSex))
                {
                    BodyList.Add(bodyData.BodyGUID);
                    BodyListDisplay.Add(BodyGuidToDisplayName(bodyData.BodyGUID));
                }
            }

            BodyDropdown = e.AddControl(new MakerDropdown("Body", BodyListDisplay.ToArray(), MakerConstants.Body.All, 0, this));
            BodyDropdown.ValueChanged.Subscribe(value =>
            {
                if (!DoDropdownEvents)
                {
                    return;
                }
                BodyDropdownChanged(value);
            });

            PenisList.Clear();
            PenisListDisplay.Clear();

            PenisList.Add("Default");
            PenisListDisplay.Add("Default");
#if KK || KKS
            PenisList.Add("None");
            PenisListDisplay.Add("None");
#endif

            foreach (PenisData penis in PenisDictionary.Select(x => x.Value).OrderByDescending(x => x.DisplayName))
            {
                PenisList.Add(penis.PenisGUID);
                PenisListDisplay.Add(penis.DisplayName);
            }

#if KK || KKS
            PenisDropdown = e.AddControl(new MakerDropdown("Penis", PenisListDisplay.ToArray(), MakerConstants.Body.All, characterSex == 0 ? 0 : 1, this));
#else
            PenisDropdown = e.AddControl(new MakerDropdown("Penis", PenisListDisplay.ToArray(), MakerConstants.Body.All, 0, this));
#endif
            PenisDropdown.ValueChanged.Subscribe(value =>
            {
                if (!DoDropdownEvents)
                {
                    return;
                }
                PenisDropdownChanged(value);
            });

            BallsList.Clear();
            BallsListDisplay.Clear();

            BallsList.Add("Default");
            BallsListDisplay.Add("Default");
            BallsList.Add("None");
            BallsListDisplay.Add("None");

            foreach (BallsData balls in BallsDictionary.Select(x => x.Value).OrderByDescending(x => x.DisplayName))
            {
                BallsList.Add(balls.BallsGUID);
                BallsListDisplay.Add(balls.DisplayName);
            }

            int ballsInitialValue = characterSex == 0 ? 0 : DefaultFemaleDisplayBalls.Value ? 0 : 1;
            BallsDropdown = e.AddControl(new MakerDropdown("Balls", BallsListDisplay.ToArray(), MakerConstants.Body.All, ballsInitialValue, this));
            BallsDropdown.ValueChanged.Subscribe(value =>
            {
                if (!DoDropdownEvents)
                {
                    return;
                }
                BallsDropdownChanged(value);
            });

#if EC
            if (characterSex == 1)
            {
                var dickToggle = e.AddControl(new MakerToggle(MakerConstants.Body.All, "Toggle Penis Display", characterSex == 0, this));
                dickToggle.ValueChanged.Subscribe(Observer.Create <bool>(obj => MakerAPI.GetCharacterControl().fileStatus.visibleSonAlways = dickToggle.Value));
            }
#endif

#if AI || HS2
            if (characterSex == 0)
            {
                BodyDropdown.Visible.OnNext(false);
            }
            else
            {
                TogglePenisBallsUI(false);
            }
#endif

            DoDropdownEvents = true;
        }