예제 #1
0
        private void vehicleTurretCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (mapCheck.Checked)
            {
                ComboBox box   = (ComboBox)sender;
                int      index = Array.IndexOf(VehicleTurretHandler.list, vehicleTurretCombo.SelectedItem);
                if (vt_address == 0) // Address not yet scanned (TODO: Consider storing previously scanned addresses in a structure and reset on map change or scan for all addresses during map load)
                {
                    vt_address = VehicleTurretHandler.SetNewProjectile(VehicleTurretHandler.projectiles[index], (string)vehiclesCombo.SelectedItem);
                    if (vt_address != 0) // Scan success
                    {
                        vt_prev          = (string)vehiclesCombo.SelectedItem;
                        selectLabel.Text = "Selected: " + vehicleTurretCombo.SelectedItem;
                    }
                    else // Scan failure
                    {
                        selectLabel.Text        = "Scanning Failed";
                        vehicleTurretCombo.Text = "";
                    }
                }
                else // Address already scanned. No need to search again.
                {
                    VehicleTurretHandler.SetNewProjectile(VehicleTurretHandler.projectiles[index], vt_address);
                    selectLabel.Text = "Selected: " + vehicleTurretCombo.SelectedItem;
                }

                projectileCombo.Text = "";
                weaponsCombo.Text    = "";
                propCombo.Text       = "";
                miscCombo.Text       = "";
                armorCombo.Text      = "";
            }
        }
예제 #2
0
        private void spawnCombo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (spawnCombo.SelectedItem.ToString() == "Throw Frag Grenade")
            {
                GenericHandler.ResetProjectile();
                sg_prev                 = 0x0001AD;
                sg_address              = VehicleTurretHandler.SetNewProjectile(sg_prev, "Grenade");
                projectileCombo.Text    = "";
                weaponsCombo.Text       = "";
                vehiclesCombo.Text      = "";
                propCombo.Text          = "";
                miscCombo.Text          = "";
                vehicleTurretCombo.Text = "";
                armorCombo.Text         = "";
                selectLabel.Text        = "Selected: Frag Grenade";

                //Unlimited grenades
                uint addr = 0xBA3C01;
                grenadeCheck.Checked = true;
                byte[] data = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
                // nop, nop, nop, nop, nop, nop
                MemoryManager.WriteToAddress(addr, data);
            }
            else if (spawnCombo.SelectedItem.ToString() == "Fire Weapon")
            {
                if (sg_address != 0xB5DBA5)
                {
                    sg_prev = 0x0001AD;
                    GenericHandler.SetNewProjectile(sg_prev, sg_address);
                    sg_address = 0xB5DBA5;
                    vehicleTurretCombo.Enabled = false;
                    projectileCombo.Text       = "";
                    weaponsCombo.Text          = "";
                    vehiclesCombo.Text         = "";
                    propCombo.Text             = "";
                    miscCombo.Text             = "";
                    vehicleTurretCombo.Text    = "";
                    armorCombo.Text            = "";
                    selectLabel.Text           = "Selected: Default";
                }
            }
        }
예제 #3
0
 private void vehiclesCombo_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (mapCheck.Checked)
     {
         ComboBox box   = (ComboBox)sender;
         int      index = Array.IndexOf(VehicleHandler.list, vehiclesCombo.SelectedItem);
         VehicleHandler.SetNewProjectile(VehicleHandler.projectiles[index], sg_address);
         vehicleTurretCombo.Enabled = VehicleTurretHandler.accept_list.Contains((string)vehiclesCombo.SelectedItem); // Enable the vehicle turret combo box if the vehicle is in the accepted list of vehicles
         if (vt_address != 0)
         {
             VehicleTurretHandler.SetNewProjectile(VehicleTurretHandler.patch_reset[vt_prev], vt_address); // reset the old vehicles main gun back
             vt_address = 0;
         }
         sg_prev                 = VehicleHandler.projectiles[index];
         selectLabel.Text        = "Selected: " + vehiclesCombo.SelectedItem;
         projectileCombo.Text    = "";
         weaponsCombo.Text       = "";
         miscCombo.Text          = "";
         armorCombo.Text         = "";
         propCombo.Text          = "";
         vehicleTurretCombo.Text = "";
     }
 }