Пример #1
0
 private void JColorPalete1_OnColorAction(object sender, ColorEvent e)
 {
     if (jColorPalette1.Selected != null)
     {
         int selectedIndex = PaletteSelector.SelectedIndex;
         if (selectedIndex > -1)
         {
             DialogResult dialog = new RenamePalette(e.Item.ColorName).ShowDialog(this);
             if (dialog == DialogResult.OK)
             {
                 if (RenamePalette.ResultText.Length > 0)
                 {
                     jColorPalette1.Selected.ColorName = RenamePalette.ResultText;
                     DatabaseManager.SetPaletteItems(selectedIndex, jColorPalette1.PaletteData);
                     jColorPalette1.PaletteData = DatabaseManager.GetPalette(selectedIndex);
                 }
             }
         }
     }
     else
     {
         JMessageBox.Show(this, "Please select the Palete first.");
     }
 }
 /// <summary>
 /// 鼠标或者触笔事件
 /// </summary>
 /// <param name="_t">事件类型</param>
 /// <param name="_sender">事件发送者</param>
 /// <param name="_selected">被选中的游戏对象</param>
 /// <param name="_buttonID">按键编号</param>
 /// <param name="_hit">碰撞点信息</param>
 public ColorEventArgs Config(ColorEvent _t, GameObject _sender, Color color)
 {
     base.Config(_t, _sender);
     this.Color = color;
     return(this);
 }
Пример #3
0
 /// <summary>
 ///     Creates a new Colorpicker
 /// </summary>
 /// <param name="original">Color before editing</param>
 /// <param name="message">Display message</param>
 /// <param name="onColorChanged">Event that gets called when the color gets modified</param>
 /// <param name="onColorSelected">Event that gets called when one of the buttons done or cancel get pressed</param>
 /// <param name="useAlpha">When set to false the colors used don't have an alpha channel</param>
 /// <returns>
 ///     False if the instance is already running
 /// </returns>
 public static bool Create(Color original, string message, ColorEvent onColorChanged, ColorEvent onColorSelected, bool useAlpha = false)
 {
     if (instance is null)
     {
         Debug.LogError("No Colorpicker prefab active on 'Start' in scene");
         return(false);
     }
     if (done)
     {
         done          = false;
         originalColor = original;
         modifiedColor = original;
         onCC          = onColorChanged;
         onCS          = onColorSelected;
         useA          = useAlpha;
         instance.gameObject.SetActive(true);
         instance.transform.GetChild(0).GetComponent <Text>().text = message;
         instance.aComponent.gameObject.SetActive(useAlpha);
         instance.RecalculateMenu(true);
         instance.hexaComponent.placeholder.GetComponent <Text>().text = "RRGGBB" + (useAlpha ? "AA" : "");
         return(true);
     }
     else
     {
         Done();
         return(false);
     }
 }
Пример #4
0
 private void widget_ColorChanged(object sender, ColorEvent e)
 {
     this.UpDateData((System.Action)(() => this._propertyItem.SetValue("SingleColor", (object)this.ConvertColor(e.Color), (object[])null)));
 }
Пример #5
0
 public void Handle(ColorEvent message)
 {
     Color = message.Color;
 }