Skip to content

Commit f6cf33d

Browse files
committed
feat(vehicle): overhaul paint/other rgb capable things and removed useless functions
1 parent 36a5326 commit f6cf33d

File tree

3 files changed

+73
-518
lines changed

3 files changed

+73
-518
lines changed

vMenu/CommonFunctions.cs

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,14 +1445,6 @@ private static async void ApplyVehicleModsDelayed(Vehicle vehicle, VehicleInfo v
14451445
{
14461446
vehicle.Mods.PrimaryColor = (VehicleColor)vehicleInfo.colors["primary"];
14471447
}
1448-
if (vehicleInfo.colors.ContainsKey("PrimaryPaintFinish"))
1449-
{
1450-
var pearlColorReset = 0;
1451-
var wheelColorReset = 0;
1452-
GetVehicleExtraColours(vehicle.Handle, ref pearlColorReset, ref wheelColorReset);
1453-
SetVehicleModColor_1(vehicle.Handle, vehicleInfo.colors["PrimaryPaintFinish"], 0, 0);
1454-
SetVehicleExtraColours(vehicle.Handle, pearlColorReset, wheelColorReset);
1455-
}
14561448

14571449
bool useCustomRgbSecondary = vehicleInfo.colors.ContainsKey("customSecondaryR") && vehicleInfo.colors.ContainsKey("customSecondaryG") && vehicleInfo.colors.ContainsKey("customSecondaryB");
14581450
if (useCustomRgbSecondary && vehicleInfo.colors["customSecondaryR"] > 0 && vehicleInfo.colors["customSecondaryG"] > 0 && vehicleInfo.colors["customSecondaryB"] > 0)
@@ -1463,14 +1455,7 @@ private static async void ApplyVehicleModsDelayed(Vehicle vehicle, VehicleInfo v
14631455
{
14641456
vehicle.Mods.SecondaryColor = (VehicleColor)vehicleInfo.colors["secondary"];
14651457
}
1466-
if (vehicleInfo.colors.ContainsKey("SecondaryPaintFinish"))
1467-
{
1468-
var pearlColorReset = 0;
1469-
var wheelColorReset = 0;
1470-
GetVehicleExtraColours(vehicle.Handle, ref pearlColorReset, ref wheelColorReset);
1471-
SetVehicleModColor_2(vehicle.Handle, vehicleInfo.colors["SecondaryPaintFinish"], 0);
1472-
SetVehicleExtraColours(vehicle.Handle, pearlColorReset, wheelColorReset);
1473-
}
1458+
14741459
SetVehicleInteriorColour(vehicle.Handle, vehicleInfo.colors["trim"]);
14751460
SetVehicleDashboardColour(vehicle.Handle, vehicleInfo.colors["dash"]);
14761461

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

14881473
VehicleOptions.SetHeadlightsColorForVehicle(vehicle, vehicleInfo.headlightColor);
14891474

1490-
bool useCustomRgbHeadlight = vehicleInfo.colors.ContainsKey("customheadlightR") && vehicleInfo.colors.ContainsKey("customheadlightG") && vehicleInfo.colors.ContainsKey("customheadlightB");
1491-
if (useCustomRgbHeadlight)
1492-
{
1493-
SetVehicleXenonLightsCustomColor(vehicle.Handle, vehicleInfo.colors["customheadlightR"], vehicleInfo.colors["customheadlightG"], vehicleInfo.colors["customheadlightB"]);
1494-
}
14951475
vehicle.Mods.NeonLightsColor = System.Drawing.Color.FromArgb(red: vehicleInfo.colors["neonR"], green: vehicleInfo.colors["neonG"], blue: vehicleInfo.colors["neonB"]);
14961476
vehicle.Mods.SetNeonLightsOn(VehicleNeonLight.Left, vehicleInfo.neonLeft);
14971477
vehicle.Mods.SetNeonLightsOn(VehicleNeonLight.Right, vehicleInfo.neonRight);
@@ -1620,13 +1600,7 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
16201600
{
16211601
GetVehicleCustomPrimaryColour(veh.Handle, ref customPrimaryR, ref customPrimaryG, ref customPrimaryB);
16221602
}
1623-
1624-
if (!string.IsNullOrWhiteSpace($"{veh.State.Get("vMenu:PrimaryPaintFinish")}"))
1625-
{
1626-
colors.Add("PrimaryPaintFinish", Convert.ToInt32((object)veh.State.Get("vMenu:PrimaryPaintFinish")));
1627-
}
16281603

1629-
16301604
colors.Add("customPrimaryR", customPrimaryR);
16311605
colors.Add("customPrimaryG", customPrimaryG);
16321606
colors.Add("customPrimaryB", customPrimaryB);
@@ -1642,24 +1616,9 @@ public static async void SaveVehicle(string updateExistingSavedVehicleName = nul
16421616
GetVehicleCustomSecondaryColour(veh.Handle, ref customSecondaryR, ref customSecondaryG, ref customSecondaryB);
16431617
}
16441618

1645-
if (!string.IsNullOrWhiteSpace($"{veh.State.Get("vMenu:SecondaryPaintFinish")}"))
1646-
{
1647-
colors.Add("SecondaryPaintFinish", Convert.ToInt32((object)veh.State.Get("vMenu:SecondaryPaintFinish")));
1648-
}
1649-
16501619
colors.Add("customSecondaryR", customSecondaryR);
16511620
colors.Add("customSecondaryG", customSecondaryG);
16521621
colors.Add("customSecondaryB", customSecondaryB);
1653-
1654-
int customheadlightR = -1;
1655-
int customheadlightG = -1;
1656-
int customheadlightB = -1;
1657-
if (GetVehicleXenonLightsCustomColor(veh.Handle, ref customheadlightR, ref customheadlightG, ref customheadlightB))
1658-
{
1659-
colors.Add("customheadlightR", customheadlightR);
1660-
colors.Add("customheadlightG", customheadlightG);
1661-
colors.Add("customheadlightB", customheadlightB);
1662-
}
16631622
#endregion
16641623

16651624
var extras = new Dictionary<int, bool>();

vMenu/menus/MpPedCustomization.cs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,35 +1099,6 @@ private void CreateMenu()
10991099
inheritanceMenu.AddMenuItem(inheritanceShapeMix);
11001100
inheritanceMenu.AddMenuItem(inheritanceSkinMix);
11011101

1102-
// formula from maintransition.#sc
1103-
/*float GetMinimum()
1104-
{
1105-
return currentCharacter.IsMale ? 0.05f : 0.3f;
1106-
}
1107-
1108-
float GetMaximum()
1109-
{
1110-
return currentCharacter.IsMale ? 0.7f : 0.95f;
1111-
}
1112-
1113-
float ClampMix(int value)
1114-
{
1115-
var sliderFraction = mixValues[value];
1116-
var min = GetMinimum();
1117-
var max = GetMaximum();
1118-
1119-
return min + (sliderFraction * (max - min));
1120-
}
1121-
1122-
int UnclampMix(float value)
1123-
{
1124-
var min = GetMinimum();
1125-
var max = GetMaximum();
1126-
1127-
var origFraction = (value - min) / (max - min);
1128-
return Math.Max(Math.Min((int)(origFraction * 10), 10), 0);
1129-
}*/
1130-
11311102
inheritanceMenu.OnListIndexChange += (_menu, listItem, oldSelectionIndex, newSelectionIndex, itemIndex) =>
11321103
{
11331104
_parentOne = inheritanceParentOne.ListIndex;

0 commit comments

Comments
 (0)