Exemplo n.º 1
0
        private void EquipPanel_Paint(object sender, PaintEventArgs e)
        {
            if (this.units == null)
            {
                return;
            }
            Graphics    graphics    = e.Graphics;
            DrawingUnit drawingUnit = null;
            EquipItem   item        = null;
            int         x           = 0;
            int         y           = 0;

            for (int i = 0; i < this.xnum; i++)
            {
                for (int j = 0; j < this.ynum; j++)
                {
                    DrawingUnit drawingUnit1 = this.units[i, j];
                    drawingUnit = drawingUnit1;
                    if (drawingUnit1 != null && drawingUnit.Item != null)
                    {
                        this.drawUnit(graphics, this.units[i, j]);
                    }
                }
            }
            if (this.activeUnit != null && this.activeUnit.Item != null)
            {
                item = this.activeUnit.Item;
                x    = this.activeUnit.X;
                y    = this.activeUnit.Y;
                graphics.DrawImage(item.Img, x * 26, y * 26, item.Width * 26, item.Height * 26);
                Brush solidBrush = new SolidBrush(Color.FromArgb(60, 128, 128, 128));
                graphics.FillRectangle(solidBrush, this.activeUnit.X * 26, this.activeUnit.Y * 26, this.activeUnit.Item.Width * 26, this.activeUnit.Item.Height * 26);
                graphics.DrawRectangle(Pens.Blue, x * 26, y * 26, item.Width * 26, item.Height * 26);
            }
        }
