Skip to content
This repository was archived by the owner on Nov 25, 2017. It is now read-only.

Color Picker

coman3 edited this page Oct 25, 2015 · 5 revisions

Color Picker

Installing


To install, simply copy the Color Picker Class File into your project. Making sure to change the namespace and add all Resources that start with the "Color" prefix.

Using


Simply follow the below code for a reference: `Code

        menu = MainMenu.AddMenu("Color Picker Example", "ColorPickerExample", "Color Picker Example Menu");

        menu.AddGroupLabel("Color Picker Example Menu");
        menu.AddLabel("Auto Atack Range");

        menu.AddColorPicker(new ColorPicker("ColorPicker1", System.Drawing.Color.Purple)); // Can be added using menu.Add(), but will not have spacing underneath control.

        menu.Add("Private_SetDefaultColor", new CheckBox("Set Color To Default", false)).OnValueChange +=
            delegate(ValueBase<bool> sender, ValueBase<bool>.ValueChangeArgs changeArgs)
            {
                if (!changeArgs.OldValue && changeArgs.NewValue) // Make sure we are not going to change the color when we set the checkbox back to false
                {
                    menu.Get<ColorPicker>("ColorPicker1").SetColor(System.Drawing.Color.Purple); // Set Colorpickers value
                    Core.DelayAction(() => { sender.CurrentValue = false; }, 125); //DelayAction for Tatical Feedback
                }
            };`

Clone this wiki locally