示例#1
0
        private void panel_StashButtons_MouseClick(object sender, MouseEventArgs e)
        {
            int _height = panel_StashButtons.Height / 4;
            int index   = e.Y / _height;

            if (index < 0)
            {
                index = 0;
            }

            panel_Items.Controls.Clear();
            InventoryControl newInv = new InventoryControl(StashItems[index], 7, 10, index);

            newInv.OnItemSelected += ItemSelectedHandler;
            panel_Items.Controls.Add(newInv);
        }
示例#2
0
        private void CharacterSlot_MouseClick(object sender, MouseEventArgs e)
        {
            CharacterSlot senderObj = (CharacterSlot)sender;
            Character senderChar = senderObj.OChar;
            int index = CurrentAccount.Characters.IndexOf(senderChar);

            lastSelectedCharacterSlot = CurrentAccount.Characters[index];

            if (e.Button==MouseButtons.Right)
            {
                contextMenuCharacter.Show(Cursor.Position);
                return;
            }

            //Ignore if already highlighted!
            if (senderObj.IsHighlighted)return;

            for (int i = 0; i < flowlayout_Characters.Controls.Count; i++)
            {
                CharacterSlot obj=((CharacterSlot)flowlayout_Characters.Controls[i]);
                if (obj.Equals(senderObj))
                {
                    obj.IsHighlighted = true;
                    obj.Invalidate();
                    continue;
                }

                obj.IsHighlighted = false;
                obj.BackColor = Color.Transparent;
                obj.Invalidate();
            }

            panel_Items.Controls.Clear();
            InventoryControl newInv = new InventoryControl(senderChar.InventoryItems, 10, 6);
            newInv.OnItemSelected += OnItemSelected;
            newInv.Dock=DockStyle.Fill;
            panel_Items.Controls.Add(newInv);

            //Clear Item Viewer
            itemViewer.CurrentItem = null;
            itemViewer.Invalidate();

            //MessageBox.Show(CurrentAccount.Characters[index].InventoryItems.Count.ToString());
        }
        private void panel_StashButtons_MouseClick(object sender, MouseEventArgs e)
        {
            int _height = panel_StashButtons.Height / 4;
            int index=e.Y / _height;
            if (index < 0) index = 0;

            panel_Items.Controls.Clear();
            InventoryControl newInv=new InventoryControl(StashItems[index], 7, 10, index);
            newInv.OnItemSelected += ItemSelectedHandler;
            panel_Items.Controls.Add(newInv);
        }