private void MergeButton_Click(object sender, EventArgs e) { if (StorageCheckedListBox.CheckedItems.Count != 3) { Log.LogInfo("请选择三件同等级装备"); return; } Equipment[] eq = new Equipment[3]; int j = 0; for (int i = 0; i < StorageCheckedListBox.Items.Count; i++) { if (StorageCheckedListBox.GetItemChecked(i)) { eq[j] = (Equipment)StorageCheckedListBox.Items[i]; j = j + 1; } } if (eq[0].Quality == eq[1].Quality && eq[0].Quality == eq[2].Quality && eq[0].Quality < 5) { EquipmentOperation.MergeEquipment(eq); UpdateStorage(); } else { Log.LogInfo("请选择三件同等级装备"); } }
private void SellButton_Click(object sender, EventArgs e) { if (StorageCheckedListBox.CheckedItems.Count < 1) { Log.LogInfo("请选择一件装备"); return; } for (int i = 0; i < StorageCheckedListBox.Items.Count; i++) { if (StorageCheckedListBox.GetItemChecked(i)) { Equipment eq = (Equipment)StorageCheckedListBox.Items[i]; EquipmentOperation.SellEquipment(eq); } } UpdateStorage(); }