コード例 #1
0
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            _authorText = e.AddControl(new MakerText(GetAuthorsText(), MakerConstants.Parameter.Character, this));

            var tb = e.AddControl(new MakerTextbox(MakerConstants.Parameter.Character, "Your nickname", DefaultNickname, this));

            tb.Value = CurrentNickname;
            tb.ValueChanged.Subscribe(
                s =>
            {
                if (string.IsNullOrEmpty(s))
                {
                    tb.Value = DefaultNickname;
                }
                else
                {
                    _nickname.Value = s;
                }
            });

            e.AddControl(new MakerText("Your nickname will be saved to the card and used in the card's filename. This setting is global.", MakerConstants.Parameter.Character, this)
            {
                TextColor = MakerText.ExplanationGray
            });
        }
コード例 #2
0
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent ev)
        {
            MakerCategory category = new MakerCategory("03_ClothesTop", "tglSettings", MakerConstants.Clothes.Copy.Position + 1, "Settings");

            var label = new MakerText("Unlock bras with all tops, bottoms with all tops, and underwear with all bras", category, this);

            ev.AddControl(label);

            ClothingUnlockToggle = new MakerToggle(category, "Clothing Unlock", this);
            ev.AddControl(ClothingUnlockToggle);

            var observer = Observer.Create <bool>(value =>
            {
                if (MakerAPI.InsideAndLoaded)
                {
                    var chaControl        = MakerAPI.GetCharacterControl();
                    var controller        = GetController(chaControl);
                    bool clothingUnlocked = controller.GetClothingUnlocked();
                    if (clothingUnlocked != value)
                    {
                        controller.SetClothingUnlocked(value);
                        chaControl.Reload();
                    }
                }
            });

            ClothingUnlockToggle.ValueChanged.Subscribe(observer);

            ev.AddSubCategory(category);
        }
コード例 #3
0
        // Do Work on Entering/Leaving Maker
        public void SetupMakerControls(object sender, RegisterCustomControlsEvent eventData)
        {
            CharacterAccessoryControlWrapper = MakerAPI.AddEditableAccessoryWindowControl <MakerToggle, bool>(new MakerToggle(new MakerCategory("Accessory", ""), "Character Accessory", this));
            AutoMatchHairColorWrapper        = MakerAPI.AddEditableAccessoryWindowControl <MakerToggle, bool>(new MakerToggle(new MakerCategory("Accessory", ""), "Match Hair Color on Coord Load", this));

            MakerAPI.AddAccessoryWindowControl(new MakerButton("Visibility Rules", null, this)).OnClick.AddListener(VisibilityRulesListener);
            AccessoriesApi.SelectedMakerAccSlotChanged += UpdateUI;
            AccessoriesApi.SelectedMakerAccSlotChanged += RefreshAdvancedParents;
            MakerAPI.ReloadCustomInterface             += ReloadCustomInterface;

            MakerAPI.AddAccessoryWindowControl(new MakerButton("Show", null, this)).OnClick.AddListener(ShowAccessory);
            MakerAPI.AddAccessoryWindowControl(new MakerButton("Hide", null, this)).OnClick.AddListener(HideAccessory);

            advancedParentLabel = new MakerText("Adv Parent: None", null, this);
            MakerAPI.AddAccessoryWindowControl(advancedParentLabel);
            MakerAPI.AddAccessoryWindowControl(new MakerButton("Advanced Parent", null, this)).OnClick.AddListener(AdvancedParent);

            if (ShowSlotSettingResyncButton.Value)
            {
                MakerAPI.AddAccessoryWindowControl(new MakerButton("Clear and Resync Slot", null, this)).OnClick.AddListener(ClearAndResyncSlot);
            }

            CoordinateRulesToggle = MakerAPI.AddSidebarControl(new SidebarToggle("Coordinate Visibility Rules", false, this));
            CoordinateRulesToggle.ValueChanged.Subscribe(b =>
            {
                ShowCoordinateRulesGUI(b);
            });

            MakerControlsRegistered = true;
        }