Exemplo n.º 2
0
        public bool canPutItem(DrawingUnit unit)
        {
            EquipItem item = unit.Item;
            int       x    = unit.X;
            int       y    = unit.Y;

            if (item.Width + x > this.xnum || item.Height + y > this.ynum || x < 0 || y < 0)
            {
                return(false);
            }
            if (this.flags[x, y])
            {
                return(false);
            }
            for (int i = 0; i < item.Width; i++)
            {
                for (int j = 0; j < item.Height; j++)
                {
                    if (this.flags[i + x, j + y])
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
Exemplo n.º 3
0
        public bool removeItem(DrawingUnit unit)
        {
            int x = unit.X;

            this.units[x] = null;
            return(true);
        }
Exemplo n.º 4
0
        public bool putItem(DrawingUnit unit, bool add, bool isCopy)
        {
            int x = unit.X;
            int y = unit.Y;

            if (!isCopy)
            {
                if (!add)
                {
                    Utils.SN      = Utils.SN - 1;
                    unit.Item.SN  = Utils.SN;
                    this.units[x] = unit;
                }
                else
                {
                    this.units[x] = new DrawingUnit(new EquipItem(), x, y);
                    Utils.SN      = Utils.SN - 1;
                    unit.Item.SN  = Utils.SN;
                    this.units[x].Item.assign(unit.Item);
                }
                if (!Utils.ListPackage.Contains(unit.Item.ToString()))
                {
                    Utils.ListPackage.Add(unit.Item.ToString());
                }
            }
            else
            {
                this.units[this.index] = new DrawingUnit(new EquipItem(), this.index, y);
                this.units[this.index].Item.assign(unit.Item);
            }
            return(true);
        }
Exemplo n.º 5
0
        public bool putItem(DrawingUnit unit, bool add)
        {
            int x = unit.X;
            int y = unit.Y;

            if (!add)
            {
                this.units[x, y] = unit;
            }
            else
            {
                this.units[x, y] = new DrawingUnit(new EquipItem(), x, y);
                this.units[x, y].Item.assign(unit.Item);
                Utils.SN = Utils.SN - 1;
                this.units[x, y].Item.SN = Utils.SN;
            }
            for (int i = 0; i < unit.Item.Width; i++)
            {
                for (int j = 0; j < unit.Item.Height; j++)
                {
                    this.flags[i + x, j + y] = true;
                }
            }
            return(true);
        }
Exemplo n.º 6
0
 public void clearData()
 {
     this.selectedUnit = null;
     for (int i = 0; i < 1; i++)
     {
         this.units[i] = null;
     }
 }
Exemplo n.º 7
0
        // Token: 0x060000DC RID: 220 RVA: 0x000160C4 File Offset: 0x000142C4
        public bool canPutItem(DrawingUnit unit)
        {
            EquipItem item = unit.Item;
            int       x    = unit.X;
            int       y    = unit.Y;

            return((x >= 0 || x < 1 || this.units[x] == null) &&
                   (int)(EquipEditor.xItem[(int)(item.Type * 512 + item.Code)].ItemSlot - 236) == this.index);
        }
Exemplo n.º 8
0
 private void setEquipProperty(DrawingUnit unit)
 {
     if (unit != null)
     {
         this.Cursor = Cursors.WaitCursor;
         EquipProperty equipProperty = new EquipProperty(unit.Item);
         equipProperty.ShowDialog();
         equipProperty.Dispose();
         this.Cursor = Cursors.Default;
     }
 }
Exemplo n.º 9
0
 public void DownItem()
 {
     if (this.activeUnit != null)
     {
         this.activeUnit.X = this.lastedX;
         this.activeUnit.Y = this.lastedY;
         if (this.canPutItem(this.activeUnit) && this.putItem(this.activeUnit, false))
         {
             this.selectedUnit = null;
             this.activeUnit   = null;
         }
     }
 }
Exemplo n.º 10
0
 private void SkillPanel_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     this.index = this.findRectangle(e.X, e.Y);
     if (this.index < 0)
     {
         this.selectedUnit = null;
     }
     else if (this.units[this.index] == null)
     {
         this.addEditItem(this.index);
         return;
     }
 }
Exemplo n.º 11
0
 public void clearData()
 {
     this.activeUnit   = null;
     this.selectedUnit = null;
     this.lastedX      = 0;
     this.lastedY      = 0;
     for (int i = 0; i < this.xnum; i++)
     {
         for (int j = 0; j < this.ynum; j++)
         {
             this.units[i, j] = null;
             this.flags[i, j] = false;
         }
     }
 }
Exemplo n.º 12
0
        public bool canPutItem(DrawingUnit unit)
        {
            EquipItem item = unit.Item;
            int       x    = unit.X;
            int       y    = unit.Y;

            if (x < 0 && x >= 1 && this.units[x] != null)
            {
                return(false);
            }
            if ((ushort)(EquipEditor.xItem[item.Type * 512 + item.Code].ItemSlot - 236) == this.index)
            {
                return(true);
            }
            return(false);
        }
Exemplo n.º 13
0
        public bool removeItem(DrawingUnit unit)
        {
            if (unit == null)
            {
                return(true);
            }
            int x = unit.X;
            int y = unit.Y;

            this.units[x, y] = null;
            for (int i = 0; i < unit.Item.Width; i++)
            {
                for (int j = 0; j < unit.Item.Height; j++)
                {
                    this.flags[i + x, j + y] = false;
                }
            }
            return(true);
        }
Exemplo n.º 14
0
        private void toolStripMenuItem_4_Click(object sender, EventArgs e)
        {
            IDataObject dataObject = Clipboard.GetDataObject();

            if (dataObject.GetDataPresent(DataFormats.Text))
            {
                string text = ((string)dataObject.GetData(DataFormats.Text)).Replace("&", "").Replace("0x", "");
                if (text.Length == 32 && Validator.HexString(text) && !text.StartsWith("FF"))
                {
                    EquipItem   equipItem = EquipItem.createItem(text);
                    DrawingUnit unit      = new DrawingUnit(equipItem);
                    if (equipItem != null && this.canPutItem(unit))
                    {
                        this.putItem(unit, false, true);
                        return;
                    }
                    Utils.WarningMessage("物品[" + equipItem.Name + "]不能放置在该位置!");
                }
            }
        }
Exemplo n.º 15
0
        private void 粘贴VToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IDataObject dataObject = Clipboard.GetDataObject();

            if (dataObject.GetDataPresent(DataFormats.Text))
            {
                string str = ((string)dataObject.GetData(DataFormats.Text)).Replace("&", "").Replace("0x", "");
                if (str.Length == 32 && Validator.HexString(str) && !str.StartsWith("FF"))
                {
                    EquipItem   equipItem   = EquipItem.createItem(str);
                    DrawingUnit drawingUnit = new DrawingUnit(equipItem);
                    if (equipItem != null && this.canPutItem(drawingUnit))
                    {
                        this.putItem(drawingUnit, false, true);
                        return;
                    }
                    Utils.WarningMessage(string.Concat("Item", equipItem.Name, "can not be placed in that position!"));
                }
            }
        }
Exemplo n.º 16
0
        public bool putItem(EquipItem item, bool add, bool isCopy)
        {
            DrawingUnit drawingUnit = null;

            if (isCopy)
            {
                drawingUnit = new DrawingUnit(new EquipItem(), 0, 0);
                drawingUnit.Item.assign(item);
            }
            else if (!add)
            {
                drawingUnit = new DrawingUnit(item, 0, 0);
            }
            else
            {
                drawingUnit = new DrawingUnit(new EquipItem(), 0, 0);
                drawingUnit.Item.assign(item);
                Utils.SN            = Utils.SN - 1;
                drawingUnit.Item.SN = Utils.SN;
                if (!Utils.ListWareHouse.Contains(drawingUnit.Item.ToString()))
                {
                    Utils.ListWareHouse.Add(drawingUnit.Item.ToString());
                }
            }
            for (int i = 0; i < this.ynum; i++)
            {
                for (int j = 0; j < this.xnum; j++)
                {
                    if (!this.flags[j, i])
                    {
                        drawingUnit.X = j;
                        drawingUnit.Y = i;
                        if (this.canPutItem(drawingUnit))
                        {
                            return(this.putItem(drawingUnit, false));
                        }
                    }
                }
            }
            return(false);
        }
Exemplo n.º 17
0
        protected DrawingUnit findUnit(int x, int y)
        {
            DrawingUnit drawingUnit = null;

            if (this.flags[x, y])
            {
                for (int i = 0; i < this.xnum; i++)
                {
                    for (int j = 0; j < this.ynum; j++)
                    {
                        DrawingUnit drawingUnit1 = this.units[i, j];
                        drawingUnit = drawingUnit1;
                        if (drawingUnit1 != null && drawingUnit.contains(x, y))
                        {
                            return(drawingUnit);
                        }
                    }
                }
            }
            return(null);
        }
Exemplo n.º 18
0
        public bool moveItem(DrawingUnit unit, int x, int y)
        {
            if (unit == null || unit.Item == null)
            {
                return(false);
            }
            int num  = unit.X;
            int num1 = unit.Y;

            this.removeItem(unit);
            unit.X = x;
            unit.Y = y;
            if (this.canPutItem(unit) && this.putItem(unit, false))
            {
                return(true);
            }
            unit.X = num;
            unit.Y = num1;
            this.putItem(unit, false);
            return(false);
        }
Exemplo n.º 19
0
 private void SkillPanel_MouseClick(object sender, MouseEventArgs e)
 {
     this.index = this.findRectangle(e.X, e.Y);
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         if (this.index < 0)
         {
             this.selectedUnit = null;
             return;
         }
         if (this.units[this.index] == null)
         {
             this.muCopy.Show(this, e.X, e.Y);
             this.selectedUnit = null;
             return;
         }
         this.selectedUnit = this.units[this.index];
         this.popMenu.Show(this, e.X, e.Y);
         return;
     }
     if (this.index < 0)
     {
         this.selectedUnit = null;
         return;
     }
     if (this.units[this.index] == null)
     {
         this.selectedUnit = null;
         return;
     }
     if ((int)base.Parent.Parent.Controls.Find("tabcInfo", false).Length > 0)
     {
         ((TabControl)base.Parent.Parent.Controls.Find("tabcInfo", false)[0]).SelectedIndex = 2;
     }
     this.selectedUnit = this.units[this.index];
     this.editor.updateUI(this.selectedUnit.Item);
 }
