示例#1
0
        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();
        }
示例#2
0
        public rowCreation(HardPoint ih, int c)
        {
            mainForm    = (Main)Application.OpenForms[0];
            sectionForm = mainForm.SectionForm;
            col         = c;
            inHp        = ih;
            hpTypLbl    = new Label()
            {
                Dock = DockStyle.Fill,
                Text = inHp.hpString
            };
            weaponSelect = new ComboBox()
            {
                Dock          = DockStyle.Fill,
                DisplayMember = "Text",
                ValueMember   = "Value"
            };
            weaponSelect.Items.Add(new { Text = Main.availWeapList[0].Name, Value = Main.availWeapList[0] });
            foreach (VehWeapon v in Main.availWeapList)
            {
                if (inHp.weaponAbrev == v.HPTYPE)
                {
                    weaponSelect.Items.Add(new { Text = v.Name, Value = v });
                }
            }
            if (inHp.VehicleWeapon != null)
            {
                weaponSelect.SelectedItem = inHp.VehicleWeapon;
                weaponSelect.Text         = inHp.VehicleWeapon.Name;
            }

            else
            {
                weaponSelect.SelectedItem = weaponSelect.Items[0];
            }
            weaponSelect.SelectedIndexChanged += new EventHandler(VehWeapon_Selection);
            mainForm.selectedSection.sectionLP.RowCount++;
            mainForm.selectedSection.sectionLP.Height = mainForm.selectedSection.sectionLP.Height + 25;
            mainForm.selectedSection.sectionLP.RowStyles.Add(new RowStyle(SizeType.Absolute, 25f));
            mainForm.selectedSection.sectionLP.Controls.Add(hpTypLbl, 0, col);
            if (inHp.holdHPform)
            {
                inHp.VehicleWeapon = new VehWeapon(inHp.weaponString, "", "", "", "", "", "", "", "", "", 0, 0);
                mainForm.selectedSection.sectionLP.Controls.Add(new Label()
                {
                    Dock = DockStyle.Fill,
                    Text = inHp.weaponString
                });
            }
            else
            {
                mainForm.selectedSection.sectionLP.Controls.Add(weaponSelect, 1, col);
            }
            for (int i = 0; i < controls.Length; i++)
            {
                controls[i] = new Label()
                {
                    Dock = DockStyle.Fill,
                    Text = "",
                    Font = new Font("Arial", 7, FontStyle.Regular)
                };
            }

            mainForm.selectedSection.sectionLP.Controls.Add(controls[0], 2, col);
            mainForm.selectedSection.sectionLP.Controls.Add(controls[1], 3, col);
            mainForm.selectedSection.sectionLP.Controls.Add(controls[2], 4, col);
            mainForm.selectedSection.sectionLP.Controls.Add(controls[3], 5, col);
            mainForm.selectedSection.sectionLP.Controls.Add(controls[4], 6, col);
            mainForm.selectedSection.sectionLP.Controls.Add(controls[5], 7, col);

            if (inHp.VehicleWeapon != null)
            {
                controls[0].Text = inHp.VehicleWeapon.ACC;
                controls[1].Text = inHp.VehicleWeapon.DMG;
                controls[2].Text = inHp.VehicleWeapon.ROF;
                controls[3].Text = inHp.VehicleWeapon.AMMO + " / " + inHp.VehicleWeapon.AMMO_TYPE;
                controls[4].Text = inHp.VehicleWeapon.Range;
                controls[5].Text = inHp.VehicleWeapon.Special;
            }
            void VehWeapon_Selection(object sender, EventArgs e)
            {
                if ((weaponSelect.SelectedItem as dynamic).Value == inHp.VehicleWeapon)
                {
                    return;
                }
                else
                {
                    inHp.VehicleWeapon       = (weaponSelect.SelectedItem as dynamic).Value;
                    sectionForm.costLbl.Text = "Cost: " + mainForm.selectedVehicle.GetTotalCost().ToString("N") + " Cr";
                    controls[0].Text         = inHp.VehicleWeapon.ACC;
                    controls[1].Text         = inHp.VehicleWeapon.DMG;
                    controls[2].Text         = inHp.VehicleWeapon.ROF;
                    controls[3].Text         = inHp.VehicleWeapon.AMMO + " / " + inHp.VehicleWeapon.AMMO_TYPE;
                    controls[4].Text         = inHp.VehicleWeapon.Range;
                    controls[5].Text         = inHp.VehicleWeapon.Special;
                    inHp.PopHPTbl();
                }
            }
        }
 public void addFreeMan(object sender, EventArgs e)
 {
     HardPoint x = new HardPoint("Free Manipulator Arm");
 }
 private void addUHPBtn_Click(object sender, EventArgs e)
 {
     HardPoint x = new HardPoint("Ultra HP");
 }
 private void addHHPBtn_Click(object sender, EventArgs e)
 {
     HardPoint x = new HardPoint("Heavy HP");
 }
 private void addMHPBtn_Click(object sender, EventArgs e)
 {
     HardPoint x = new HardPoint("Medium HP");
 }
 private void addLHPBtn_Click(object sender, EventArgs e)
 {
     HardPoint x = new HardPoint("Light HP");
 }
 private void addManHP_Click(object sender, EventArgs e)
 {
     HardPoint x = new HardPoint("Manipulator Arm");
 }