コード例 #4
0
            private static void RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
            {
                MakerCategory category = MakerConstants.Body.All;

                Color[] textColors = { new Color(0.27843f, 1f, 1f), new Color(0.45f, 0.7f, 0.7f) };

                MakerToggle vrHeadSizeToggle = e.AddControl(new KKAPI.Maker.UI.MakerToggle(category, "Enable VR Head Size", Instance)
                {
                    TextColor = textColors[0]
                });

                vrHeadSizeToggle.BindToFunctionController <KK_VRHeadSizeAdjustController, bool>(
                    (controller) => controller._vrHeadSizeEnabled,
                    (controller, value) => controller._vrHeadSizeEnabled = value

                    );

                MakerText explanation = e.AddControl(new MakerText("Enable for different head size in VR. Can improve experience for characters with large heads, which tend to look like sports mascots.", category, Instance)
                {
                    TextColor = textColors[1]
                });


                MakerSlider vrHeadSizeSlider = e.AddControl(new MakerSlider(category, "VR Head Size", SliderUnlocker.SliderUnlocker.Minimum.Value / 100, SliderUnlocker.SliderUnlocker.Maximum.Value / 100, 0.6f, Instance)
                {
                    TextColor = textColors[0]
                });

                vrHeadSizeSlider.BindToFunctionController <KK_VRHeadSizeAdjustController, float>(
                    (controller) => controller._vrHeadSize,
                    (controller, value) => controller._vrHeadSize = value
                    );
            }
コード例 #5
0
        private void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent e)
        {
            var category = new MakerCategory(MakerConstants.Parameter.ADK.CategoryName, "Crest");

            e.AddSubCategory(category);

            if (!_confUnlockStoryMaker.Value && MakerAPI.IsInsideClassMaker())
            {
                _descTxtControl = e.AddControl(new MakerText(
                                                   "To change crests inside story mode you have to invite the character to the club and use the crest icon in clubroom. You can also disable this limitation in plugin settings.",
                                                   category, this));
            }
            else
            {
                e.AddControl(new MakerText("Crests with the [+] tag will change gameplay in story mode.", category, this)
                {
                    TextColor = MakerText.ExplanationGray
                });

                var list = CrestInterfaceList.Create(false, true);

                var dropdownControl = e.AddControl(new MakerDropdown("Crest type", list.GetInterfaceNames(), category, 0, this));
                dropdownControl.BindToFunctionController <LewdCrestXController, int>(
                    controller => list.GetIndex(controller.CurrentCrest),
                    (controller, value) => controller.CurrentCrest = list.GetType(value));

                e.AddControl(new MakerToggle(category, "Hide crest graphic", this))
                .BindToFunctionController <LewdCrestXController, bool>(controller => controller.HideCrestGraphic, (controller, value) => controller.HideCrestGraphic = value);

                _descTxtControl = e.AddControl(new MakerText("Description", category, this));
                var implementedTxtControl = e.AddControl(new MakerText("", category, this));
                e.AddControl(new MakerText("The crests were created by novaksus on pixiv", category, this)
                {
                    TextColor = MakerText.ExplanationGray
                });
                dropdownControl.ValueChanged.Subscribe(value =>
                {
                    if (value <= 0)
                    {
                        _descTxtControl.Text       = "No crest selected, no effects applied";
                        implementedTxtControl.Text = "";
                    }
                    else
                    {
                        var crestInfo              = list.GetInfo(value);
                        _descTxtControl.Text       = crestInfo.Description;
                        implementedTxtControl.Text = crestInfo.Implemented
                            ? "This crest will affect gameplay in story mode as described"
                            : "This crest is only for looks (it might be implemented in the future with modified lore)";
                    }
                });
            }
        }
