public void UpdateForm(Vehicle v, Vehicle.VehicleSection s) { mainForm = (Main)Application.OpenForms[0]; sectionForm = mainForm.SectionForm; selectedVehicle = v; selectedSection = s; if (mainForm.vehicleType == "Aero/Space") { sectionForm.Vf8Chk.Enabled = true; } chasSize = s.secChassis.chasSize; corSize = s.secCore.corSize; sectionForm.buildQualLbl.Text = "Build Quality " + s.quality + " (" + s.buildRoll + ")"; sectionForm.pCPXLbl.Text = "CPX(" + selectedVehicle.pilotCPX + ")"; sectionForm.mCPXLbl.Text = "MCPX(" + selectedVehicle.mechCPX + ")"; v.setTCHS(); v.SetTotalPP(); tCHS = v.tCHS; VehiclePerk.PopPerkList(v); VehicleFlaw.PopFlawList(v); // sectionForm.upDateHPslots(); sectionForm.TotPerkPointLbl.Text = "Total Perk Points: " + v.totalPP.ToString(); sectionForm.TempDescLbl.Text = tempLblBuilder(); sectionForm.spentPPLbl.Text = selectedSection.SectionPPSpent().ToString(); sectionForm.totalPPLbl.Text = selectedVehicle.GetTotalUsedPP().ToString(); sectionForm.pwrCrLbl.Text = "Power Core: " + selectedSection.secCore.corSize.ToString(); HardPoint.updateHP(); VehicleCheck(); SetArmor(); sectionForm.armAdjustTrk.Value = selectedSection.armorAdjust; SetBaseMobillity(); sectionForm.ElecPerkFormSet(); sectionForm.moveLbl.Text = "Move: " + selectedVehicle.GetMove(); sectionForm.costLbl.Text = "Cost: " + selectedVehicle.GetTotalCost().ToString("N") + " Cr"; sectionForm.ShieldsFormSet(); sectionForm.ProtPerkFormSet(); selectedSection.PopSecCompList(); sectionForm.CompartmentSpaceAdjust(); sectionForm.compartmentLayout.Controls.Clear(); sectionForm.sectionCompLayout.Controls.Clear(); foreach (Compartment x in selectedSection.compList) { x.AddCompButton(); x.addButtons(); } sectionForm.BuildElectricSystems(); sectionForm.BuildMiscSystems(); }
public void RemoveHP() { int index; sectionForm.hardPointLayout.Controls.Remove(hpGrpBox); index = mainForm.selectedSection.hpList.IndexOf(this); mainForm.selectedSection.hpList.Remove(this); mainForm.selectedSection.SetHPperkCost(); sectionForm.spentPPLbl.Text = mainForm.selectedSection.SectionPPSpent().ToString(); sectionForm.totalPPLbl.Text = mainForm.selectedVehicle.GetTotalUsedPP().ToString(); MiscTools.remove_row(mainForm.selectedSection.sectionLP, index + 1); sectionForm.upDateHPslots(); mainForm.selectedSection.sectionLP.Height = mainForm.selectedSection.sectionLP.Height - 25; //PopHPTbl(); }