private void btnRemoveItem_Click(object sender, EventArgs e) { ItemEx item = pgItem.SelectedObject as ItemEx; if (item != null) { ItemHelper.RemoveItem(item.Item); } btnRemoveItem.Enabled = false; }
private void btnGive_Click(object sender, EventArgs e) { ItemEx item = pgItem.SelectedObject as ItemEx; if (item != null && item.Active) { me.GetItem(Main.myPlayer, item.Item); } btnGiveItem.Enabled = false; btnRemoveItem.Enabled = true; }
private void lvItems_SelectedIndexChanged(object sender, EventArgs e) { if (lvItems.SelectedItems.Count > 0) { ItemType type = lvItems.SelectedItems[0].Tag as ItemType; ItemEx item = type.CreateItem(); pgItem.SelectedObject = item; nudStack.Minimum = 1; nudStack.Maximum = Math.Max(1, item.MaxStack); nudStack.Value = Math.Max(1, item.MaxStack); btnGiveItem.Enabled = btnGiveOne.Enabled = btnThrowOne.Enabled = btnGiveN.Enabled = btnThrowN.Enabled = true; btnRemoveItem.Enabled = false; } }