示例#1
0
        internal void CatBatchRemove(RegisterSubCategoriesEvent ev, MakerCategory category)
        {
            ev.AddControl(new MakerText("Batch remove accessory slots", category, this));

            MakerTextbox StartTextbox = ev.AddControl(new MakerTextbox(category, "Start", "", this));
            MakerTextbox EndTextbox   = ev.AddControl(new MakerTextbox(category, "End", "", this));

            MakerRadioButtons tglMode = ev.AddControl(new MakerRadioButtons(category, this, "Mode", "All", "Hair", "Item"));

            MakerButton btnRmApply = ev.AddControl(new MakerButton("Go", category, this));

            btnRmApply.OnClick.AddListener(delegate
            {
                if (!int.TryParse(StartTextbox.Value, out int start))
                {
                    StartTextbox.Value = "";
                    start = 0;
                }
                if (!int.TryParse(EndTextbox.Value, out int end))
                {
                    EndTextbox.Value = "";
                    end = 0;
                }
                ActBatchRemove(start - 1, end - 1, tglMode.Value);
            });
示例#2
0
        private void SetupEyeInterface(RegisterSubCategoriesEvent e, KK_CharaOverlaysBasedOnCoordinate owner)
        {
            CharaOverlaysBasedOnCoordinateController controller = MakerAPI.GetCharacterControl().gameObject.GetComponent <CharaOverlaysBasedOnCoordinateController>();
            KoiSkinOverlayController KSOXController             = MakerAPI.GetCharacterControl().gameObject.GetComponent <KoiSkinOverlayController>();

            MakerCategory irisCategory = MakerConstants.Face.Iris;
            MakerCategory eyeCategory  = new MakerCategory(irisCategory.CategoryName, "tglEyeOverlayKSOX", irisCategory.Position + 5, "Iris Overlays");

            e.AddSubCategory(eyeCategory);

            e.AddControl(new MakerButton("Copy iris overlay to all outfits", eyeCategory, owner))
            .OnClick.AddListener(delegate() {
                controller.CopyOverlayToAllOutfits(TexType.EyeOver);
                controller.CopyOverlayToAllOutfits(TexType.EyeUnder);
                Logger.LogMessage("[Chara Overlays Based On Coordinate] Successfully copied iris overlay");
            }
                                 );
            IrisSideRadioBtn = new MakerRadioButtons(eyeCategory, owner, "Side to display", "Both", "Left", "Right");
            e.AddControl(IrisSideRadioBtn)
            .ValueChanged.Subscribe(side => {
                controller.ChangeIrisDisplayside(side);
                //Logger.LogDebug("Changed RadioBtn: " + side);
            }
                                    );
        }
示例#3
0
        private void RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent ev)
        {
            MakerCategory category = new MakerCategory("03_ClothesTop", "tglPushup", MakerConstants.Clothes.Bra.Position + 1, "Pushup");

            //Bra or top
            SelectButtons = ev.AddControl(new MakerRadioButtons(category, this, "Type", "Bra", "Top"));
            SelectButtons.ValueChanged.Subscribe(i => ReloadPushup());

            //Basic mode
            EnablePushupToggle = new MakerToggle(category, "Enabled", true, this);
            ev.AddControl(EnablePushupToggle);

            FirmnessSlider     = MakeSlider(category, "Firmness", ev, ConfigFirmnessDefault.Value);
            LiftSlider         = MakeSlider(category, "Lift", ev, ConfigLiftDefault.Value);
            PushTogetherSlider = MakeSlider(category, "Push Together", ev, ConfigPushTogetherDefault.Value);
            SqueezeSlider      = MakeSlider(category, "Squeeze", ev, ConfigSqueezeDefault.Value);
            CenterSlider       = MakeSlider(category, "Center Nipples", ev, ConfigNippleCenteringDefault.Value);

            FlattenNippleToggle = new MakerToggle(category, "Flatten Nipples", true, this);
            ev.AddControl(FlattenNippleToggle);

            //Advanced mode
            ev.AddControl(new MakerSeparator(category, this));

            AdvancedModeToggle = new MakerToggle(category, "Advanced Mode", false, this);
            ev.AddControl(AdvancedModeToggle);

            var copyBodyButton = new MakerButton("Copy Body To Advanced", category, this);

            ev.AddControl(copyBodyButton);
            copyBodyButton.OnClick.AddListener(CopyBodyToSliders);

            var copyBasicButton = new MakerButton("Copy Basic To Advanced", category, this);

            ev.AddControl(copyBasicButton);
            copyBasicButton.OnClick.AddListener(CopyBasicToSliders);

            PushSizeSlider               = MakeSlider(category, "Size", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexSize], true);
            PushVerticalPositionSlider   = MakeSlider(category, "Vertical Position", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexVerticalPosition], true);
            PushHorizontalAngleSlider    = MakeSlider(category, "Horizontal Angle", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexHorizontalAngle], true);
            PushHorizontalPositionSlider = MakeSlider(category, "Horizontal Position", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexHorizontalPosition], true);
            PushVerticalAngleSlider      = MakeSlider(category, "Vertical Angle", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexVerticalAngle], true);
            PushDepthSlider              = MakeSlider(category, "Depth", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexDepth], true);
            PushRoundnessSlider          = MakeSlider(category, "Roundness", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexRoundness], true);

            PushSoftnessSlider = MakeSlider(category, "Softness", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.bustSoftness, true);
            PushWeightSlider   = MakeSlider(category, "Weight", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.bustWeight, true);

            PushAreolaDepthSlider = MakeSlider(category, "Areola Depth", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexAreolaDepth], true);
            PushNippleWidthSlider = MakeSlider(category, "Nipple Width", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexNippleWidth], true);
            PushNippleDepthSlider = MakeSlider(category, "Nipple Depth", ev, Singleton <CustomBase> .Instance.defChaInfo.custom.body.shapeValueBody[PushupConstants.IndexNippleDepth], true);

