private void idToolStripMenuItem_Click(object sender, EventArgs e) { AddAutoLootForm frm = new AddAutoLootForm(); if (frm.ShowDialog() == DialogResult.OK) { LootItem lootItem = new LootItem(frm.ItemId, frm.ContainerNumber, frm.Comment); listBoxItems.Items.Add(lootItem); _lootItems.Add(lootItem); } }
private void fFilteToolStripMenuItem_Click(object sender, EventArgs e) { uxFilterInput filterInput = new uxFilterInput(); if (filterInput.ShowDialog() == DialogResult.OK) { foreach (var i in ItemDataLists.AllItems) { if (i.Value.ValueRatio >= filterInput.Ratio) { LootItem lootItem = new LootItem((ushort) i.Value.Id, filterInput.ContainerNumber, i.Value.Name); listBoxItems.Items.Add(lootItem); _lootItems.Add(lootItem); } } } }
private void loadToolStripMenuItem_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Smart AutoLooter Files (*.salf)|*.salf"; dialog.Title = "Open File"; if (dialog.ShowDialog() == DialogResult.OK) { Tibia.Packets.NetworkMessage msg = new NetworkMessage(null, System.IO.File.ReadAllBytes(dialog.FileName)); try { ushort count = msg.GetUInt16(); for (int i = 0; i < count; i++) { LootItem lootItem = new LootItem(msg.GetUInt16(), msg.GetByte(), msg.GetString()); listBoxItems.Items.Add(lootItem); _lootItems.Add(lootItem); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } }