Ver código fonte

Format code with VS2019

denikson 6 anos atrás
pai
commit
a13b2297e5

+ 16 - 0
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Config.cs

@@ -7,7 +7,10 @@ namespace CM3D2.MultipleMaids.Plugin
         public void Preference()
         {
             if (isPref)
+            {
                 return;
+            }
+
             isPref = true;
             if (Preferences["config"]["hair_setting"].Value == "true")
             {
@@ -44,7 +47,10 @@ namespace CM3D2.MultipleMaids.Plugin
             }
 
             if (Preferences["config"]["hair_details"].Value == "true")
+            {
                 isShosai = true;
+            }
+
             IniKey iniKey3 = Preferences["config"]["vr_scroll"];
             if (iniKey3.Value == "false")
             {
@@ -57,15 +63,23 @@ namespace CM3D2.MultipleMaids.Plugin
             }
 
             if (Preferences["config"]["shift_f7"].Value == "true")
+            {
                 isF7S = true;
+            }
+
             if (Preferences["config"]["shift_f8"].Value == "false")
+            {
                 isVR2 = false;
+            }
+
             IniKey iniKey4 = Preferences["config"]["ik_all"];
             if (iniKey4.Value == "true")
             {
                 isIKAll = true;
                 for (int index = 0; index < maxMaidCnt; ++index)
+                {
                     isIK[index] = true;
+                }
             }
             else if (iniKey4.Value != "false")
             {
@@ -73,7 +87,9 @@ namespace CM3D2.MultipleMaids.Plugin
                 SaveConfig();
                 isIKAll = true;
                 for (int index = 0; index < maxMaidCnt; ++index)
+                {
                     isIK[index] = true;
+                }
             }
 
             if (!int.TryParse(Preferences["config"]["scene_max"].Value, out maxPage))

Diferenças do arquivo suprimidas por serem muito extensas
+ 2767 - 1857
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Gui.cs


+ 65 - 25
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.IK.cs

@@ -86,7 +86,7 @@ namespace CM3D2.MultipleMaids.Plugin
             mMaidC[k].obj = gMaidC[k];
             gMaidC[k].transform.localScale = new Vector3(0.12f, 0.12f, 0.12f);
             gMaidC[k].GetComponent<Renderer>().material =
-                    new Material(Shader.Find("Transparent/Diffuse")) {color = new Color(0.5f, 0.5f, 1f, 0.8f)};
+                    new Material(Shader.Find("Transparent/Diffuse")) { color = new Color(0.5f, 0.5f, 1f, 0.8f) };
             gMaidC[k].layer = 8;
         }
 
@@ -96,7 +96,10 @@ namespace CM3D2.MultipleMaids.Plugin
             {
                 gFinger[k, index] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                 if (index % 3 != 0)
+                {
                     ;
+                }
+
                 mFinger[k, index] = gFinger[k, index].AddComponent<MouseDrag>();
                 mFinger[k, index].obj = gFinger[k, index];
                 float num = 0.0f;
@@ -153,7 +156,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
 
                 gFinger[k, index].transform.localScale = new Vector3(num, num, num);
-                var material = new Material(Shader.Find("Transparent/Diffuse"));
+                Material material = new Material(Shader.Find("Transparent/Diffuse"));
                 gFinger[k, index].GetComponent<Renderer>().material = material;
                 gFinger[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
             }
@@ -193,7 +196,7 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
 
                 gFinger2[k, index].transform.localScale = new Vector3(num, num, num);
-                var material = new Material(Shader.Find("Transparent/Diffuse"));
+                Material material = new Material(Shader.Find("Transparent/Diffuse"));
                 gFinger2[k, index].GetComponent<Renderer>().material = material;
                 gFinger2[k, index].GetComponent<MeshRenderer>().material.color = new Color(0.0f, 0.0f, 1f, 0.2f);
             }
