Browse Source

Fix maid drag point scale on deserialization

Maid drag points did not change scale when loading a scene that scaled
the maid.
habeebweeb 4 years ago
parent
commit
9317f0b0fe

+ 1 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/Meido.cs

@@ -828,6 +828,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             Maid.transform.position = binaryReader.ReadVector3();
             Maid.transform.rotation = binaryReader.ReadQuaternion();
             Maid.transform.localScale = binaryReader.ReadVector3();
+            IKManager.SetDragPointScale(Maid.transform.localScale.x);
             // pose
 
             KeyValuePair<bool, bool> muneSetting = new KeyValuePair<bool, bool>(true, true);

+ 2 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/MeidoDragPointManager.cs

@@ -565,12 +565,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             SelectMaid?.Invoke(this, new MeidoUpdateEventArgs(meido.Slot, fromMaid: true, isBody: false));
         }
 
-        private void SetDragPointScale(float scale)
+        public void SetDragPointScale(float scale)
         {
-            foreach (DragPointMeido dragPoint in DragPoints.Values)
-            {
-                dragPoint.DragPointScale = scale;
-            }
+            foreach (DragPointMeido dragPoint in DragPoints.Values) dragPoint.DragPointScale = scale;
             dragBody.DragPointScale = scale;
         }