示例#1
0
            public ItemButton(int i, ADAMenu inst)
            {
                this.i   = i;
                btn      = new Button();
                btn.Area = new Rectangle(244 + (i > 9 ? 240 : 0), 90 + ((i % 10) * 31), 234, 24);

                btn.OnMouseDown = delegate {
                    if (inst.CDB == -1)
                    {
                        inst.CDB = i;
                    }
                };

                btn.OnMouseUp = delegate {
                    if (inst.CDB != i)
                    {
                        DarosGame.Inventory.Pocket pkt = inst.CurrPkt;
                        Item.Item temp = pkt[i];
                        pkt[i]        = pkt[inst.CDB];
                        pkt[inst.CDB] = temp;
                        temp          = null;
                    }
                    inst.CDB = -1;
                };
            }
示例#2
0
            public ItemButton(int i, ADAMenu inst)
            {
                this.i = i;
                btn = new Button();
                btn.Area = new Rectangle(244 + (i > 9 ? 240 : 0), 90 + ((i % 10) * 31), 234, 24);

                btn.OnMouseDown = delegate {
                    if(inst.CDB == -1) {
                        inst.CDB = i;
                    }
                };

                btn.OnMouseUp = delegate {
                    if(inst.CDB != i) {
                        DarosGame.Inventory.Pocket pkt = inst.CurrPkt;
                        Item.Item temp = pkt[i];
                        pkt[i] = pkt[inst.CDB];
                        pkt[inst.CDB] = temp;
                        temp = null;
                    }
                    inst.CDB = -1;
                };
            }