Skip to content

Commit

Permalink
Merge pull request #425 from Mathu-lmn/veh-customization-fix
Browse files Browse the repository at this point in the history
Fix vehicule customization menu crashing in builds < 2372
  • Loading branch information
XdGoldenTigerOfficial authored Aug 29, 2024
2 parents f18293b + d6568d6 commit e008d1f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions vMenu/menus/VehicleOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1892,8 +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);
VehicleModMenu.AddMenuItem(xenonHeadlights);
Expand All @@ -1906,7 +1905,14 @@ public void UpdateMods(int selectedIndex = 0)
VehicleModMenu.AddMenuItem(headlightColor);
VehicleModMenu.AddMenuItem(turbo);
VehicleModMenu.AddMenuItem(bulletProofTires);
VehicleModMenu.AddMenuItem(lowGripTires);

bool isLowGripAvailable = GetGameBuildNumber() >= 2372;
var lowGripTires = new MenuCheckboxItem("Low Grip Tires", "Enable or disable ~y~low grip tires~s~ for this vehicle.", isLowGripAvailable ? GetDriftTyresEnabled(veh.Handle) : false);
if (isLowGripAvailable)
{
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

0 comments on commit e008d1f

Please sign in to comment.