@@ -201,12 +204,18 @@ namespace CM3D2.MultipleMaids.Plugin
 
         private void SetIKInit(int k)
         {
-            var material = new Material(Shader.Find("Transparent/Diffuse"));
-            material.color = new Color(0.4f, 0.4f, 1f, 0.3f);
-            m_material2 = new Material(Shader.Find("Transparent/Diffuse"));
-            m_material2.color = new Color(0.4f, 0.4f, 1f, 0.26f);
-            m_material3 = new Material(Shader.Find("Transparent/Diffuse"));
-            m_material3.color = new Color(0.4f, 0.4f, 1f, 0.36f);
+            Material material = new Material(Shader.Find("Transparent/Diffuse"))
+            {
+                color = new Color(0.4f, 0.4f, 1f, 0.3f)
+            };
+            m_material2 = new Material(Shader.Find("Transparent/Diffuse"))
+            {
+                color = new Color(0.4f, 0.4f, 1f, 0.26f)
+            };
+            m_material3 = new Material(Shader.Find("Transparent/Diffuse"))
+            {
+                color = new Color(0.4f, 0.4f, 1f, 0.36f)
+            };
             gHandL[k] = GameObject.CreatePrimitive(PrimitiveType.Sphere);
             gHandL[k].GetComponent<Renderer>().enabled = false;
             gHandL[k].layer = 8;
@@ -304,28 +313,28 @@ namespace CM3D2.MultipleMaids.Plugin
                 gClavicleR[k].GetComponent<Renderer>().material = m_material2;
             }
 
-            var gameObject1 = new GameObject();
+            GameObject gameObject1 = new GameObject();
             gameObject1.transform.SetParent(transform, false);
             gizmoHandL[k] = gameObject1.AddComponent<GizmoRender>();
             gizmoHandL[k].eRotate = true;
             gizmoHandL[k].offsetScale = 0.25f;
             gizmoHandL[k].lineRSelectedThick = 0.25f;
             gizmoHandL[k].Visible = false;
-            var gameObject2 = new GameObject();
+            GameObject gameObject2 = new GameObject();
             gameObject2.transform.SetParent(transform, false);
             gizmoHandR[k] = gameObject2.AddComponent<GizmoRender>();
             gizmoHandR[k].eRotate = true;
             gizmoHandR[k].offsetScale = 0.25f;
             gizmoHandR[k].lineRSelectedThick = 0.25f;
             gizmoHandR[k].Visible = false;
-            var gameObject3 = new GameObject();
+            GameObject gameObject3 = new GameObject();
             gameObject3.transform.SetParent(transform, false);
             gizmoFootL[k] = gameObject3.AddComponent<GizmoRender>();
             gizmoFootL[k].eRotate = true;
             gizmoFootL[k].offsetScale = 0.25f;
             gizmoFootL[k].lineRSelectedThick = 0.25f;
             gizmoFootL[k].Visible = false;
-            var gameObject4 = new GameObject();
+            GameObject gameObject4 = new GameObject();
             gameObject4.transform.SetParent(transform, false);
             gizmoFootR[k] = gameObject4.AddComponent<GizmoRender>();
             gizmoFootR[k].eRotate = true;
