コード例 #1
0
ファイル: Cavebot.cs プロジェクト: Creative-Person/Ladabot
 private void addToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     Objects.Bot.LootItem lot = Forms.Settings.AddLoot.GetItem();
     if (lot != null)
     {
         Core.Global.LootList.Add(lot);
     }
 }
コード例 #2
0
ファイル: Cavebot.cs プロジェクト: Creative-Person/Ladabot
        private void listBox2_DoubleClick(object sender, EventArgs e)
        {
            int Index = listBox2.SelectedIndex;

            if (Index > -1)
            {
                Objects.Bot.LootItem i      = Core.Global.LootList[Index];
                Objects.Bot.LootItem Edited = Forms.Settings.AddLoot.GetItem(i);
                if (Edited != null)
                {
                    Core.Global.LootList[Index] = Edited;
                }
            }
        }
コード例 #3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Objects.Bot.LootItem l = new Objects.Bot.LootItem();
         int.TryParse(TextBox1.Text, out l.Id);
         int.TryParse(TextBox2.Text, out l.Cap);
         l.Destination           = GetDest();
         LootItem                = l;
         l.ContainerDestionation = (byte)comboBox2.SelectedIndex;
         m_AddLoot.Dispose();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #4
0
        public static Objects.Bot.LootItem GetItem(Objects.Bot.LootItem Item = null)
        {
            m_AddLoot = new AddLoot();

            if (Item != null)
            {
                switch (Item.Destination)
                {
                case Constants.LootDestination.Container:
                    m_AddLoot.comboBox1.SelectedIndex = 0;
                    break;

                case Constants.LootDestination.LeftHand:
                    m_AddLoot.comboBox1.SelectedIndex = 1;
                    break;

                case Constants.LootDestination.RightHand:
                    m_AddLoot.comboBox1.SelectedIndex = 2;
                    break;

                case Constants.LootDestination.Arrow:
                    m_AddLoot.comboBox1.SelectedIndex = 3;
                    break;

                case Constants.LootDestination.Ground:
                    m_AddLoot.comboBox1.SelectedIndex = 4;
                    break;
                }
                m_AddLoot.TextBox1.Text           = Item.Id.ToString();
                m_AddLoot.TextBox2.Text           = Item.Cap.ToString();
                m_AddLoot.comboBox2.SelectedIndex = Item.ContainerDestionation;
            }
            else
            {
                m_AddLoot.comboBox1.SelectedIndex = 0;
                m_AddLoot.comboBox2.SelectedIndex = 16;
            }
            m_AddLoot.TopMost = true;
            m_AddLoot.TextBox1.Focus();
            m_AddLoot.ShowDialog();

            return(LootItem);
        }