Example #1
0
        private static void DebugControls()
        {
            var instance = KoikatuAPI.Instance;
            var cat      = MakerConstants.Face.All;

            AddControl(new MakerSeparator(cat, instance));
            AddControl(new MakerSeparator(cat, instance));
            AddControl(new MakerSeparator(cat, instance));
            AddControl(new MakerToggle(cat, "test toggle", instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerButton("test btn", cat, instance))
            .OnClick.AddListener(() => KoikatuAPI.Logger.LogMessage("Clicked"));
            AddControl(new MakerColor("test color", true, cat, Color.magenta, instance))
            .ValueChanged.Subscribe(color => KoikatuAPI.Logger.LogMessage(color));
            AddControl(new MakerDropdown("test toggle", new[] { "t0", "t1", "t2", "t3" }, cat, 1, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerRadioButtons(cat, instance, "radio btns", "b1", "b2"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerRadioButtons(cat, instance, "radio btns 1 row", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerRadioButtons(cat, instance, "radio btns 5 per row", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8")
            {
                ColumnCount = 5
            })
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerSlider(cat, "test slider", 0, 1, 1, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(
                new MakerText(
                    "test text test text test text test text test text test " +
                    "text test text test text test text test text", cat, instance));
            AddControl(new MakerTextbox(cat, "test textbox", "String test", instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            MakerLoadToggle.AddLoadToggle(new MakerLoadToggle("Test toggle"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            MakerLoadToggle.AddLoadToggle(new MakerLoadToggle("Test toggle 2"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            MakerCoordinateLoadToggle.AddLoadToggle(new MakerCoordinateLoadToggle("Test toggle"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            MakerCoordinateLoadToggle.AddLoadToggle(new MakerCoordinateLoadToggle("Test toggle 2"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            AddSidebarControl(new SidebarToggle("Test toggle", false, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddSidebarControl(new SidebarToggle("Test toggle2", true, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            AddAccessoryWindowControl(new MakerToggle(cat, "test toggle", null))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage($"Toggled to {b} in accessory slot index {AccessoriesApi.SelectedMakerAccSlot}"));
            AddAccessoryWindowControl(new MakerColor("test accessory color", false, cat, Color.cyan, instance)
            {
                ColorBoxWidth = 230
            })
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage($"Color to {b} in accessory slot index {AccessoriesApi.SelectedMakerAccSlot}"));
        }
Example #2
0
 /// <summary>
 /// Add a toggle to the bottom of the "Load character" window that allows for partial loading of characters.
 /// </summary>
 public MakerLoadToggle AddLoadToggle(MakerLoadToggle toggle)
 {
     return(MakerLoadToggle.AddLoadToggle(toggle));
 }
Example #3
0
        private static void DebugControls()
        {
            var instance = KoikatuAPI.Instance;

            var cat = MakerConstants.Face.All;

            AddControl(new MakerSeparator(cat, instance));
            AddControl(new MakerSeparator(cat, instance));
            AddControl(new MakerSeparator(cat, instance));
            AddControl(new MakerToggle(cat, "test toggle", instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerButton("test btn", cat, instance))
            .OnClick.AddListener(() => KoikatuAPI.Logger.LogMessage("Clicked"));
            AddControl(new MakerColor("test color", true, cat, Color.magenta, instance))
            .ValueChanged.Subscribe(color => KoikatuAPI.Logger.LogMessage(color));
            AddControl(new MakerDropdown("test toggle", new[] { "t0", "t1", "t2", "t3" }, cat, 1, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerRadioButtons(cat, instance, "radio btns", "b1", "b2", "b3"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerSlider(cat, "test slider", 0, 1, 1, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerText("test text test text test text test text test text test text test text test text test text test text", cat, instance));
            //AddControl(new MakerTextbox(cat, "test textbox", "String test", instance))
            //    .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            MakerLoadToggle.AddLoadToggle(new MakerLoadToggle("Test toggle"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            MakerLoadToggle.AddLoadToggle(new MakerLoadToggle("Test toggle 2"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            MakerCoordinateLoadToggle.AddLoadToggle(new MakerCoordinateLoadToggle("Test toggle"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            MakerCoordinateLoadToggle.AddLoadToggle(new MakerCoordinateLoadToggle("Test toggle 2"))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            AddSidebarControl(new SidebarToggle("Test toggle", false, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddSidebarControl(new SidebarToggle("Test toggle2", true, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));

            AddAccessoryWindowControl(new MakerToggle(cat, "test toggle", null))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage($"Toggled to {b} in accessory slot index {AccessoriesApi.SelectedMakerAccSlot}"));
            AddAccessoryWindowControl(new MakerColor("test accessory color", false, cat, Color.cyan, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage($"Color to {b} in accessory slot index {AccessoriesApi.SelectedMakerAccSlot}"));

            var copyCat = new MakerCategory(cat.CategoryName, "Test", 0, "Test subcategory");

            _categories.Add(copyCat);
            AddControl(new MakerSlider(copyCat, "test slider copyCat", 0, 1, 1, instance))
            .ValueChanged.Subscribe(b => KoikatuAPI.Logger.LogMessage(b));
            AddControl(new MakerSeparator(copyCat, instance));

            for (int i = 0; i < 12; i++)
            {
                AddControl(new MakerSlider(MakerConstants.Face.FaceType, "test slider", 0, 1, 1, instance));
            }

            var acc = new MakerSlider(MakerConstants.Face.FaceType, "test acc slider", 0, 1, 1, instance);

            AddAccessoryWindowControl(acc);
            var wrapped = new AccessoryControlWrapper <MakerSlider, float>(acc);

            wrapped.VisibleIndexChanged  += (sender, args) => KoikatuAPI.Logger.LogMessage("VisibleIndexChanged");
            wrapped.AccessoryKindChanged += (sender, args) => KoikatuAPI.Logger.LogMessage("AccessoryKindChanged");
            wrapped.ValueChanged         += (sender, args) => KoikatuAPI.Logger.LogMessage($"ValueChanged {wrapped.GetSelectedValue()} for acc {wrapped.CurrentlySelectedIndex}");
        }