@@ -476,9 +485,12 @@ namespace CM3D2.MultipleMaids.Plugin
         private void CopyIK(Maid maid, int i, Maid maid2, int i2)
         {
             poseIndex[i] = poseIndex[i2];
-            if (!(bool) maid || !maid.Visible)
+            if (!(bool)maid || !maid.Visible)
+            {
                 return;
-            var strArray = poseArray[poseIndex[i]].Split(',');
+            }
+
+            string[] strArray = poseArray[poseIndex[i]].Split(',');
             isStop[i] = false;
             if (strArray[0].Contains("_momi") || strArray[0].Contains("paizuri_"))
             {
@@ -494,10 +506,10 @@ namespace CM3D2.MultipleMaids.Plugin
             if (strArray[0].Contains("MultipleMaidsPose"))
             {
                 string path = strArray[0].Split('/')[1];
-                var numArray = new byte[0];
+                byte[] numArray = new byte[0];
                 try
                 {
-                    using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
+                    using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
                     {
                         numArray = new byte[fileStream.Length];
                         fileStream.Read(numArray, 0, numArray.Length);
@@ -509,19 +521,20 @@ namespace CM3D2.MultipleMaids.Plugin
                 {
                     long hashCode = Path.GetFileName(path).GetHashCode();
                     maid.body0.CrossFade(hashCode.ToString(), numArray, false, false, false, 0.0f, 1f);
-                    var autoTwistArray = new Maid.AutoTwist[6]
+                    Maid.AutoTwist[] autoTwistArray = new Maid.AutoTwist[6]
                     {
                             Maid.AutoTwist.ShoulderL, Maid.AutoTwist.ShoulderR, Maid.AutoTwist.WristL, Maid.AutoTwist.WristR,
                             Maid.AutoTwist.ThighL, Maid.AutoTwist.ThighR
                     };
                     foreach (Maid.AutoTwist f_eType in autoTwistArray)
+                    {
                         maid.SetAutoTwist(f_eType, true);
+                    }
                 }
             }
             else
             {
-                int result;
-                if (strArray[0].StartsWith("p") && int.TryParse(strArray[0].Substring(1), out result))
+                if (strArray[0].StartsWith("p") && int.TryParse(strArray[0].Substring(1), out int result))
                 {
                     loadPose[i] = strArray[0];
                 }
@@ -531,8 +544,11 @@ namespace CM3D2.MultipleMaids.Plugin
                 }
                 else
                 {
-                    if (!(bool) maid.body0.m_Bones.GetComponent<Animation>().GetClip(strArray[0] + ".anm"))
+                    if (!(bool)maid.body0.m_Bones.GetComponent<Animation>().GetClip(strArray[0] + ".anm"))
+                    {
                         maid.body0.LoadAnime(strArray[0] + ".anm", GameUty.FileSystem, strArray[0] + ".anm", false, false);
+                    }
+
                     maid.body0.m_Bones.GetComponent<Animation>().Play(strArray[0] + ".anm");
                 }
             }
@@ -607,11 +623,17 @@ namespace CM3D2.MultipleMaids.Plugin
             Vector3 localEulerAngles20 = HandR1[i2].localEulerAngles;
             Vector3 localEulerAngles21 = HandL2[i2].localEulerAngles;
             Vector3 localEulerAngles22 = HandR2[i2].localEulerAngles;
-            var vector3Array = new Vector3[40];
+            Vector3[] vector3Array = new Vector3[40];
             for (int index = 0; index < 20; ++index)
+            {
                 vector3Array[index] = Finger[i2, index].localEulerAngles;
+            }
+
             for (int index = 20; index < 40; ++index)
+            {
                 vector3Array[index] = Finger[i2, index].localEulerAngles;
+            }
+
             Vector3 eulerAngles10 = UpperArmL1[i2].eulerAngles;
             Vector3 eulerAngles11 = ForearmL1[i2].eulerAngles;
             Vector3 eulerAngles12 = UpperArmR1[i2].eulerAngles;
@@ -654,9 +676,15 @@ namespace CM3D2.MultipleMaids.Plugin
             HandL2[i].localEulerAngles = localEulerAngles21;
             HandR2[i].localEulerAngles = localEulerAngles22;
             for (int index = 0; index < 20; ++index)
+            {
                 Finger[i, index].localEulerAngles = vector3Array[index];
+            }
+
             for (int index = 20; index < 40; ++index)
+            {
                 Finger[i, index].localEulerAngles = vector3Array[index];
+            }
+
             transform20.localEulerAngles = localEulerAngles1;
             transform21.localEulerAngles = localEulerAngles2;
             transform22.localEulerAngles = localEulerAngles3;
@@ -747,11 +775,17 @@ namespace CM3D2.MultipleMaids.Plugin
             Vector3 localEulerAngles20 = HandR1[i].localEulerAngles;
             Vector3 localEulerAngles21 = HandL2[i].localEulerAngles;
             Vector3 localEulerAngles22 = HandR2[i].localEulerAngles;
-            var vector3Array = new Vector3[40];
+            Vector3[] vector3Array = new Vector3[40];
             for (int index = 0; index < 20; ++index)
+            {
                 vector3Array[index] = Finger[i, index].localEulerAngles;
+            }
+
             for (int index = 20; index < 40; ++index)
+            {
                 vector3Array[index] = Finger[i, index].localEulerAngles;
+            }
+
             Vector3 eulerAngles12 = UpperArmL1[i].eulerAngles;
             Vector3 eulerAngles13 = ForearmL1[i].eulerAngles;
             Vector3 eulerAngles14 = UpperArmR1[i].eulerAngles;
@@ -760,8 +794,8 @@ namespace CM3D2.MultipleMaids.Plugin
             Vector3 eulerAngles17 = ForearmL2[i].eulerAngles;
             Vector3 eulerAngles18 = UpperArmR2[i].eulerAngles;
             Vector3 eulerAngles19 = ForearmR2[i].eulerAngles;
-            transform21.eulerAngles = new Vector3((float) (360.0 - (eulerAngles11.x + 270.0) - 270.0),
-                                                  (float) (360.0 - (eulerAngles11.y + 90.0) - 90.0),
+            transform21.eulerAngles = new Vector3((float)(360.0 - (eulerAngles11.x + 270.0) - 270.0),
+                                                  (float)(360.0 - (eulerAngles11.y + 90.0) - 90.0),
                                                   360f - eulerAngles11.z);
             transform1.eulerAngles = getHanten(eulerAngles10);
             transform2.eulerAngles = getHanten(eulerAngles9);
@@ -778,9 +812,15 @@ namespace CM3D2.MultipleMaids.Plugin
             HandR2[i].localEulerAngles = getHanten2(localEulerAngles21);
             HandL2[i].localEulerAngles = getHanten2(localEulerAngles22);
             for (int index = 0; index < 20; ++index)
+            {
                 Finger[i, index].localEulerAngles = getHanten2(vector3Array[index + 20]);
+            }
+
             for (int index = 20; index < 40; ++index)
+            {
                 Finger[i, index].localEulerAngles = getHanten2(vector3Array[index - 20]);
+            }
+
             transform4.localEulerAngles = getHanten2(localEulerAngles1);
             transform3.localEulerAngles = getHanten2(localEulerAngles2);
             transform6.localEulerAngles = getHanten2(localEulerAngles3);

Diferenças do arquivo suprimidas por serem muito extensas
+ 543 - 197
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Init.cs


Diferenças do arquivo suprimidas por serem muito extensas
+ 472 - 477
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.MaidUpdate.cs


Diferenças do arquivo suprimidas por serem muito extensas
+ 1773 - 757
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.Update.cs


Diferenças do arquivo suprimidas por serem muito extensas
+ 425 - 384
MultipleMaids/CM3D2/MultipleMaids/Plugin/MultipleMaids.cs


+ 17 - 5
MultipleMaids/ComboBox2.cs

@@ -41,7 +41,10 @@ public class ComboBox2
         bool flag = false;
         int controlId = GUIUtility.GetControlID(FocusType.Passive);
         if (Event.current.GetTypeForControl(controlId) == EventType.MouseUp && isClickedComboButton && scrollPosOld == scrollPos)
+        {
             flag = true;
+        }
+
         if (GUI.Button(rect, buttonContent, buttonStyle))
         {
             if (useControlID == -1)
@@ -61,29 +64,38 @@ public class ComboBox2
 
         if (isClickedComboButton)
         {
-            var position = new Rect(rect.x, rect.y + GetPix(23), rect.width, listStyle.CalcHeight(listContent[0], 1f) * listContent.Length);
-            if (position.y + (double) position.height > height)
+            Rect position = new Rect(rect.x, rect.y + GetPix(23), rect.width, listStyle.CalcHeight(listContent[0], 1f) * listContent.Length);
+            if (position.y + (double)position.height > height)
             {
-                position.height = (float) (height - (double) position.y - 2.0);
+                position.height = (float)(height - (double)position.y - 2.0);
                 position.width += 16f;
             }
 
             GUI.Box(position, "", boxStyle);
             if (Input.GetMouseButtonDown(0))
+            {
                 scrollPosOld = scrollPos;
-            var rect1 = new Rect(rect.x,
+            }
+
+            Rect rect1 = new Rect(rect.x,
                                  rect.y + listStyle.CalcHeight(listContent[0], 1f),
                                  rect.width,
                                  listStyle.CalcHeight(listContent[0], 1f) * listContent.Length);
             scrollPos = GUI.BeginScrollView(position, scrollPos, rect1);
             int num = GUI.SelectionGrid(rect1, selectedItemIndex, listContent, 1, listStyle);
             if (num != selectedItemIndex)
+            {
                 selectedItemIndex = num;
+            }
+
             GUI.EndScrollView();
         }
 
         if (flag)
+        {
             isClickedComboButton = false;
+        }
+
         return GetSelectedItemIndex();
     }
 
@@ -94,6 +106,6 @@ public class ComboBox2
 
     private int GetPix(int i)
     {
-        return (int) ((1.0 + (Screen.width / 1280.0 - 1.0) * 0.600000023841858) * i);
+        return (int)((1.0 + (Screen.width / 1280.0 - 1.0) * 0.600000023841858) * i);
     }
 }