Forráskód Böngészése

Unify slider fixes

Bepis 6 éve
szülő
commit
d0ae1e943e
2 módosított fájl, 15 hozzáadás és 10 törlés
  1. 2 10
      Plugins/SliderUnlocker/Hooks.cs
  2. 13 0
      Plugins/SliderUnlocker/SliderMath.cs

+ 2 - 10
Plugins/SliderUnlocker/Hooks.cs

@@ -137,11 +137,7 @@ namespace SliderUnlocker
                         value = SliderMath.CalculatePosition(list, rate);
                         break;
                     case 1:
-                        if ((!name.StartsWith("cf_a_bust") && !name.EndsWith("_size")) || //breast fix
-                        !(name.Contains("thigh") && name.Contains("01"))) //thigh fix
-                        {
-                            value = SliderMath.CalculateRotation(list, rate);
-                        }
+                        value = SliderMath.SafeCalculateRotation(value, name, list, rate);
                         break;
                     default:
                         value = SliderMath.CalculateScale(list, rate);
@@ -170,11 +166,7 @@ namespace SliderUnlocker
                 }
                 if (flag[1])
                 {
-                    if (!(name.StartsWith("cf_a_bust") && name.EndsWith("_size")) && //breast fix
-                        !(name.Contains("thigh") && name.Contains("01"))) //thigh fix
-                    {
-                        value[1] = SliderMath.CalculateRotation(list, rate);
-                    }
+                    value[1] = SliderMath.SafeCalculateRotation(value[1], name, list, rate);
                 }
                 if (flag[2])
                 {

+ 13 - 0
Plugins/SliderUnlocker/SliderMath.cs

@@ -70,5 +70,18 @@ namespace SliderUnlocker
 
             return rot3 + vector2 * Mathf.Abs(rate - 1f);
         }
+
+        public static Vector3 SafeCalculateRotation(Vector3 original, string name, List<AnmKeyInfo> list, float rate)
+        {
+            if (!(name.StartsWith("cf_a_bust") && name.EndsWith("_size")) && //breast fix
+                        !(name.Contains("thigh") && name.Contains("01"))) //thigh fix
+            {
+                return CalculateRotation(list, rate);
+            }
+            else
+            {
+                return original;
+            }
+        }
     }
 }