コード例 #6
0
        internal static void MakerAPI_RegisterCustomSubCategories(object sender, RegisterSubCategoriesEvent ev)
        {
            MakerCategory category = new MakerCategory("03_ClothesTop", "tglSettings", MakerConstants.Clothes.Copy.Position + 1, "Settings");

            var addRemoveText = new MakerText("Add or remove outfit slots", category, Instance);

            ev.AddControl(addRemoveText);

            var coordinateNameTextbox = new MakerTextbox(category, "Outfit Name", TextboxDefault, Instance);

            ev.AddControl(coordinateNameTextbox);

            var addCoordinateButton = new MakerButton("Add additional clothing slot", category, Instance);

            ev.AddControl(addCoordinateButton);
            addCoordinateButton.OnClick.AddListener(() =>
            {
                var chaControl = MakerAPI.GetCharacterControl();
                SetCoordinateName(chaControl, chaControl.chaFile.coordinate.Length, coordinateNameTextbox.Value);
                AddCoordinateSlot(chaControl);
            });

            var removeCoordinateButton = new MakerButton("Remove last additional clothing slot", category, Instance);

            ev.AddControl(removeCoordinateButton);
            removeCoordinateButton.OnClick.AddListener(() => { RemoveCoordinateSlot(MakerAPI.GetCharacterControl()); });

            RenameCoordinateText = new MakerText("Rename outfit slots", category, Instance);
            ev.AddControl(RenameCoordinateText);

            RenameCoordinateDropdown = new MakerDropdown("Outfit", new string[] { "none" }, category, 0, Instance);
            ev.AddControl(RenameCoordinateDropdown);

            RenameCoordinateTextbox = new MakerTextbox(category, "New Name", TextboxDefault, Instance);
            RenameCoordinateTextbox.ValueChanged.Subscribe(value =>
            {
                if (value != TextboxDefault)
                {
                    var chaControl = MakerAPI.GetCharacterControl();
                    SetCoordinateName(chaControl, OriginalCoordinateLength + RenameCoordinateDropdown.Value, RenameCoordinateTextbox.Value);
                    UpdateMakerUI();
                }
            });
            ev.AddControl(RenameCoordinateTextbox);

            ev.AddSubCategory(category);
        }
コード例 #7
0
        private void RegisterMakerControls(Stiletto plugin, RegisterSubCategoriesEvent e)
        {
            displaySettings = StilettoContext._displaySettingsProvider.Value;

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

            e.AddSubCategory(category);

            text_heelName     = e.AddControl(new MakerText(displaySettings.Default_Heel_Name, category, plugin));
            slider_AnkleAngle = e.AddControl(new MakerSlider(category, displaySettings.Ankle_Angle, -60f, 60f, 0f, plugin)
            {
                StringToValue = CreateStringToValueFunc(10f),
                ValueToString = CreateValueToStringFunc(10f),
            });
            slider_LegAngle = e.AddControl(new MakerSlider(category, displaySettings.Leg_Angle, -60f, 60f, 0f, plugin)
            {
                StringToValue = CreateStringToValueFunc(10f),
                ValueToString = CreateValueToStringFunc(10f)
            });
            slider_Height = e.AddControl(new MakerSlider(category, displaySettings.Height, -0.5f, 0.5f, 0f, plugin)
            {
                StringToValue = CreateStringToValueFunc(1000f),
                ValueToString = CreateValueToStringFunc(1000f)
            });
            button_HeelSave = e.AddControl(new MakerButton(displaySettings.Save_Heel_Settings, category, plugin));
            button_Reload   = e.AddControl(new MakerButton(displaySettings.Reload_Configurations, category, plugin));

            slider_AnkleAngle.ValueChanged.Subscribe(value =>
                                                     MakerHeelInfoProcess(heel => heel.SafeProc(x => x.AnkleAngle = value))
                                                     );

            slider_LegAngle.ValueChanged.Subscribe(value =>
                                                   MakerHeelInfoProcess(heel => heel.SafeProc(x => x.LegAngle = value))
                                                   );

            slider_Height.ValueChanged.Subscribe(value =>
                                                 MakerHeelInfoProcess(heel => heel.SafeProc(x => x.Height = value))
                                                 );

            button_HeelSave.OnClick.AddListener(() =>
                                                MakerHeelInfoProcess(heel => StilettoContext.CustomHeelProvider.Save(heel.heelName, new CustomHeel(heel))
                                                                     ));

            button_Reload.OnClick.AddListener(StilettoContext.ReloadConfigurations);
        }
コード例 #8
0
 private void MakerAPI_MakerExiting(object sender, EventArgs e)
 {
     _authorText = null;
 }