#if KK
            //Only one outfit in EC
            var coordinateList = Enum.GetNames(typeof(ChaFileDefine.CoordinateType)).ToList();
            coordinateList.Add("All");
            ev.AddControl(new MakerSeparator(category, this));
            var copyDropdown = new MakerDropdown("Copy To Coordinate", coordinateList.ToArray(), category, 0, this);
            ev.AddControl(copyDropdown);

            string[] DataTypes        = new string[] { "Basic and Advanced", "Basic", "Advanced" };
            var      copyDataDropdown = new MakerDropdown("Data To Copy", DataTypes, category, 0, this);
            ev.AddControl(copyDataDropdown);

            var copyButton = new MakerButton("Copy", category, this);
            ev.AddControl(copyButton);
            copyButton.OnClick.AddListener(delegate
            {
                bool copyBasic    = copyDataDropdown.Value == 0 || copyDataDropdown.Value == 1;
                bool copyAdvanced = copyDataDropdown.Value == 0 || copyDataDropdown.Value == 2;

                if (copyDropdown.Value == coordinateList.Count - 1) //Copy all
                {
                    for (int i = 0; i < coordinateList.Count - 1; i++)
                    {
                        CopySlidersToCoordinate(i, copyBasic, copyAdvanced);
                    }
                }
                else
                {
                    CopySlidersToCoordinate(copyDropdown.Value, copyBasic, copyAdvanced);
                }
            });
#endif
            ev.AddSubCategory(category);
        }
