private void btnJets_Click(Button sender) { SetUnitTypeButtonActive(sender); activeList = Active_List.Jet; spawner.SpawnUnit(JunitPriceList.Type.PriceLists[jetUnitListIndex].PricedUnit); string name = JunitPriceList.Type.PriceLists[jetUnitListIndex].Name; int cost = JunitPriceList.Type.PriceLists[jetUnitListIndex].Price; txtUnitName.Text = "Name: " + name; txtUnitCost.Text = "Cost: " + cost.ToString(); bool alreadyPurchased = false; foreach (CustomizableUnit cu in JDBUnits) { if (cu.Name == name) { alreadyPurchased = true; break; } } btnBuy.Enable = !(alreadyPurchased || cash < cost); }
private void btnJets_Click(Button sender) { SetUnitTypeButtonActive(sender); activeList = Active_List.Jet; CustomizableUnit cu = JDBUnits[jetUnitListIndex]; spawner.SpawnUnit(JunitPriceList.Type.PriceLists[cu.ID].PricedUnit); UpdateVariantCost(-1); txtUnitName.Text = "Unit Name: " + cu.Name; }
private void btnMechs_Click(Button sender) { SetUnitTypeButtonActive(sender); activeList = Active_List.Mech; CustomizableUnit cu = MechDBUnits[mechListIndex]; spawner.SpawnUnit(MechsPriceList.Type.PriceLists[cu.ID].PricedUnit); UpdateVariantCost(-1); txtUnitName.Text = "Unit Name: " + cu.Name; }