Esempio n. 1
0
        private void CreateBrushPanel(Brush brush)
        {
            Panel brushPanel = new  DCButton();

            toolTip1.SetToolTip(brushPanel, brush.getName() + " - " + brush.GetType().Name);
            brushPanel.BorderStyle           = System.Windows.Forms.BorderStyle.FixedSingle;
            brushPanel.Margin                = new System.Windows.Forms.Padding(1);
            brushPanel.BackgroundImageLayout = ImageLayout.Zoom;
            brushPanel.Name = brush.getName();
            //brushPanel.Tooltip
            brushPanel.Size = new System.Drawing.Size(34, 34);
            if (brush.getLookID() != 0)
            {
                int lookid = brush.getLookID();
                //     brushPanel.BackColor = Color.White;
                brushPanel.BackgroundImage = Global.gfx.spriteItems[Global.items.items[lookid].SpriteId].getBitmap();
            }
            else
            {
                brushPanel.BackColor = Color.Black;
            }

            brushPanel.MouseDown += new MouseEventHandler(brushClick);
            brushPanel.Tag        = brush;
            brushListItems.Controls.Add(brushPanel);

            if (selectedBrush == null)
            {
                brushClick(brushPanel, null);
            }
        }
Esempio n. 2
0
        public ListViewItem CreateListViewItem(Brush brush)
        {
            ListViewItem lvItem = new ListViewItem();

            lvItem.Text = brush.getName() + ":" + brush.getLookID();
            if (brush.getLookID() != 0)
            {
                int lookid = brush.getLookID();
                lvItem.ImageIndex = Global.gfx.getImageIndex(Global.items.items[lookid].SpriteId);
            }
            if (brush.getSpriteLookID() != 0)
            {
                lvItem.ImageIndex = Global.gfx.getCreatureImageIndex((int)brush.getSpriteLookID());
            }

            lvItem.Tag = brush;
            return(lvItem);
        }
Esempio n. 3
0
 public void addBrush(Brush brush)
 {
     try
     {
         if (typeof(RAWBrush).Equals(brush.GetType()))
         {
             brushList["" + ((RAWBrush)brush).itemtype.Id] = brush;
         }
         else
         {
             brushList[brush.getName()] = brush;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("" + brush.getLookID());
         throw ex;
     }
 }