示例#4
0
        private void RegisterSingleControl(MakerCategory category, BoneMeta boneMeta, RegisterCustomControlsEvent callback)
        {
            MakerRadioButtons rb = null;

            if (!string.IsNullOrEmpty(boneMeta.RightBoneName))
            {
                rb = callback.AddControl(new MakerRadioButtons(category, this, "Side to edit", "Both", "Left", "Right")
                {
                    TextColor = _settingColor
                });
            }

            var max  = RaiseLimits.Value ? boneMeta.Max * LimitRaiseAmount : boneMeta.Max;
            var lMax = RaiseLimits.Value ? boneMeta.LMax * LimitRaiseAmount : boneMeta.LMax;
            var x    = boneMeta.X ? callback.AddControl(new MakerSlider(category, boneMeta.XDisplayName, boneMeta.Min, max, 1, this)
            {
                TextColor = _settingColor
            }) : null;
            var y = boneMeta.Y ? callback.AddControl(new MakerSlider(category, boneMeta.YDisplayName, boneMeta.Min, max, 1, this)
            {
                TextColor = _settingColor
            }) : null;
            var z = boneMeta.Z ? callback.AddControl(new MakerSlider(category, boneMeta.ZDisplayName, boneMeta.Min, max, 1, this)
            {
                TextColor = _settingColor
            }) : null;
            var l = boneMeta.L ? callback.AddControl(new MakerSlider(category, boneMeta.LDisplayName, boneMeta.LMin, lMax, 1, this)
            {
                TextColor = _settingColor
            }) : null;

            var isUpdatingValue = false;

            void SetSliders(Vector3 mod, float lenMod)
            {
                isUpdatingValue = true;
                if (x != null)
                {
                    x.Value = mod.x;
                }
                if (y != null)
                {
                    y.Value = mod.y;
                }
                if (z != null)
                {
                    z.Value = mod.z;
                }
                if (l != null)
                {
                    l.Value = lenMod;
                }
                isUpdatingValue = false;
            }

            void PushValueToControls()
            {
                var bone = GetBoneModifier(boneMeta.BoneName, boneMeta.UniquePerCoordinate);

                if (bone == null)
                {
                    SetSliders(Vector3.one, 1f);
                    return;
                }

                if (rb != null)
                {
                    var bone2 = GetBoneModifier(boneMeta.RightBoneName, boneMeta.UniquePerCoordinate);
                    if (bone.ScaleModifier != bone2.ScaleModifier)
                    {
                        if (rb.Value == 0)
                        {
                            rb.Value = 1;
                        }
                        else if (rb.Value == 2)
                        {
                            bone = bone2;
                        }
                    }
                    else
                    {
                        rb.Value = 0;
                    }
                }

                SetSliders(bone.ScaleModifier, bone.LengthModifier);
            }

            _updateActionList.Add(PushValueToControls);
            PushValueToControls();

            rb?.ValueChanged.Subscribe(
                i =>
            {
                if (i == 1)
                {
                    var modifierData = GetBoneModifier(boneMeta.BoneName, boneMeta.UniquePerCoordinate);
                    if (modifierData != null)
                    {
                        SetSliders(modifierData.ScaleModifier, modifierData.LengthModifier);
                    }
                }
                else if (i == 2)
                {
                    var modifierData = GetBoneModifier(boneMeta.RightBoneName, boneMeta.UniquePerCoordinate);
                    if (modifierData != null)
                    {
                        SetSliders(modifierData.ScaleModifier, modifierData.LengthModifier);
                    }
                }
            });

            void PullValuesToBone(float _)
            {
                if (isUpdatingValue)
                {
                    return;
                }

                var bone      = GetBoneModifier(boneMeta.BoneName, boneMeta.UniquePerCoordinate);
                var prevValue = bone?.ScaleModifier ?? Vector3.one;
                var newValue  = new Vector3(x?.Value ?? prevValue.x, y?.Value ?? prevValue.y, z?.Value ?? prevValue.y);

                if (bone == null)
                {
                    var hasLen = l != null && Math.Abs(l.Value - 1f) > 0.001;
                    if (newValue == Vector3.one && !hasLen)
                    {
                        return;
                    }

                    _boneController.AddModifier(new BoneModifier(boneMeta.BoneName));
                    bone = GetBoneModifier(boneMeta.BoneName, boneMeta.UniquePerCoordinate);
                }

                if (rb != null)
                {
                    if (rb.Value != 1)
                    {
                        var bone2 = GetBoneModifier(boneMeta.RightBoneName, boneMeta.UniquePerCoordinate);
                        if (bone2 == null)
                        {
                            _boneController.AddModifier(new BoneModifier(boneMeta.RightBoneName));
                            bone2 = GetBoneModifier(boneMeta.RightBoneName, boneMeta.UniquePerCoordinate);
                        }

                        if (rb.Value == 0)
                        {
                            bone2.ScaleModifier = newValue;
                            if (l != null)
                            {
                                bone2.LengthModifier = l.Value;
                            }
                        }
                        else if (rb.Value == 2)
                        {
                            bone2.ScaleModifier = newValue;
                            if (l != null)
                            {
                                bone2.LengthModifier = l.Value;
                            }
                            return;
                        }
                    }
                }

                bone.ScaleModifier = newValue;
                if (l != null)
                {
                    bone.LengthModifier = l.Value;
                }
            }

            var obs = Observer.Create <float>(PullValuesToBone);

            x?.ValueChanged.Subscribe(obs);
            y?.ValueChanged.Subscribe(obs);
            z?.ValueChanged.Subscribe(obs);
            l?.ValueChanged.Subscribe(obs);
        }