Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 41 additions & 1 deletion vMenu/CommonFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,14 @@ private static async void ApplyVehicleModsDelayed(Vehicle vehicle, VehicleInfo v
{
vehicle.Mods.PrimaryColor = (VehicleColor)vehicleInfo.colors["primary"];
}
if (vehicleInfo.colors.ContainsKey("PrimaryPaintFinish"))
{
var pearlColorReset = 0;
var wheelColorReset = 0;
GetVehicleExtraColours(vehicle.Handle, ref pearlColorReset, ref wheelColorReset);
SetVehicleModColor_1(vehicle.Handle, vehicleInfo.colors["PrimaryPaintFinish"], 0, 0);
SetVehicleExtraColours(vehicle.Handle, pearlColorReset, wheelColorReset);
}

bool useCustomRgbSecondary = vehicleInfo.colors.ContainsKey("customSecondaryR") && vehicleInfo.colors.ContainsKey("customSecondaryG") && vehicleInfo.colors.ContainsKey("customSecondaryB");
if (useCustomRgbSecondary && vehicleInfo.colors["customSecondaryR"] > 0 && vehicleInfo.colors["customSecondaryG"] > 0 && vehicleInfo.colors["customSecondaryB"] > 0)
Expand All @@ -1455,7 +1463,14 @@ private static async void ApplyVehicleModsDelayed(Vehicle vehicle, VehicleInfo v
{
vehicle.Mods.SecondaryColor = (VehicleColor)vehicleInfo.colors["secondary"];
}

if (vehicleInfo.colors.ContainsKey("SecondaryPaintFinish"))
{
var pearlColorReset = 0;
var wheelColorReset = 0;
GetVehicleExtraColours(vehicle.Handle, ref pearlColorReset, ref wheelColorReset);
SetVehicleModColor_2(vehicle.Handle, vehicleInfo.colors["SecondaryPaintFinish"], 0);
SetVehicleExtraColours(vehicle.Handle, pearlColorReset, wheelColorReset);
}
SetVehicleInteriorColour(vehicle.Handle, vehicleInfo.colors["trim"]);
SetVehicleDashboardColour(vehicle.Handle, vehicleInfo.colors["dash"]);

Expand All @@ -1472,6 +1487,11 @@ private static async void ApplyVehicleModsDelayed(Vehicle vehicle, VehicleInfo v

VehicleOptions.SetHeadlightsColorForVehicle(vehicle, vehicleInfo.headlightColor);

bool useCustomRgbHeadlight = vehicleInfo.colors.ContainsKey("customheadlightR") && vehicleInfo.colors.ContainsKey("customheadlightG") && vehicleInfo.colors.ContainsKey("customheadlightB");
if (useCustomRgbHeadlight)
{
SetVehicleXenonLightsCustomColor(vehicle.Handle, vehicleInfo.colors["customheadlightR"], vehicleInfo.colors["customheadlightG"], vehicleInfo.colors["customheadlightB"]);
}
vehicle.Mods.NeonLightsColor = System.Drawing.Color.FromArgb(red: vehicleInfo.colors["neonR"], green: vehicleInfo.colors["neonG"], blue: vehicleInfo.colors["neonB"]);
vehicle.Mods.SetNeonLightsOn(VehicleNeonLight.Left, vehicleInfo.neonLeft);
vehicle.Mods.SetNeonLightsOn(VehicleNeonLight.Right, vehicleInfo.neonRight);
Expand Down Expand Up @@ -1601,6 +1621,11 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
GetVehicleCustomPrimaryColour(veh.Handle, ref customPrimaryR, ref customPrimaryG, ref customPrimaryB);
}

if (veh.State.Get("vMenu:PrimaryPaintFinish") is int primaryPaintFinish)
{
colors.Add("PrimaryPaintFinish", primaryPaintFinish);
}

colors.Add("customPrimaryR", customPrimaryR);
colors.Add("customPrimaryG", customPrimaryG);
colors.Add("customPrimaryB", customPrimaryB);
Expand All @@ -1616,9 +1641,24 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
GetVehicleCustomSecondaryColour(veh.Handle, ref customSecondaryR, ref customSecondaryG, ref customSecondaryB);
}

if (veh.State.Get("vMenu:SecondaryPaintFinish") is int secondaryPaintFinish)
{
colors.Add("SecondaryPaintFinish", secondaryPaintFinish);
}

colors.Add("customSecondaryR", customSecondaryR);
colors.Add("customSecondaryG", customSecondaryG);
colors.Add("customSecondaryB", customSecondaryB);

int customheadlightR = -1;
int customheadlightG = -1;
int customheadlightB = -1;
if (GetVehicleXenonLightsCustomColor(veh.Handle, ref customheadlightR, ref customheadlightG, ref customheadlightB))
{
colors.Add("customheadlightR", customheadlightR);
colors.Add("customheadlightG", customheadlightG);
colors.Add("customheadlightB", customheadlightB);
}
#endregion

var extras = new Dictionary<int, bool>();
Expand Down
18 changes: 17 additions & 1 deletion vMenu/data/VehicleData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ public VehicleColor(int id, string label)
new VehicleColor(133, "OLIVE_GREEN"),
};

// Chameleon Colour List //
public static readonly List<VehicleColor> ChameleonColors = new()
{
new VehicleColor(223, "G9_PAINT01"),
Expand All @@ -343,6 +342,23 @@ public VehicleColor(int id, string label)
new VehicleColor(238, "G9_PAINT16"),
};

public static readonly List<int[]> NeonLightColors = new()
{
{ new int[3] { 255, 255, 255 } }, // White
{ new int[3] { 2, 21, 255 } }, // Blue
{ new int[3] { 3, 83, 255 } }, // Electric blue
{ new int[3] { 0, 255, 140 } }, // Mint Green
{ new int[3] { 94, 255, 1 } }, // Lime Green
{ new int[3] { 255, 255, 0 } }, // Yellow
{ new int[3] { 255, 150, 5 } }, // Golden Shower
{ new int[3] { 255, 62, 0 } }, // Orange
{ new int[3] { 255, 0, 0 } }, // Red
{ new int[3] { 255, 50, 100 } }, // Pony Pink
{ new int[3] { 255, 5, 190 } }, // Hot Pink
{ new int[3] { 35, 1, 255 } }, // Purple
{ new int[3] { 15, 3, 255 } }, // Blacklight
};

public static class Vehicles
{
#region Vehicle List Per Class
Expand Down
29 changes: 0 additions & 29 deletions vMenu/menus/MpPedCustomization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1099,35 +1099,6 @@ private void CreateMenu()
inheritanceMenu.AddMenuItem(inheritanceShapeMix);
inheritanceMenu.AddMenuItem(inheritanceSkinMix);

// formula from maintransition.#sc
float GetMinimum()
{
return currentCharacter.IsMale ? 0.05f : 0.3f;
}

float GetMaximum()
{
return currentCharacter.IsMale ? 0.7f : 0.95f;
}

float ClampMix(int value)
{
var sliderFraction = mixValues[value];
var min = GetMinimum();
var max = GetMaximum();

return min + (sliderFraction * (max - min));
}

int UnclampMix(float value)
{
var min = GetMinimum();
var max = GetMaximum();

var origFraction = (value - min) / (max - min);
return Math.Max(Math.Min((int)(origFraction * 10), 10), 0);
}

inheritanceMenu.OnListIndexChange += (_menu, listItem, oldSelectionIndex, newSelectionIndex, itemIndex) =>
{
_parentOne = inheritanceParentOne.ListIndex;
Expand Down
Loading
Loading