Skip to content

Commit

Permalink
Add missing code that got lost (probably) in a merge conflict somewhe…
Browse files Browse the repository at this point in the history
…re. Code originally from PR #290 by MichaelCoding25
  • Loading branch information
TomGrobbe committed Aug 12, 2023
1 parent c78849e commit 0957783
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions vMenu/menus/VehicleOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ private void CreateMenu()
var tiresList = new List<string>() { "All Tires", "Tire #1", "Tire #2", "Tire #3", "Tire #4", "Tire #5", "Tire #6", "Tire #7", "Tire #8" };
var vehicleTiresList = new MenuListItem("Fix / Destroy Tires", tiresList, 0, "Fix or destroy a specific vehicle tire, or all of them at once. Note, not all indexes are valid for all vehicles, some might not do anything on certain vehicles.");

var destroyEngine = new MenuItem("Destroy Engine", "Destroys your vehicle's engine.");

var deleteBtn = new MenuItem("~r~Delete Vehicle", "Delete your vehicle, this ~r~can NOT be undone~s~!")
{
LeftIcon = MenuItem.Icon.WARNING,
Expand Down Expand Up @@ -371,7 +373,10 @@ private void CreateMenu()
if (IsAllowed(Permission.VOFixOrDestroyTires))
{
menu.AddMenuItem(vehicleTiresList);
//menu.AddMenuItem(destroyTireList);
}
if (IsAllowed(Permission.VODestroyEngine))
{
menu.AddMenuItem(destroyEngine);
}
if (IsAllowed(Permission.VOFreeze)) // FREEZE VEHICLE
{
Expand Down Expand Up @@ -507,7 +512,8 @@ private void CreateMenu()
{
SetLicensePlateCustomText();
}
else if (item == vehicleInvisible) // Make vehicle invisible.
// Make vehicle invisible.
else if (item == vehicleInvisible)
{
if (vehicle.IsVisible)
{
Expand All @@ -533,6 +539,11 @@ private void CreateMenu()
vehicle.IsVisible = !vehicle.IsVisible;
}
}
// Destroy vehicle engine
else if (item == destroyEngine)
{
SetVehicleEngineHealth(vehicle.Handle, -4000);
}
}
// If the player is not the driver seat and a button other than the option below (cycle seats) was pressed, notify them.
Expand Down Expand Up @@ -1881,6 +1892,7 @@ public void UpdateMods(int selectedIndex = 0)
var xenonHeadlights = new MenuCheckboxItem("Xenon Headlights", "Enable or disable ~b~xenon ~s~headlights.", IsToggleModOn(veh.Handle, 22));
var turbo = new MenuCheckboxItem("Turbo", "Enable or disable the ~y~turbo~s~ for this vehicle.", IsToggleModOn(veh.Handle, 18));
var bulletProofTires = new MenuCheckboxItem("Bullet Proof Tires", "Enable or disable ~y~bullet proof tires~s~ for this vehicle.", !GetVehicleTyresCanBurst(veh.Handle));
var lowGripTires = new MenuCheckboxItem("Low Grip Tires", "Enable or disable ~y~low grip tires~s~ for this vehicle.", GetDriftTyresEnabled(veh.Handle));

// Add the checkboxes to the menu.
VehicleModMenu.AddMenuItem(toggleCustomWheels);
Expand All @@ -1894,6 +1906,7 @@ public void UpdateMods(int selectedIndex = 0)
VehicleModMenu.AddMenuItem(headlightColor);
VehicleModMenu.AddMenuItem(turbo);
VehicleModMenu.AddMenuItem(bulletProofTires);
VehicleModMenu.AddMenuItem(lowGripTires);
// Create a list of tire smoke options.
var tireSmokes = new List<string>() { "Red", "Orange", "Yellow", "Gold", "Light Green", "Dark Green", "Light Blue", "Dark Blue", "Purple", "Pink", "Black" };
var tireSmokeColors = new Dictionary<string, int[]>()
Expand Down Expand Up @@ -1988,6 +2001,11 @@ public void UpdateMods(int selectedIndex = 0)
{
SetVehicleTyresCanBurst(veh.Handle, !_checked);
}
// Low Grip Tyres
else if (item2 == lowGripTires)
{
SetDriftTyresEnabled(veh.Handle, _checked);
}
// Custom Wheels
else if (item2 == toggleCustomWheels)
{
Expand Down

0 comments on commit 0957783

Please sign in to comment.