Exemplo n.º 20
0
 public void assign(DrawingUnit unit)
 {
     this.x    = unit.X;
     this.y    = unit.Y;
     this.item = unit.Item;
 }
Exemplo n.º 21
0
 private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.removeItem(this.selectedUnit);
     Utils.ListPackage.Remove(this.selectedUnit.Item.ToString());
     this.selectedUnit = null;
 }
Exemplo n.º 22
0
 private void 关闭ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Clipboard.SetDataObject(this.selectedUnit.Item.ToString(), true);
     this.removeItem(this.selectedUnit);
     this.selectedUnit = null;
 }
Exemplo n.º 23
0
        private void drawUnit(Graphics g, DrawingUnit unit)
        {
            int       x    = unit.X;
            int       y    = unit.Y;
            EquipItem item = unit.Item;

            g.DrawImage(item.Img, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
            if (item.Level > 0)
            {
                g.DrawString(string.Format("+{0}", item.Level), new Font("Arial", 8f), Brushes.White, (float)(x * 26), (float)(y * 26));
            }
            else if (item.IsNoDurability && item.Durability > 1)
            {
                g.DrawString(Convert.ToString(item.Durability), new Font("Arial", 6f), Brushes.White, (float)(x * 26), (float)(y * 26));
            }
            if (item.SN < 0)
            {
                g.DrawRectangle(Pens.White, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.XQ1 > 0 && (int)item.XQ1 < EquipEditor.xSocket.Length && item.XQ2 > 0 && (int)item.XQ2 < EquipEditor.xSocket.Length && item.XQ3 > 0 && (int)item.XQ3 < EquipEditor.xSocket.Length && item.XQ4 > 0 && (int)item.XQ4 < EquipEditor.xSocket.Length && item.XQ5 > 0 && (int)item.XQ5 < EquipEditor.xSocket.Length && item.YG > 0 && (int)item.YG < Utils.YGS.Length - 1 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Fuchsia, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (((item.XQ1 > 0 && (int)item.XQ1 < EquipEditor.xSocket.Length) || (item.XQ2 > 0 && (int)item.XQ2 < EquipEditor.xSocket.Length) || (item.XQ3 > 0 && (int)item.XQ3 < EquipEditor.xSocket.Length) || (item.XQ4 > 0 && (int)item.XQ4 < EquipEditor.xSocket.Length) || (item.XQ5 > 0 && (int)item.XQ5 < EquipEditor.xSocket.Length) || (item.YG > 0 && (int)item.YG < Utils.YGS.Length - 1)) && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Violet, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if ((item.XQ1 > 0 && (int)item.XQ1 < EquipEditor.xSocket.Length) || (item.XQ2 > 0 && (int)item.XQ2 < EquipEditor.xSocket.Length) || (item.XQ3 > 0 && (int)item.XQ3 < EquipEditor.xSocket.Length) || (item.XQ4 > 0 && (int)item.XQ4 < EquipEditor.xSocket.Length) || (item.XQ5 > 0 && (int)item.XQ5 < EquipEditor.xSocket.Length) || (item.YG > 0 && (int)item.YG < Utils.YGS.Length - 1))
            {
                g.DrawRectangle(Pens.Pink, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.PlusLevel > 0 && item.SetVal > 0 && item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6)
            {
                g.DrawRectangle(Pens.Aqua, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if ((item.SetVal > 0 && item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6) || (item.PlusLevel > 0 && item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6))
            {
                g.DrawRectangle(Pens.Turquoise, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6)
            {
                g.DrawRectangle(Pens.LawnGreen, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.PlusLevel > 0 && item.SetVal > 0 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Gold, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if ((item.PlusLevel > 0 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6)) || (item.SetVal > 0 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6)))
            {
                g.DrawRectangle(Pens.Yellow, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6)
            {
                g.DrawRectangle(Pens.YellowGreen, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.PlusLevel > 0)
            {
                g.DrawRectangle(Pens.SkyBlue, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
                return;
            }
            if (item.SetVal > 0)
            {
                g.DrawRectangle(Pens.Khaki, x * 26, y * 26, (int)(item.Width * 26), (int)(item.Height * 26));
            }
        }
Exemplo n.º 24
0
        public bool canPutItem(DrawingUnit unit)
        {
            EquipItem item = unit.Item;
            int       x    = unit.X;
            int       y    = unit.Y;

            if (x < 0 && x >= 12 && this.units[x] != null)
            {
                return(false);
            }
            ushort itemSlot = EquipEditor.xItem[item.Type * 512 + item.Code].ItemSlot;

            switch (this.index)
            {
            case 0:
            {
                if (itemSlot != 0)
                {
                    break;
                }
                return(true);
            }

            case 1:
            {
                if (itemSlot != 0 && itemSlot != 1)
                {
                    break;
                }
                return(true);
            }

            case 2:
            {
                if (itemSlot != 2)
                {
                    break;
                }
                return(true);
            }

            case 3:
            {
                if (itemSlot != 3)
                {
                    break;
                }
                return(true);
            }

            case 4:
            {
                if (itemSlot != 4)
                {
                    break;
                }
                return(true);
            }

            case 5:
            {
                if (itemSlot != 5)
                {
                    break;
                }
                return(true);
            }

            case 6:
            {
                if (itemSlot != 6)
                {
                    break;
                }
                return(true);
            }

            case 7:
            {
                if (itemSlot != 7)
                {
                    break;
                }
                return(true);
            }

            case 8:
            {
                if (itemSlot != 8)
                {
                    break;
                }
                return(true);
            }

            case 9:
            {
                if (itemSlot != 9)
                {
                    break;
                }
                return(true);
            }

            case 10:
            {
                if (itemSlot != 10 && itemSlot != 11)
                {
                    break;
                }
                return(true);
            }

            case 11:
            {
                if (itemSlot != 10 && itemSlot != 11)
                {
                    break;
                }
                return(true);
            }
            }
            return(false);
        }
Exemplo n.º 25
0
        public bool canPutItem(DrawingUnit unit)
        {
            EquipItem item = unit.Item;
            int       x    = unit.X;
            int       y    = unit.Y;

            if (x < 0 && x >= 12 && this.units[x] != null)
            {
                return(false);
            }
            ushort itemSlot = EquipEditor.xItem[(int)(item.Type * 512 + item.Code)].ItemSlot;

            switch (this.index)
            {
            case 0:
                if (itemSlot == 0)
                {
                    return(true);
                }
                break;

            case 1:
                if (itemSlot == 0 || itemSlot == 1)
                {
                    return(true);
                }
                break;

            case 2:
                if (itemSlot == 2)
                {
                    return(true);
                }
                break;

            case 3:
                if (itemSlot == 3)
                {
                    return(true);
                }
                break;

            case 4:
                if (itemSlot == 4)
                {
                    return(true);
                }
                break;

            case 5:
                if (itemSlot == 5)
                {
                    return(true);
                }
                break;

            case 6:
                if (itemSlot == 6)
                {
                    return(true);
                }
                break;

            case 7:
                if (itemSlot == 7)
                {
                    return(true);
                }
                break;

            case 8:
                if (itemSlot == 8)
                {
                    return(true);
                }
                break;

            case 9:
                if (itemSlot == 9)
                {
                    return(true);
                }
                break;

            case 10:
                if (itemSlot == 10 || itemSlot == 11)
                {
                    return(true);
                }
                break;

            case 11:
                if (itemSlot != 10)
                {
                    if (itemSlot != 11)
                    {
                        break;
                    }
                }
                return(true);
            }
            return(false);
        }
Exemplo n.º 26
0
 private void  除ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     this.removeItem(this.deleteUnit);
     Utils.ListWareHouse.Remove(this.deleteUnit.Item.ToString());
     this.deleteUnit = null;
 }
Exemplo n.º 27
0
        private void drawUnit(Graphics g, DrawingUnit unit)
        {
            int       x    = unit.X;
            int       y    = unit.Y;
            EquipItem item = unit.Item;
            int       num  = Math.Max(this.positions[x].Width - item.Width * 26 >> 1, 0);
            int       num1 = Math.Max(this.positions[x].Height - item.Height * 26 >> 1, 0);
            int       num2 = Math.Min(item.Width * 26, this.positions[x].Width);
            int       num3 = Math.Min(item.Height * 26, this.positions[x].Height);

            g.DrawImage(item.Img, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
            if (item.Level > 0)
            {
                g.DrawString(string.Format("+{0}", item.Level), new System.Drawing.Font("Arial", 8f), Brushes.White, (float)(this.positions[x].X + num), (float)(this.positions[x].Y + num1));
            }
            else if (item.IsNoDurability && item.Durability > 1)
            {
                g.DrawString(Convert.ToString(item.Durability), new System.Drawing.Font("Arial", 6f), Brushes.White, (float)(this.positions[x].X + num), (float)(this.positions[x].Y + num1));
            }
            if (item.SN < 0)
            {
                g.DrawRectangle(Pens.White, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.XQ1 > 0 && item.XQ1 < (int)EquipEditor.xSocket.Length && item.XQ2 > 0 && item.XQ2 < (int)EquipEditor.xSocket.Length && item.XQ3 > 0 && item.XQ3 < (int)EquipEditor.xSocket.Length && item.XQ4 > 0 && item.XQ4 < (int)EquipEditor.xSocket.Length && item.XQ5 > 0 && item.XQ5 < (int)EquipEditor.xSocket.Length && item.YG > 0 && item.YG < (int)Utils.YGS.Length - 1 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Fuchsia, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if ((item.XQ1 > 0 && item.XQ1 < (int)EquipEditor.xSocket.Length || item.XQ2 > 0 && item.XQ2 < (int)EquipEditor.xSocket.Length || item.XQ3 > 0 && item.XQ3 < (int)EquipEditor.xSocket.Length || item.XQ4 > 0 && item.XQ4 < (int)EquipEditor.xSocket.Length || item.XQ5 > 0 && item.XQ5 < (int)EquipEditor.xSocket.Length || item.YG > 0 && item.YG < (int)Utils.YGS.Length - 1) && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Violet, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.XQ1 > 0 && item.XQ1 < (int)EquipEditor.xSocket.Length || item.XQ2 > 0 && item.XQ2 < (int)EquipEditor.xSocket.Length || item.XQ3 > 0 && item.XQ3 < (int)EquipEditor.xSocket.Length || item.XQ4 > 0 && item.XQ4 < (int)EquipEditor.xSocket.Length || item.XQ5 > 0 && item.XQ5 < (int)EquipEditor.xSocket.Length || item.YG > 0 && item.YG < (int)Utils.YGS.Length - 1)
            {
                g.DrawRectangle(Pens.Pink, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.PlusLevel > 0 && item.SetVal > 0 && item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6)
            {
                g.DrawRectangle(Pens.Aqua, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.SetVal > 0 && item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6 || item.PlusLevel > 0 && item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6)
            {
                g.DrawRectangle(Pens.Turquoise, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.ZY1 && item.ZY2 && item.ZY3 && item.ZY4 && item.ZY5 && item.ZY6)
            {
                g.DrawRectangle(Pens.LawnGreen, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.PlusLevel > 0 && item.SetVal > 0 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Gold, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.PlusLevel > 0 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6) || item.SetVal > 0 && (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6))
            {
                g.DrawRectangle(Pens.Yellow, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.ZY1 || item.ZY2 || item.ZY3 || item.ZY4 || item.ZY5 || item.ZY6)
            {
                g.DrawRectangle(Pens.YellowGreen, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.PlusLevel > 0)
            {
                g.DrawRectangle(Pens.SkyBlue, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
                return;
            }
            if (item.SetVal > 0)
            {
                g.DrawRectangle(Pens.Khaki, this.positions[x].X + num, this.positions[x].Y + num1, num2, num3);
            }
        }
Exemplo n.º 28
0
        private void EquipPanel_MouseClick(object sender, MouseEventArgs e)
        {
            DrawingUnit drawingUnit = null;
            int         x           = e.X / 26;
            int         y           = e.Y / 26;

            if (e.Button == System.Windows.Forms.MouseButtons.Right)
            {
                if (this.activeUnit == null)
                {
                    DrawingUnit drawingUnit1 = this.findUnit(x, y);
                    drawingUnit = drawingUnit1;
                    if (drawingUnit1 == null)
                    {
                        this.muCopy.Show(this, e.X, e.Y);
                    }
                    else
                    {
                        this.deleteUnit = drawingUnit;
                        this.popMenu.Show(this, e.X, e.Y);
                    }
                }
                else
                {
                    this.activeUnit.X = this.lastedX;
                    this.activeUnit.Y = this.lastedY;
                    if (this.canPutItem(this.activeUnit) && this.putItem(this.activeUnit, false))
                    {
                        this.selectedUnit = null;
                        this.activeUnit   = null;
                        DrawingUnit drawingUnit2 = this.findUnit(x, y);
                        drawingUnit = drawingUnit2;
                        if (drawingUnit2 == null)
                        {
                            this.muCopy.Show(this, e.X, e.Y);
                        }
                        else
                        {
                            this.deleteUnit = drawingUnit;
                            this.popMenu.Show(this, e.X, e.Y);
                        }
                    }
                }
            }
            else if (this.activeUnit != null)
            {
                this.activeUnit.X = x;
                this.activeUnit.Y = y;
                if (!this.canPutItem(this.activeUnit) || !this.putItem(this.activeUnit, false))
                {
                    this.activeUnit.X = this.lastedX;
                    this.activeUnit.Y = this.lastedY;
                    if (this.canPutItem(this.activeUnit) && this.putItem(this.activeUnit, false))
                    {
                        this.selectedUnit = null;
                        this.activeUnit   = null;
                    }
                    this.EquipPanel_MouseClick(sender, e);
                }
                else
                {
                    this.selectedUnit = null;
                    this.activeUnit   = null;
                }
            }
            else
            {
                drawingUnit     = this.findUnit(x, y);
                this.activeUnit = drawingUnit;
                if (this.activeUnit != null)
                {
                    this.removeItem(this.activeUnit);
                }
                if (!this.flags[x, y] && this.selectedUnit != null)
                {
                    this.removeItem(this.selectedUnit);
                    this.activeUnit   = this.selectedUnit;
                    this.lastedX      = this.selectedUnit.X;
                    this.lastedY      = this.selectedUnit.Y;
                    this.selectedUnit = null;
                }
                if (drawingUnit != null)
                {
                    if ((int)base.Parent.Parent.Controls.Find("tabcInfo", false).Length > 0)
                    {
                        ((TabControl)base.Parent.Parent.Controls.Find("tabcInfo", false)[0]).SelectedIndex = 2;
                    }
                    this.selectedUnit = drawingUnit;
                    this.lastedX      = this.selectedUnit.X;
                    this.lastedY      = this.selectedUnit.Y;
                    this.editor.updateUI(drawingUnit.Item);
                }
            }
            base.Invalidate();
        }
Exemplo n.º 29
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     this.setEquipProperty(this.deleteUnit);
     this.deleteUnit = null;
 }