Skip to content

Commit 72be90e

Browse files
committed
feat(vehicle): overhaul paint/other rgb capable things and removed useless functions
1 parent c3ad0cd commit 72be90e

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

vMenu/menus/MpPedCustomization.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,35 @@ 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+
11021131
inheritanceMenu.OnListIndexChange += (_menu, listItem, oldSelectionIndex, newSelectionIndex, itemIndex) =>
11031132
{
11041133
_parentOne = inheritanceParentOne.ListIndex;

0 commit comments

Comments
 (0)