Kaynağa Gözat

Reformat part 3 indentation and small touches

Fix indentation as a result of switching to file scoped namespaces. I
might have missed some but that's fine because there's still more to
reformat.
habeebweeb 2 yıl önce
ebeveyn
işleme
bb39b513c5
64 değiştirilmiş dosya ile 484 ekleme ve 537 silme
  1. 6 7
      src/MeidoPhotoStudio.Converter/Converters/MMConverter.cs
  2. 3 0
      src/MeidoPhotoStudio.Converter/Converters/MMPngConverter.cs
  3. 2 2
      src/MeidoPhotoStudio.Converter/MultipleMaids/MMConstants.cs
  4. 73 62
      src/MeidoPhotoStudio.Converter/MultipleMaids/MMSceneConverter.cs
  5. 2 2
      src/MeidoPhotoStudio.Converter/Plugin.cs
  6. 1 0
      src/MeidoPhotoStudio.Converter/PluginCore.cs
  7. 1 1
      src/MeidoPhotoStudio.Converter/Utility/LZMA.cs
  8. 1 0
      src/MeidoPhotoStudio.Converter/Utility/PngUtility.cs
  9. 36 40
      src/MeidoPhotoStudio.Plugin/Constants.cs
  10. 5 2
      src/MeidoPhotoStudio.Plugin/DragPoint/CustomGizmo.cs
  11. 8 6
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPoint.cs
  12. 7 7
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPointGeneral.cs
  13. 5 5
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPointLight.cs
  14. 5 2
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPointProp.cs
  15. 8 5
      src/MeidoPhotoStudio.Plugin/GUI/Controls/DropDown.cs
  16. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Controls/Modal.cs
  17. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Controls/TextField.cs
  18. 3 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/AttachPropPane.cs
  19. 3 10
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/MyRoomPropsPane.cs
  20. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/PropManagerPane.cs
  21. 24 25
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/PropsPane.cs
  22. 1 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/CameraPane.cs
  23. 3 12
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs
  24. 4 16
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/FogPane.cs
  25. 1 0
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/OtherEffectsPane.cs
  26. 2 12
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/LightsPane.cs
  27. 4 7
      src/MeidoPhotoStudio.Plugin/GUI/Panes/CallWindowPanes/MaidSelectorPane.cs
  28. 19 15
      src/MeidoPhotoStudio.Plugin/GUI/Panes/FaceWindowPanes/MaidFaceBlendPane.cs
  29. 3 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/BGWindowPane.cs
  30. 5 7
      src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/CallWindowPane.cs
  31. 0 1
      src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/FaceWindowPane.cs
  32. 1 0
      src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/SettingsWindowPane.cs
  33. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/OtherPanes/MaidSwitcherPane.cs
  34. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/CopyPosePane.cs
  35. 3 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/HandPresetPane.cs
  36. 13 18
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidPoseSelectorPane.cs
  37. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MpnAttachPropPane.cs
  38. 3 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/SceneManagerPanes/SceneManagerScenePane.cs
  39. 2 8
      src/MeidoPhotoStudio.Plugin/GUI/Panes/SceneManagerPanes/SceneManagerTitleBar.cs
  40. 4 4
      src/MeidoPhotoStudio.Plugin/GUI/Windows/BaseWindow.cs
  41. 3 7
      src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneModalWindow.cs
  42. 3 3
      src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneWindow.cs
  43. 1 2
      src/MeidoPhotoStudio.Plugin/Managers/EffectManagers/BloomEffectManager.cs
  44. 4 2
      src/MeidoPhotoStudio.Plugin/Managers/EnvironmentManager.cs
  45. 2 2
      src/MeidoPhotoStudio.Plugin/Managers/InputManager.cs
  46. 5 5
      src/MeidoPhotoStudio.Plugin/Managers/LightManager.cs
  47. 4 4
      src/MeidoPhotoStudio.Plugin/Managers/MeidoManager.cs
  48. 15 16
      src/MeidoPhotoStudio.Plugin/Managers/PropManager.cs
  49. 13 15
      src/MeidoPhotoStudio.Plugin/Managers/SceneManager.cs
  50. 6 6
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointFinger.cs
  51. 4 4
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointHead.cs
  52. 7 6
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointPelvis.cs
  53. 8 9
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointTorso.cs
  54. 2 2
      src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointChain.cs
  55. 18 18
      src/MeidoPhotoStudio.Plugin/Meido/Meido.cs
  56. 48 73
      src/MeidoPhotoStudio.Plugin/Meido/MeidoDragPointManager.cs
  57. 28 19
      src/MeidoPhotoStudio.Plugin/MeidoPhotoStudio.cs
  58. 2 0
      src/MeidoPhotoStudio.Plugin/MenuFileUtility.cs
  59. 8 8
      src/MeidoPhotoStudio.Plugin/ModelUtility.cs
  60. 2 2
      src/MeidoPhotoStudio.Plugin/Serialization/Serializers/ManagerSerializers/EnvironmentManagerSerializer.cs
  61. 3 0
      src/MeidoPhotoStudio.Plugin/Serialization/Serializers/ManagerSerializers/MeidoManagerSerializer.cs
  62. 2 2
      src/MeidoPhotoStudio.Plugin/Serialization/Serializers/MeidoSerializer.cs
  63. 9 13
      src/MeidoPhotoStudio.Plugin/Translation.cs
  64. 15 17
      src/MeidoPhotoStudio.Plugin/Utility.cs

+ 6 - 7
src/MeidoPhotoStudio.Converter/Converters/MMConverter.cs

@@ -27,6 +27,7 @@ public class MMConverter : IConverter
         foreach (var subDirectory in directory.GetDirectories())
         {
             var subDestination = Path.Combine(destination, subDirectory.Name);
+
             Convert(subDirectory.FullName, subDestination);
         }
     }
@@ -42,9 +43,7 @@ public class MMConverter : IConverter
 
         Directory.CreateDirectory(outputDirectory);
 
-        foreach (var key in section.Keys.Where(
-                    key => !key.Key.StartsWith("ss") && !string.IsNullOrEmpty(key.Value)
-                    ))
+        foreach (var key in section.Keys.Where(key => !key.Key.StartsWith("ss") && !string.IsNullOrEmpty(key.Value)))
             ConvertScene(section, key, Path.Combine(outputDirectory, GenerateFilename(iniFile.Name, key)));
     }
 
@@ -106,8 +105,8 @@ public class MMConverter : IConverter
         {
             if (Plugin.Instance != null)
                 Plugin.Instance.Logger.LogWarning(
-                        $"Could not {(e is IOException ? "read" : "parse")} ini file {filePath}"
-                        );
+                    $"Could not {(e is IOException ? "read" : "parse")} ini file {filePath}"
+                );
 
             return null;
         }
@@ -117,8 +116,8 @@ public class MMConverter : IConverter
 
         if (Plugin.Instance != null)
             Plugin.Instance.Logger.LogWarning(
-                    $"{filePath} is not a valid MM config because '[scene]' section is missing"
-                    );
+                $"{filePath} is not a valid MM config because '[scene]' section is missing"
+            );
 
         return null;
     }

+ 3 - 0
src/MeidoPhotoStudio.Converter/Converters/MMPngConverter.cs

@@ -28,6 +28,7 @@ public class MMPngConverter : IConverter
         foreach (var subDirectory in directory.GetDirectories())
         {
             var subDestination = Path.Combine(destination, subDirectory.Name);
+
             Convert(subDirectory.FullName, subDestination);
         }
     }
@@ -55,6 +56,7 @@ public class MMPngConverter : IConverter
         try
         {
             using var sceneStream = LZMA.Decompress(fileStream);
+
             sceneData = Encoding.Unicode.GetString(sceneStream.ToArray());
         }
         catch (Exception e)
@@ -84,6 +86,7 @@ public class MMPngConverter : IConverter
                 return;
 
             Plugin.Instance.Logger.LogError($"Could not convert {pngFile} because {e}");
+
             return;
         }
 

+ 2 - 2
src/MeidoPhotoStudio.Converter/MultipleMaids/MMConstants.cs

@@ -32,9 +32,9 @@ public static class MMConstants
 
     public static Dictionary<string, PlacementData.Data> MyrAssetNameToData =>
         myrAssetNameToData ??= PlacementData.GetAllDatas(false)
-        .ToDictionary(
+            .ToDictionary(
                 data => string.IsNullOrEmpty(data.assetName) ? data.resourceName : data.assetName,
                 data => data,
                 StringComparer.InvariantCultureIgnoreCase
-                );
+            );
 }

+ 73 - 62
src/MeidoPhotoStudio.Converter/MultipleMaids/MMSceneConverter.cs

@@ -76,7 +76,9 @@ public static class MMSceneConverter
         var dataSegments = data.Split('_');
         var strArray2 = dataSegments[1].Split(';');
 
-        var meidoCount = environment ? MeidoPhotoStudio.Plugin.MeidoPhotoStudio.kankyoMagic : strArray2.Length;
+        var meidoCount = environment
+            ? MeidoPhotoStudio.Plugin.MeidoPhotoStudio.kankyoMagic
+            : strArray2.Length;
 
         return new()
         {
@@ -165,7 +167,7 @@ public static class MMSceneConverter
                 writer.Write(isFreeLook);
 
                 var offsetTarget = isFreeLook
-                    ? new(float.Parse(freeLookData[2]), 1f, float.Parse(freeLookData[1]))
+                    ? new Vector3(float.Parse(freeLookData[2]), 1f, float.Parse(freeLookData[1]))
                     : new Vector3(0f, 1f, 0f);
 
                 writer.Write(offsetTarget);
@@ -181,6 +183,7 @@ public static class MMSceneConverter
 
             // face
             var faceValues = maidData[63].Split(',');
+
             writer.Write(faceValues.Length);
 
             for (var i = 0; i < faceValues.Length; i++)
@@ -195,7 +198,7 @@ public static class MMSceneConverter
             // MeidoSerializer -> Body version
             writer.WriteVersion(1);
 
-            var sixtyFourFlag = maidData.Length == 64;
+            var sixtyFourFlag = maidData.Length is 64;
 
             writer.Write(sixtyFourFlag);
 
@@ -211,7 +214,9 @@ public static class MMSceneConverter
                         writer.Write(ConversionUtility.ParseEulerAngle(maidData[j]));
             }
 
-            var rotationIndices = sixtyFourFlag ? BodyRotationIndices64 : BodyRotationIndices;
+            var rotationIndices = sixtyFourFlag
+                ? BodyRotationIndices64
+                : BodyRotationIndices;
 
             // body rotations
             foreach (var index in rotationIndices)
@@ -220,7 +225,7 @@ public static class MMSceneConverter
                 var data = maidData[index];
 
                 // check special case for ClavicleL
-                if (index == ClavicleLIndex)
+                if (index is ClavicleLIndex)
                 {
                     /*
                      * Versions of MM possibly serialized ClavicleL improperly.
@@ -269,7 +274,7 @@ public static class MMSceneConverter
             var kousokuUpperMenu = string.Empty;
             var kousokuLowerMenu = string.Empty;
 
-            var sixtyFourFlag = maidData.Length == 64;
+            var sixtyFourFlag = maidData.Length is 64;
 
             if (!sixtyFourFlag)
             {
@@ -279,12 +284,12 @@ public static class MMSceneConverter
                 {
                     var actualIndex = mpnIndex - 9;
 
-                    if (mpnIndex == 12)
+                    if (mpnIndex is 12)
                     {
                         kousokuUpperMenu = MMConstants.MpnAttachProps[actualIndex];
                         kousokuLowerMenu = MMConstants.MpnAttachProps[actualIndex - 1];
                     }
-                    else if (mpnIndex == 13)
+                    else if (mpnIndex is 13)
                     {
                         kousokuUpperMenu = MMConstants.MpnAttachProps[actualIndex + 1];
                         kousokuLowerMenu = MMConstants.MpnAttachProps[actualIndex];
@@ -296,7 +301,7 @@ public static class MMSceneConverter
 
                         var kousokuMenu = MMConstants.MpnAttachProps[actualIndex];
 
-                        if (MMConstants.MpnAttachProps[actualIndex][7] == 'u')
+                        if (MMConstants.MpnAttachProps[actualIndex][7] is 'u')
                             kousokuUpperMenu = kousokuMenu;
                         else
                             kousokuLowerMenu = kousokuMenu;
@@ -321,11 +326,10 @@ public static class MMSceneConverter
 
         static void ConvertGravity(string[] data, BinaryWriter writer)
         {
-            var softG = new Vector3(
-                    float.Parse(data[12]), float.Parse(data[13]), float.Parse(data[14])
-                    );
+            var softG = new Vector3(float.Parse(data[12]), float.Parse(data[13]), float.Parse(data[14]));
 
             var hairGravityActive = softG != MMConstants.DefaultSoftG;
+
             writer.Write(hairGravityActive);
             // an approximation for hair gravity position
             writer.Write(softG * 90f);
@@ -350,7 +354,7 @@ public static class MMSceneConverter
 
         if (strArray3.Length > 16)
         {
-            showingMessage = int.Parse(strArray3[34]) == 1;
+            showingMessage = int.Parse(strArray3[34]) is 1;
             name = strArray3[35];
             message = strArray3[36].Replace(newLine, "\n");
             // MM does not serialize message font size
@@ -382,15 +386,13 @@ public static class MMSceneConverter
 
         if (strArray3.Length > 16)
         {
-            cameraTargetPos = new(
-                    float.Parse(strArray3[27]), float.Parse(strArray3[28]), float.Parse(strArray3[29])
-                    );
+            cameraTargetPos = new(float.Parse(strArray3[27]), float.Parse(strArray3[28]), float.Parse(strArray3[29]));
 
             cameraDistance = float.Parse(strArray3[30]);
 
             cameraRotation = Quaternion.Euler(
-                    float.Parse(strArray3[31]), float.Parse(strArray3[32]), float.Parse(strArray3[33])
-                    );
+                float.Parse(strArray3[31]), float.Parse(strArray3[32]), float.Parse(strArray3[33])
+            );
         }
 
         Serialization.Get<CameraInfo>().Serialize(
@@ -455,7 +457,7 @@ public static class MMSceneConverter
 
             for (var i = 0; i < 3; i++)
             {
-                if (i == lightType || i == 0 && lightType == 3)
+                if (i == lightType || i is 0 && lightType is 3)
                     lightPropertySerializer.Serialize(lightProperty, writer);
                 else
                     lightPropertySerializer.Serialize(DefaultLightProperty, writer);
@@ -467,9 +469,9 @@ public static class MMSceneConverter
 
             writer.Write(lightPosition);
             // light type. 3 is colour mode which uses directional light type.
-            writer.Write(lightType == 3 ? 0 : lightType);
+            writer.Write(lightType is 3 ? 0 : lightType);
             // colour mode
-            writer.Write(lightType == 3);
+            writer.Write(lightType is 3);
             // MM lights cannot be disabled
             writer.Write(false);
         }
@@ -499,17 +501,15 @@ public static class MMSceneConverter
 
             var lightProperty = new LightProperty
             {
-                Rotation = Quaternion.Euler(
-                    float.Parse(lightProperties[4]), float.Parse(lightProperties[5]), 18f
-                ),
+                Rotation = Quaternion.Euler(float.Parse(lightProperties[4]), float.Parse(lightProperties[5]), 18f),
                 Intensity = float.Parse(lightProperties[6]),
                 SpotAngle = spotAngle,
                 Range = spotAngle / 5f,
                 // MM does not save shadow strength for other lights 
                 ShadowStrength = 0.098f,
                 LightColour = new(
-                     float.Parse(lightProperties[1]), float.Parse(lightProperties[2]),
-                     float.Parse(lightProperties[3]), 1f
+                     float.Parse(lightProperties[1]), float.Parse(lightProperties[2]), float.Parse(lightProperties[3]),
+                     1f
                 ),
             };
 
@@ -527,7 +527,7 @@ public static class MMSceneConverter
 
             writer.Write(lightPosition);
             // light type. 3 is colour mode which uses directional light type.
-            writer.Write(lightType == 3 ? 0 : lightType);
+            writer.Write(lightType is 3 ? 0 : lightType);
             // colour mode only applies to the main light
             writer.Write(false);
             // MM lights cannot be disabled
@@ -550,24 +550,21 @@ public static class MMSceneConverter
         writer.Write(BloomEffectManager.header);
         writer.WriteVersion(1);
 
-        writer.Write(int.Parse(effectData[1]) == 1); // active
+        writer.Write(int.Parse(effectData[1]) is 1); // active
         writer.Write(float.Parse(effectData[2]) / 5.7f * 100f); // intensity
         writer.Write((int)float.Parse(effectData[3])); // blur iterations
 
         writer.WriteColour(
-                new(
-                    1f - float.Parse(effectData[4]), 1f - float.Parse(effectData[5]), 1f - float.Parse(effectData[6]),
-                    1f
-                   )
-                ); // bloom threshold colour
+            new(1f - float.Parse(effectData[4]), 1f - float.Parse(effectData[5]), 1f - float.Parse(effectData[6]), 1f)
+        ); // bloom threshold colour
 
-        writer.Write(int.Parse(effectData[7]) == 1); // hdr
+        writer.Write(int.Parse(effectData[7]) is 1); // hdr
 
         // vignetting
         writer.Write(VignetteEffectManager.header);
         writer.WriteVersion(1);
 
-        writer.Write(int.Parse(effectData[8]) == 1); // active
+        writer.Write(int.Parse(effectData[8]) is 1); // active
         writer.Write(float.Parse(effectData[9])); // intensity
         writer.Write(float.Parse(effectData[10])); // blur
         writer.Write(float.Parse(effectData[11])); // blur spread
@@ -585,7 +582,7 @@ public static class MMSceneConverter
         writer.Write(SepiaToneEffectManger.header);
         writer.WriteVersion(1);
 
-        writer.Write(int.Parse(effectData[29]) == 1);
+        writer.Write(int.Parse(effectData[29]) is 1);
 
         if (effectData.Length > 15)
         {
@@ -593,18 +590,18 @@ public static class MMSceneConverter
             writer.Write(DepthOfFieldEffectManager.header);
             writer.WriteVersion(1);
 
-            writer.Write(int.Parse(effectData[15]) == 1); // active
+            writer.Write(int.Parse(effectData[15]) is 1); // active
             writer.Write(float.Parse(effectData[16])); // focal length
             writer.Write(float.Parse(effectData[17])); // focal size
             writer.Write(float.Parse(effectData[18])); // aperture
             writer.Write(float.Parse(effectData[19])); // max blur size
-            writer.Write(int.Parse(effectData[20]) == 1); // visualize focus
+            writer.Write(int.Parse(effectData[20]) is 1); // visualize focus
 
             // fog
             writer.Write(FogEffectManager.header);
             writer.WriteVersion(1);
 
-            writer.Write(int.Parse(effectData[21]) == 1); // active
+            writer.Write(int.Parse(effectData[21]) is 1); // active
             writer.Write(float.Parse(effectData[22])); // fog distance
             writer.Write(float.Parse(effectData[23])); // density
             writer.Write(float.Parse(effectData[24])); // height scale
@@ -612,10 +609,8 @@ public static class MMSceneConverter
 
             // fog colour
             writer.WriteColour(
-                    new(
-                        float.Parse(effectData[26]), float.Parse(effectData[27]), float.Parse(effectData[28]), 1f
-                       )
-                    );
+                new(float.Parse(effectData[26]), float.Parse(effectData[27]), float.Parse(effectData[28]), 1f)
+            );
         }
 
         writer.Write(EffectManager.footer);
@@ -684,13 +679,13 @@ public static class MMSceneConverter
                 TransformDTO = new()
                 {
                     Position = new(
-                            float.Parse(strArray3[41]), float.Parse(strArray3[42]), float.Parse(strArray3[43])
-                            ),
+                        float.Parse(strArray3[41]), float.Parse(strArray3[42]), float.Parse(strArray3[43])
+                    ),
                     Rotation = Quaternion.Euler(
-                                     float.Parse(strArray3[38]), float.Parse(strArray3[39]), float.Parse(strArray3[40])
-                                     ),
+                         float.Parse(strArray3[38]), float.Parse(strArray3[39]), float.Parse(strArray3[40])
+                     ),
                     LocalScale =
-                                 new(float.Parse(strArray3[44]), float.Parse(strArray3[45]), float.Parse(strArray3[46])),
+                         new(float.Parse(strArray3[44]), float.Parse(strArray3[45]), float.Parse(strArray3[46])),
                 },
                 AttachPointInfo = AttachPointInfo.Empty,
                 PropInfo = AssetToPropInfo(strArray3[37]),
@@ -716,16 +711,16 @@ public static class MMSceneConverter
                 TransformDTO = new()
                 {
                     Position = new(
-                                     float.Parse(assetParts[4]), float.Parse(assetParts[5]), float.Parse(assetParts[6])
-                                     ),
+                        float.Parse(assetParts[4]), float.Parse(assetParts[5]), float.Parse(assetParts[6])
+                    ),
                     Rotation = Quaternion.Euler(
-                                     float.Parse(assetParts[1]), float.Parse(assetParts[2]), float.Parse(assetParts[3])
-                                     ),
+                        float.Parse(assetParts[1]), float.Parse(assetParts[2]), float.Parse(assetParts[3])
+                    ),
                     LocalScale =
-                                 new(float.Parse(assetParts[7]), float.Parse(assetParts[8]), float.Parse(assetParts[9])),
+                        new(float.Parse(assetParts[7]), float.Parse(assetParts[8]), float.Parse(assetParts[9])),
                 },
                 AttachPointInfo = AttachPointInfo.Empty,
-                ShadowCasting = propInfo.Type == PropInfo.PropType.Mod,
+                ShadowCasting = propInfo.Type is PropInfo.PropType.Mod,
             };
 
             propSerializer.Serialize(propDto, writer);
@@ -778,7 +773,10 @@ public static class MMSceneConverter
                 {
                     // MM's dumb way of using one data structure to store both a human readable name and asset name
                     // ex. 'Pancakes                    #odogu_pancake'
-                    return new(PropInfo.PropType.Odogu) { Filename = asset.Split('#')[1] };
+                    return new(PropInfo.PropType.Odogu)
+                    {
+                        Filename = asset.Split('#')[1]
+                    };
                 }
 
                 // modifiedMM official COM3D2 mod prop
@@ -799,29 +797,42 @@ public static class MMSceneConverter
 
                 // hand items are treated as game props (Odogu) in MPS
                 if (asset.StartsWith("handitem", StringComparison.OrdinalIgnoreCase)
-                        || asset.StartsWith("kousoku", StringComparison.OrdinalIgnoreCase)
-                   )
+                    || asset.StartsWith("kousoku", StringComparison.OrdinalIgnoreCase)
+                )
                     propType = PropInfo.PropType.Odogu;
 
-                return new(propType) { Filename = asset };
+                return new(propType)
+                {
+                    Filename = asset
+                };
             }
 
             if (asset.StartsWith(bgOdoguPrefix, StringComparison.OrdinalIgnoreCase))
             {
                 // MM prepends BG to certain prop asset names. Don't know why.
-                return new(PropInfo.PropType.Odogu) { Filename = asset.Substring(2) };
+                return new(PropInfo.PropType.Odogu)
+                {
+                    Filename = asset.Substring(2)
+                };
             }
 
             if (asset.StartsWith(bgAsPropPrefix))
             {
                 // game bg as prop
-                return new(PropInfo.PropType.Bg) { Filename = asset.Substring(3) };
+                return new(PropInfo.PropType.Bg)
+                {
+                    Filename = asset.Substring(3)
+                };
             }
 
-            return new(PropInfo.PropType.Odogu) { Filename = asset };
+            return new(PropInfo.PropType.Odogu)
+            {
+                Filename = asset
+            };
         }
 
         // MM uses '_' as a separator for different parts of serialized data so it converts all '_' to spaces
-        static string ConvertSpaces(string @string) => @string.Replace(' ', '_');
+        static string ConvertSpaces(string @string) =>
+            @string.Replace(' ', '_');
     }
 }

+ 2 - 2
src/MeidoPhotoStudio.Converter/Plugin.cs

@@ -17,11 +17,11 @@ public class Plugin : BaseUnityPlugin
 
     public static Plugin? Instance { get; private set; }
 
+    public new ManualLogSource? Logger { get; private set; }
+
     private PluginCore? pluginCore;
     private UI? ui;
 
-    public new ManualLogSource? Logger { get; private set; }
-
     private void Awake()
     {
         DontDestroyOnLoad(this);

+ 1 - 0
src/MeidoPhotoStudio.Converter/PluginCore.cs

@@ -13,6 +13,7 @@ public class PluginCore
     public PluginCore(string workingDirectory, params IConverter[] converters)
     {
         WorkingDirectory = workingDirectory;
+
         this.converters = converters;
     }
 

+ 1 - 1
src/MeidoPhotoStudio.Converter/Utility/LZMA.cs

@@ -11,7 +11,7 @@ internal static class LZMA
 
         var properties = new byte[5];
 
-        if (inStream.Read(properties, 0, 5) != 5)
+        if (inStream.Read(properties, 0, 5) is not 5)
             throw new("input .lzma is too short");
 
         var decoder = new Decoder();

+ 1 - 0
src/MeidoPhotoStudio.Converter/Utility/PngUtility.cs

@@ -30,6 +30,7 @@ internal static class PngUtility
             {
                 // chunk length
                 var read = stream.Read(fourByteBuffer, 0, 4);
+
                 memoryStream.Write(fourByteBuffer, 0, read);
 
                 if (BitConverter.IsLittleEndian)

+ 36 - 40
src/MeidoPhotoStudio.Plugin/Constants.cs

@@ -152,18 +152,18 @@ public static class Constants
             rootElement.Add(new XElement("elm", kvp.Value.ToString("G9"), new XAttribute("name", kvp.Key)));
 
         var fullDocument = new XDocument(
-                new XDeclaration("1.0", "utf-8", "true"),
-                new XComment("MeidoPhotoStudio Face Preset"),
-                rootElement
-                );
+            new XDeclaration("1.0", "utf-8", "true"),
+            new XComment("MeidoPhotoStudio Face Preset"),
+            rootElement
+        );
 
         fullDocument.Save(fullPath);
 
         var fileInfo = new FileInfo(fullPath);
         var category = fileInfo.Directory.Name;
         var faceGroup = CustomFaceGroupList.Find(
-                group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
-                );
+            group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
+        );
 
         if (string.IsNullOrEmpty(faceGroup))
         {
@@ -218,8 +218,8 @@ public static class Constants
 
         var category = fileInfo.Directory.Name;
         var poseGroup = CustomPoseGroupList.Find(
-                group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
-                );
+            group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
+        );
 
         if (string.IsNullOrEmpty(poseGroup))
         {
@@ -269,21 +269,21 @@ public static class Constants
         // TODO: This does not actually do what I think it does.
         var gameVersion = Misc.GAME_VERSION; // get game version from user's Assembly-CSharp
         var finalXml = new XDocument(new XDeclaration("1.0", "utf-8", "true"),
-                new XComment("CM3D2 FingerData"),
-                new XElement("FingerData",
-                    new XElement("GameVersion", gameVersion),
-                    new XElement("RightData", right),
-                    new XElement("BinaryData", Convert.ToBase64String(handBinary))
-                    )
-                );
+            new XComment("CM3D2 FingerData"),
+            new XElement("FingerData",
+                new XElement("GameVersion", gameVersion),
+                new XElement("RightData", right),
+                new XElement("BinaryData", Convert.ToBase64String(handBinary))
+            )
+        );
 
         finalXml.Save(fullPath);
 
         var fileInfo = new FileInfo(fullPath);
         var category = fileInfo.Directory.Name;
         var handGroup = CustomHandGroupList.Find(
-                group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
-                );
+            group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
+        );
 
         if (string.IsNullOrEmpty(handGroup))
         {
@@ -385,15 +385,14 @@ public static class Constants
                     {
                         if (file.StartsWith("edit_"))
                             PoseDict["normal"].Add(file);
-                        else if (file is not ("dance_cm3d2_001_zoukin" or "dance_cm3d2_001_mop"
-                                    or "aruki_1_idougo_f" or "sleep2" or "stand_akire2")
-                                && !file.EndsWith("_3_") && !file.EndsWith("_5_") && !file.StartsWith("vr_")
-                                && !file.StartsWith("dance_mc") && !file.Contains("_kubi_") && !file.Contains("a01_")
-                                && !file.Contains("b01_") && !file.Contains("b02_") && !file.EndsWith("_m2")
-                                && !file.EndsWith("_m2_once_") && !file.StartsWith("h_") && !file.StartsWith("event_")
-                                && !file.StartsWith("man_") && !file.EndsWith("_m") && !file.Contains("_m_")
-                                && !file.Contains("_man_")
-                                )
+                        else if (file is not ("dance_cm3d2_001_zoukin" or "dance_cm3d2_001_mop" or "aruki_1_idougo_f"
+                            or "sleep2" or "stand_akire2") && !file.EndsWith("_3_") && !file.EndsWith("_5_")
+                            && !file.StartsWith("vr_") && !file.StartsWith("dance_mc") && !file.Contains("_kubi_")
+                            && !file.Contains("a01_") && !file.Contains("b01_") && !file.Contains("b02_")
+                            && !file.EndsWith("_m2") && !file.EndsWith("_m2_once_") && !file.StartsWith("h_")
+                            && !file.StartsWith("event_") && !file.StartsWith("man_") && !file.EndsWith("_m")
+                            && !file.Contains("_m_") && !file.Contains("_man_")
+                        )
                         {
                             if (path.Contains(@"\sex\"))
                                 PoseDict["ero2"].Add(file);
@@ -672,12 +671,11 @@ public static class Constants
     private static void InitializeOtherDogu()
     {
         DoguDict[customDoguCategories[DoguCategory.BGSmall]] = BGList;
-
         DoguDict[customDoguCategories[DoguCategory.Mob]].AddRange(new[] {
-                "Mob_Man_Stand001", "Mob_Man_Stand002", "Mob_Man_Stand003", "Mob_Man_Sit001", "Mob_Man_Sit002",
-                "Mob_Man_Sit003", "Mob_Girl_Stand001", "Mob_Girl_Stand002", "Mob_Girl_Stand003", "Mob_Girl_Sit001",
-                "Mob_Girl_Sit002", "Mob_Girl_Sit003"
-                });
+            "Mob_Man_Stand001", "Mob_Man_Stand002", "Mob_Man_Stand003", "Mob_Man_Sit001", "Mob_Man_Sit002",
+            "Mob_Man_Sit003", "Mob_Girl_Stand001", "Mob_Girl_Stand002", "Mob_Girl_Stand003", "Mob_Girl_Sit001",
+            "Mob_Girl_Sit002", "Mob_Girl_Sit003"
+        });
 
         var DoguList = DoguDict[customDoguCategories[DoguCategory.Other]];
 
@@ -751,11 +749,11 @@ public static class Constants
         var enabledIDs = new HashSet<int>();
 
         CsvCommonIdManager.ReadEnabledIdList(
-                CsvCommonIdManager.FileSystemType.Normal, true, "desk_item_enabled_id", ref enabledIDs
-                );
+            CsvCommonIdManager.FileSystemType.Normal, true, "desk_item_enabled_id", ref enabledIDs
+        );
         CsvCommonIdManager.ReadEnabledIdList(
-                CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
-                );
+            CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
+        );
 
         var com3d2DeskDogu = DoguDict[customDoguCategories[DoguCategory.Desk]];
 
@@ -824,9 +822,9 @@ public static class Constants
         }
 
         DoguDict["パーティクル"].AddRange(new[] {
-                "Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
-                "Particle/pLine_act2", "Particle/pstarY_act2"
-                });
+            "Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
+            "Particle/pLine_act2", "Particle/pstarY_act2"
+        });
     }
 
     private static void InitializeHandItems()
@@ -918,7 +916,6 @@ public static class Constants
         }
 
         var menuDataBase = GameMain.Instance.MenuDataBase;
-
         var attachMpn = new[] { MPN.kousoku_lower, MPN.kousoku_upper };
 
         for (var i = 0; i < menuDataBase.GetDataSize(); i++)
@@ -970,7 +967,6 @@ public static class Constants
             }
 
             var asset = !string.IsNullOrEmpty(data.resourceName) ? data.resourceName : data.assetName;
-
             var item = new MyRoomItem() { PrefabName = asset, ID = data.ID };
 
             MyRoomPropDict[category].Add(item);

+ 5 - 2
src/MeidoPhotoStudio.Plugin/DragPoint/CustomGizmo.cs

@@ -57,7 +57,7 @@ public class CustomGizmo : GizmoRender
     }
 
     public bool IsGizmoDrag =>
-        GizmoVisible && IsDrag && SelectedType != 0;
+        GizmoVisible && IsDrag && SelectedType is not 0;
 
     public bool GizmoVisible
     {
@@ -139,14 +139,17 @@ public class CustomGizmo : GizmoRender
                 target.localScale += deltaScale;
                 dragged = deltaLocalRotation != Quaternion.identity || deltaLocalPosition != Vector3.zero
                     || deltaScale != Vector3.zero;
+
                 break;
             case GizmoMode.World:
             case GizmoMode.Global:
                 target.position += deltaPosition;
                 target.rotation = deltaRotation * target.rotation;
                 dragged = deltaRotation != Quaternion.identity || deltaPosition != Vector3.zero;
+
                 break;
-            default: throw new ArgumentOutOfRangeException();
+            default:
+                throw new ArgumentOutOfRangeException();
         }
 
         if (dragged)

+ 8 - 6
src/MeidoPhotoStudio.Plugin/DragPoint/DragPoint.cs

@@ -159,7 +159,9 @@ public abstract class DragPoint : MonoBehaviour
     }
 
     private static GameObject DragPointParent() =>
-        dragPointParent ? dragPointParent : (dragPointParent = new("[MPS DragPoint Parent]"));
+        dragPointParent
+            ? dragPointParent
+            : (dragPointParent = new("[MPS DragPoint Parent]"));
 
     protected abstract void UpdateDragType();
 
@@ -209,8 +211,8 @@ public abstract class DragPoint : MonoBehaviour
         screenPoint = camera.WorldToScreenPoint(transform.position);
         startMousePosition = Utility.MousePosition;
         startOffset = transform.position - camera.ScreenToWorldPoint(
-                new(startMousePosition.x, startMousePosition.y, screenPoint.z)
-                );
+            new(startMousePosition.x, startMousePosition.y, screenPoint.z)
+        );
         newOffset = transform.position - MyObject.position;
     }
 
@@ -260,8 +262,8 @@ public abstract class DragPoint : MonoBehaviour
     {
         var mousePosition = Utility.MousePosition;
 
-        return camera.ScreenToWorldPoint(new Vector3(mousePosition.x, mousePosition.y, screenPoint.z))
-            + startOffset - newOffset;
+        return camera.ScreenToWorldPoint(new Vector3(mousePosition.x, mousePosition.y, screenPoint.z)) + startOffset
+            - newOffset;
     }
 
     private void Awake()
@@ -274,7 +276,7 @@ public abstract class DragPoint : MonoBehaviour
 
     private void OnEnable()
     {
-        if (position != null)
+        if (position is not null)
         {
             transform.position = position();
             transform.eulerAngles = rotation();

+ 7 - 7
src/MeidoPhotoStudio.Plugin/DragPoint/DragPointGeneral.cs

@@ -49,12 +49,12 @@ public abstract class DragPointGeneral : DragPoint
     {
         base.Update();
 
-        if (ConstantScale)
-        {
-            var distance = Vector3.Distance(camera.transform.position, transform.position);
+        if (!ConstantScale)
+            return;
 
-            transform.localScale = Vector3.one * (0.4f * BaseScale.x * DragPointScale * distance);
-        }
+        var distance = Vector3.Distance(camera.transform.position, transform.position);
+
+        transform.localScale = Vector3.one * (0.4f * BaseScale.x * DragPointScale * distance);
     }
 
     protected override void UpdateDragType()
@@ -153,8 +153,8 @@ public abstract class DragPointGeneral : DragPoint
         if (CurrentDragType is DragType.MoveY)
         {
             MyObject.position = new(
-                    MyObject.position.x, cursorPosition.y, MyObject.position.z
-                    );
+                MyObject.position.x, cursorPosition.y, MyObject.position.z
+            );
             OnMove();
         }
 

+ 5 - 5
src/MeidoPhotoStudio.Plugin/DragPoint/DragPointLight.cs

@@ -283,11 +283,11 @@ public class DragPointLight : DragPointGeneral
     {
         SetLightProperties(light, CurrentLightProperty);
 
-        if (IsColourMode)
-        {
-            light.color = Color.white;
-            camera.backgroundColor = CurrentLightProperty.LightColour;
-        }
+        if (!IsColourMode)
+            return;
+
+        light.color = Color.white;
+        camera.backgroundColor = CurrentLightProperty.LightColour;
     }
 }
 

+ 5 - 2
src/MeidoPhotoStudio.Plugin/DragPoint/DragPointProp.cs

@@ -32,7 +32,9 @@ public class DragPointProp : DragPointGeneral
     {
         var attachPoint = meido?.IKManager.GetAttachPointTransform(point);
 
-        AttachPointInfo = meido == null ? AttachPointInfo.Empty : new(point, meido);
+        AttachPointInfo = meido == null
+            ? AttachPointInfo.Empty
+            : new(point, meido);
 
         var position = MyObject.position;
         var rotation = MyObject.rotation;
@@ -73,7 +75,7 @@ public class DragPointProp : DragPointGeneral
         DefaultRotation = MyObject.rotation;
         DefaultPosition = MyObject.position;
         DefaultScale = MyObject.localScale;
-        renderers = new List<Renderer>(MyObject.GetComponentsInChildren<Renderer>());
+        renderers = new(MyObject.GetComponentsInChildren<Renderer>());
     }
 
     protected override void ApplyDragType()
@@ -87,6 +89,7 @@ public class DragPointProp : DragPointGeneral
     protected override void OnDestroy()
     {
         Destroy(MyGameObject);
+
         base.OnDestroy();
     }
 }

+ 8 - 5
src/MeidoPhotoStudio.Plugin/GUI/Controls/DropDown.cs

@@ -117,8 +117,8 @@ public class Dropdown : BaseControl
     public void Draw(GUIStyle buttonStyle, GUIStyle dropdownStyle = null, params GUILayoutOption[] layoutOptions)
     {
         var clicked = GUILayout.Button(
-                isMenu ? label : DropdownList[selectedItemIndex], buttonStyle, layoutOptions
-                );
+            isMenu ? label : DropdownList[selectedItemIndex], buttonStyle, layoutOptions
+        );
 
         if (clicked)
         {
@@ -359,6 +359,7 @@ public static class DropdownHelper
             = defaultDropdownStyle.hover.background
             = defaultDropdownStyle.onNormal.background
             = whiteBackground;
+
         defaultDropdownStyle.onHover.textColor
             = defaultDropdownStyle.onNormal.textColor
             = defaultDropdownStyle.hover.textColor
@@ -385,8 +386,9 @@ public static class DropdownHelper
     {
         public int SelectedItemIndex { get; }
 
-        public DropdownSelectArgs(int dropdownID, int selection) : base(dropdownID) =>
-                                                                   SelectedItemIndex = selection;
+        public DropdownSelectArgs(int dropdownID, int selection)
+            : base(dropdownID) =>
+                SelectedItemIndex = selection;
     }
 
     public class DropdownCloseArgs : DropdownEventArgs
@@ -394,7 +396,8 @@ public static class DropdownHelper
         public Vector2 ScrollPos { get; }
         public bool ClickedYou { get; }
 
-        public DropdownCloseArgs(int dropdownID, Vector2 scrollPos, bool clickedYou = false) : base(dropdownID)
+        public DropdownCloseArgs(int dropdownID, Vector2 scrollPos, bool clickedYou = false)
+            : base(dropdownID)
         {
             ScrollPos = scrollPos;
             ClickedYou = clickedYou;

+ 2 - 2
src/MeidoPhotoStudio.Plugin/GUI/Controls/Modal.cs

@@ -38,7 +38,7 @@ public static class Modal
         var windowStyle = new GUIStyle(GUI.skin.box);
 
         currentModal.WindowRect = GUI.ModalWindow(
-                currentModal.windowID, currentModal.WindowRect, currentModal.GUIFunc, "", windowStyle
-                );
+            currentModal.windowID, currentModal.WindowRect, currentModal.GUIFunc, "", windowStyle
+        );
     }
 }

+ 1 - 1
src/MeidoPhotoStudio.Plugin/GUI/Controls/TextField.cs

@@ -19,7 +19,7 @@ public class TextField : BaseControl
         GUI.SetNextControlName(controlName);
         Value = GUILayout.TextField(Value, textFieldStyle, layoutOptions);
 
-        if (Event.current.isKey && Event.current.keyCode == KeyCode.Return)
+        if (Event.current.isKey && Event.current.keyCode is KeyCode.Return)
             OnControlEvent(EventArgs.Empty);
     }
 

+ 3 - 3
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/AttachPropPane.cs

@@ -112,7 +112,7 @@ public class AttachPropPane : BasePane
         var dropdownLayoutOptions = new[]
         {
             GUILayout.Height(dropdownButtonHeight),
-                GUILayout.Width(dropdownButtonWidth),
+            GUILayout.Width(dropdownButtonWidth),
         };
 
         MpsGui.Header(header);
@@ -207,8 +207,8 @@ public class AttachPropPane : BasePane
 
         var dropdownList = meidoManager.ActiveMeidoList.Count is 0
             ? new[] { Translation.Get("systemMessage", "noMaids") }
-        : meidoManager.ActiveMeidoList.Select(meido => $"{meido.Slot + 1}: {meido.FirstName} {meido.LastName}")
-            .ToArray();
+            : meidoManager.ActiveMeidoList.Select(meido => $"{meido.Slot + 1}: {meido.FirstName} {meido.LastName}")
+                .ToArray();
 
         meidoDropdown.SetDropdownItems(dropdownList, 0);
     }

+ 3 - 10
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/MyRoomPropsPane.cs

@@ -53,13 +53,8 @@ public class MyRoomPropsPane : BasePane
 
         var listCount = myRoomPropList.Count;
 
-        var positionRect = new Rect(
-            5f, offsetTop + dropdownButtonHeight, windowWidth - 10f, windowHeight - 145f
-        );
-
-        var viewRect = new Rect(
-            0f, 0f, buttonSize * columns, buttonSize * Mathf.Ceil(listCount / (float)columns) + 5f
-        );
+        var positionRect = new Rect(5f, offsetTop + dropdownButtonHeight, windowWidth - 10f, windowHeight - 145f);
+        var viewRect = new Rect(0f, 0f, buttonSize * columns, buttonSize * Mathf.Ceil(listCount / (float)columns) + 5f);
 
         propListScrollPos = GUI.BeginScrollView(positionRect, propListScrollPos, viewRect);
 
@@ -80,9 +75,7 @@ public class MyRoomPropsPane : BasePane
     }
 
     protected override void ReloadTranslation() =>
-        propCategoryDropdown.SetDropdownItems(
-            Translation.GetArray("doguCategories", Constants.MyRoomPropCategories)
-        );
+        propCategoryDropdown.SetDropdownItems(Translation.GetArray("doguCategories", Constants.MyRoomPropCategories));
 
     private void ChangePropCategory(string category)
     {

+ 2 - 2
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/PropManagerPane.cs

@@ -56,7 +56,7 @@ public class PropManagerPane : BasePane
         dragPointToggle = new(Translation.Get("propManagerPane", "dragPointToggle"));
         dragPointToggle.ControlEvent += (s, a) =>
         {
-            if (updating || this.propManager.PropCount == 0)
+            if (updating || this.propManager.PropCount is 0)
                 return;
 
             this.propManager.CurrentProp.DragPointEnabled = dragPointToggle.Value;
@@ -65,7 +65,7 @@ public class PropManagerPane : BasePane
         gizmoToggle = new(Translation.Get("propManagerPane", "gizmoToggle"));
         gizmoToggle.ControlEvent += (s, a) =>
         {
-            if (updating || this.propManager.PropCount == 0)
+            if (updating || this.propManager.PropCount is 0)
                 return;
 
             this.propManager.CurrentProp.GizmoEnabled = gizmoToggle.Value;

+ 24 - 25
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/PropsPane.cs

@@ -89,9 +89,7 @@ public class PropsPane : BasePane
 
     protected override void ReloadTranslation()
     {
-        doguCategoryDropdown.SetDropdownItems(
-            Translation.GetArray("doguCategories", Constants.DoguCategories)
-        );
+        doguCategoryDropdown.SetDropdownItems(Translation.GetArray("doguCategories", Constants.DoguCategories));
 
         var category = SelectedCategory;
 
@@ -105,37 +103,38 @@ public class PropsPane : BasePane
 
     private void InitializeHandItems(object sender, MenuFilesEventArgs args)
     {
-        if (args.Type == MenuFilesEventArgs.EventType.HandItems)
-        {
-            handItemsReady = true;
-            var selectedCategory = SelectedCategory;
+        if (args.Type is not MenuFilesEventArgs.EventType.HandItems)
+            return;
 
-            if (selectedCategory == Constants.customDoguCategories[Constants.DoguCategory.HandItem])
-                ChangeDoguCategory(selectedCategory, true);
-        }
+        handItemsReady = true;
+
+        var selectedCategory = SelectedCategory;
+
+        if (selectedCategory == Constants.customDoguCategories[Constants.DoguCategory.HandItem])
+            ChangeDoguCategory(selectedCategory, true);
     }
 
     private void ChangeDoguCategory(string category, bool force = false)
     {
-        if (category != currentCategory || force)
-        {
-            currentCategory = category;
+        if (category == currentCategory && !force)
+            return;
 
-            string[] translationArray;
+        currentCategory = category;
 
-            if (category == Constants.customDoguCategories[Constants.DoguCategory.HandItem] && !handItemsReady)
-            {
-                translationArray = new[] { Translation.Get("systemMessage", "initializing") };
-                itemSelectorEnabled = false;
-            }
-            else
-            {
-                translationArray = GetTranslations(category);
-                itemSelectorEnabled = true;
-            }
+        string[] translationArray;
 
-            doguDropdown.SetDropdownItems(translationArray, 0);
+        if (category == Constants.customDoguCategories[Constants.DoguCategory.HandItem] && !handItemsReady)
+        {
+            translationArray = new[] { Translation.Get("systemMessage", "initializing") };
+            itemSelectorEnabled = false;
+        }
+        else
+        {
+            translationArray = GetTranslations(category);
+            itemSelectorEnabled = true;
         }
+
+        doguDropdown.SetDropdownItems(translationArray, 0);
     }
 
     private string[] GetTranslations(string category)

+ 1 - 3
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/CameraPane.cs

@@ -53,9 +53,7 @@ public class CameraPane : BasePane
             camera.fieldOfView = fovSlider.Value;
         };
 
-        cameraGrid = new(
-            Enumerable.Range(1, cameraManager.CameraCount).Select(x => x.ToString()).ToArray()
-        );
+        cameraGrid = new(Enumerable.Range(1, cameraManager.CameraCount).Select(x => x.ToString()).ToArray());
 
         cameraGrid.ControlEvent += (s, a) =>
         {

+ 3 - 12
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs

@@ -15,10 +15,7 @@ public class BloomPane : EffectPane<BloomEffectManager>
 
     public BloomPane(EffectManager effectManager) : base(effectManager)
     {
-        intensitySlider = new(
-            Translation.Get("effectBloom", "intensity"), 0f, 100f, EffectManager.BloomValue
-        );
-
+        intensitySlider = new(Translation.Get("effectBloom", "intensity"), 0f, 100f, EffectManager.BloomValue);
         intensitySlider.ControlEvent += (s, a) =>
         {
             if (updating)
@@ -36,10 +33,7 @@ public class BloomPane : EffectPane<BloomEffectManager>
             EffectManager.BlurIterations = (int)blurSlider.Value;
         };
 
-        redSlider = new(
-            Translation.Get("backgroundWindow", "red"), 1f, 0.5f, EffectManager.BloomThresholdColorRed
-        );
-
+        redSlider = new(Translation.Get("backgroundWindow", "red"), 1f, 0.5f, EffectManager.BloomThresholdColorRed);
         redSlider.ControlEvent += (s, a) =>
         {
             if (updating)
@@ -60,10 +54,7 @@ public class BloomPane : EffectPane<BloomEffectManager>
             EffectManager.BloomThresholdColorGreen = greenSlider.Value;
         };
 
-        blueSlider = new(
-            Translation.Get("backgroundWindow", "blue"), 1f, 0.5f, EffectManager.BloomThresholdColorBlue
-        );
-
+        blueSlider = new(Translation.Get("backgroundWindow", "blue"), 1f, 0.5f, EffectManager.BloomThresholdColorBlue);
         blueSlider.ControlEvent += (s, a) =>
         {
             if (updating)

+ 4 - 16
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/FogPane.cs

@@ -16,10 +16,7 @@ public class FogPane : EffectPane<FogEffectManager>
 
     public FogPane(EffectManager effectManager) : base(effectManager)
     {
-        distanceSlider = new(
-                Translation.Get("effectFog", "distance"), 0f, 30f, EffectManager.Distance
-                );
-
+        distanceSlider = new(Translation.Get("effectFog", "distance"), 0f, 30f, EffectManager.Distance);
         distanceSlider.ControlEvent += (s, a) =>
         {
             if (updating)
@@ -28,10 +25,7 @@ public class FogPane : EffectPane<FogEffectManager>
             EffectManager.Distance = distanceSlider.Value;
         };
 
-        densitySlider = new(
-                Translation.Get("effectFog", "density"), 0f, 10f, EffectManager.Density
-                );
-
+        densitySlider = new(Translation.Get("effectFog", "density"), 0f, 10f, EffectManager.Density);
         densitySlider.ControlEvent += (s, a) =>
         {
             if (updating)
@@ -40,10 +34,7 @@ public class FogPane : EffectPane<FogEffectManager>
             EffectManager.Density = densitySlider.Value;
         };
 
-        heightScaleSlider = new(
-                Translation.Get("effectFog", "strength"), -5f, 20f, EffectManager.HeightScale
-                );
-
+        heightScaleSlider = new(Translation.Get("effectFog", "strength"), -5f, 20f, EffectManager.HeightScale);
         heightScaleSlider.ControlEvent += (s, a) =>
         {
             if (updating)
@@ -52,10 +43,7 @@ public class FogPane : EffectPane<FogEffectManager>
             EffectManager.HeightScale = heightScaleSlider.Value;
         };
 
-        heightSlider = new(
-                Translation.Get("effectFog", "height"), -10f, 10f, EffectManager.Height
-                );
-
+        heightSlider = new(Translation.Get("effectFog", "height"), -10f, 10f, EffectManager.Height);
         heightSlider.ControlEvent += (s, a) =>
         {
             if (updating)

+ 1 - 0
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/OtherEffectsPane.cs

@@ -22,6 +22,7 @@ public class OtherEffectsPane : BasePane
         {
             if (updating)
                 return;
+
             sepiaToneEffectManger.SetEffectActive(sepiaToggle.Value);
         };
 

+ 2 - 12
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/LightsPane.cs

@@ -11,8 +11,8 @@ public class LightsPane : BasePane
     private static readonly string[] lightTypes = { "normal", "spot", "point" };
     private static readonly Dictionary<LightProp, SliderProp> lightSliderProp;
     private static readonly string[,] sliderNames = {
-        { "lights", "x" }, { "lights", "y" }, { "lights", "intensity" }, { "lights", "shadow" },
-        { "lights", "spot" }, { "lights", "range" }, { "backgroundWindow", "red" }, { "backgroundWindow", "green" },
+        { "lights", "x" }, { "lights", "y" }, { "lights", "intensity" }, { "lights", "shadow" }, { "lights", "spot" },
+        { "lights", "range" }, { "backgroundWindow", "red" }, { "backgroundWindow", "green" },
         { "backgroundWindow", "blue" }
     };
 
@@ -60,27 +60,21 @@ public class LightsPane : BasePane
         this.lightManager.ListModified += (s, a) => UpdateList();
 
         lightTypeGrid = new(Translation.GetArray("lightType", lightTypes));
-
         lightTypeGrid.ControlEvent += (s, a) => SetCurrentLightType();
 
         lightDropdown = new(new[] { "Main" });
-
         lightDropdown.SelectionChange += (s, a) => SetCurrentLight();
 
         addLightButton = new("+");
-
         addLightButton.ControlEvent += (s, a) => lightManager.AddLight();
 
         deleteLightButton = new(Translation.Get("lightsPane", "delete"));
-
         deleteLightButton.ControlEvent += (s, a) => lightManager.DeleteActiveLight();
 
         disableToggle = new(Translation.Get("lightsPane", "disable"));
-
         disableToggle.ControlEvent += (s, a) => lightManager.CurrentLight.IsDisabled = disableToggle.Value;
 
         clearLightsButton = new(Translation.Get("lightsPane", "clear"));
-
         clearLightsButton.ControlEvent += (s, a) => ClearLights();
 
         var numberOfLightProps = Enum.GetNames(typeof(LightProp)).Length;
@@ -106,19 +100,15 @@ public class LightsPane : BasePane
         }
 
         colorToggle = new(Translation.Get("lightsPane", "colour"));
-
         colorToggle.ControlEvent += (s, a) => SetColourMode();
 
         resetPropsButton = new(Translation.Get("lightsPane", "resetProperties"));
-
         resetPropsButton.ControlEvent += (s, a) => ResetLightProps();
 
         resetPositionButton = new(Translation.Get("lightsPane", "resetPosition"));
-
         resetPositionButton.ControlEvent += (s, a) => lightManager.CurrentLight.ResetLightPosition();
 
         lightHeader = Translation.Get("lightsPane", "header");
-
         resetLabel = Translation.Get("lightsPane", "resetLabel");
     }
 

+ 4 - 7
src/MeidoPhotoStudio.Plugin/GUI/Panes/CallWindowPanes/MaidSelectorPane.cs

@@ -110,18 +110,15 @@ public class MaidSelectorPane : BasePane
 
                 GUI.DrawTexture(new(5f, y + 5f, buttonWidth - 10f, buttonHeight - 10f), Texture2D.whiteTexture);
 
-                GUI.Label(
-                        new(0f, y + 5f, buttonWidth - 10f, buttonHeight), selectedIndex.ToString(), selectLabelStyle
-                        );
+                GUI.Label(new(0f, y + 5f, buttonWidth - 10f, buttonHeight), selectedIndex.ToString(), selectLabelStyle);
             }
 
             if (meido.Portrait != null)
                 GUI.DrawTexture(new(5f, y, buttonHeight, buttonHeight), meido.Portrait);
 
-            GUI.Label(
-                    new(95f, y + 30f, buttonWidth - 80f, buttonHeight),
-                    $"{meido.LastName}\n{meido.FirstName}", selectedMaid ? labelSelectedStyle : labelStyle
-                    );
+            GUI.Label(new(95f, y + 30f, buttonWidth - 80f, buttonHeight),
+                $"{meido.LastName}\n{meido.FirstName}", selectedMaid ? labelSelectedStyle : labelStyle
+            );
         }
 
         GUI.EndScrollView();

+ 19 - 15
src/MeidoPhotoStudio.Plugin/GUI/Panes/FaceWindowPanes/MaidFaceBlendPane.cs

@@ -21,11 +21,15 @@ public class MaidFaceBlendPane : BasePane
     private bool facePresetMode;
     private bool faceListEnabled;
 
-    private Dictionary<string, List<string>> CurrentFaceDict => facePresetMode
-        ? Constants.CustomFaceDict : Constants.FaceDict;
+    private Dictionary<string, List<string>> CurrentFaceDict =>
+        facePresetMode
+            ? Constants.CustomFaceDict
+            : Constants.FaceDict;
 
-    private List<string> CurrentFaceGroupList => facePresetMode
-        ? Constants.CustomFaceGroupList : Constants.FaceGroupList;
+    private List<string> CurrentFaceGroupList =>
+        facePresetMode
+            ? Constants.CustomFaceGroupList
+            : Constants.FaceGroupList;
 
     private string SelectedFaceGroup =>
         CurrentFaceGroupList[faceBlendCategoryDropdown.SelectedItemIndex];
@@ -62,8 +66,8 @@ public class MaidFaceBlendPane : BasePane
         };
 
         faceBlendCategoryDropdown = new(
-                Translation.GetArray("faceBlendCategory", Constants.FaceGroupList)
-                );
+            Translation.GetArray("faceBlendCategory", Constants.FaceGroupList)
+        );
 
         faceBlendCategoryDropdown.SelectionChange += (s, a) =>
         {
@@ -101,14 +105,14 @@ public class MaidFaceBlendPane : BasePane
 
         var arrowLayoutOptions = new[] {
             GUILayout.Width(buttonHeight),
-                GUILayout.Height(buttonHeight),
+            GUILayout.Height(buttonHeight),
         };
 
         const float dropdownButtonWidth = 153f;
 
         var dropdownLayoutOptions = new[] {
             GUILayout.Height(buttonHeight),
-                GUILayout.Width(dropdownButtonWidth),
+            GUILayout.Width(dropdownButtonWidth),
         };
 
         GUI.enabled = meidoManager.HasActiveMeido;
@@ -139,19 +143,19 @@ public class MaidFaceBlendPane : BasePane
 
         if (!facePresetMode)
             faceBlendCategoryDropdown.SetDropdownItems(
-                    Translation.GetArray("faceBlendCategory", Constants.FaceGroupList)
-                    );
+                Translation.GetArray("faceBlendCategory", Constants.FaceGroupList)
+            );
 
         updating = false;
     }
 
     private string[] UIFaceList() =>
         CurrentFaceList.Count is 0
-        ? (new[] { "No Face Presets" })
-        : CurrentFaceList.Select(face => facePresetMode
+            ? (new[] { "No Face Presets" })
+            : CurrentFaceList.Select(face => facePresetMode
                 ? Path.GetFileNameWithoutExtension(face)
                 : Translation.Get("faceBlendPresetsDropdown", face)
-                ).ToArray();
+            ).ToArray();
 
     private void OnPresetChange(object sender, PresetChangeEventArgs args)
     {
@@ -170,8 +174,8 @@ public class MaidFaceBlendPane : BasePane
             updating = true;
             faceBlendSourceGrid.SelectedItemIndex = 1;
             faceBlendCategoryDropdown.SetDropdownItems(
-                    CurrentFaceGroupList.ToArray(), CurrentFaceGroupList.IndexOf(args.Category)
-                    );
+                CurrentFaceGroupList.ToArray(), CurrentFaceGroupList.IndexOf(args.Category)
+            );
             updating = false;
             faceBlendDropdown.SetDropdownItems(UIFaceList(), CurrentFaceList.IndexOf(args.Path));
         }

+ 3 - 3
src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/BGWindowPane.cs

@@ -13,9 +13,9 @@ public class BGWindowPane : BaseMainWindowPane
     private readonly Button sceneManagerButton;
 
     public BGWindowPane(
-            EnvironmentManager environmentManager, LightManager lightManager, EffectManager effectManager,
-            SceneWindow sceneWindow, CameraManager cameraManager
-            )
+        EnvironmentManager environmentManager, LightManager lightManager, EffectManager effectManager,
+        SceneWindow sceneWindow, CameraManager cameraManager
+    )
     {
         sceneManagerButton = new(Translation.Get("backgroundWindow", "manageScenesButton"));
         sceneManagerButton.ControlEvent += (s, a) => sceneWindow.Visible = !sceneWindow.Visible;

+ 5 - 7
src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/CallWindowPane.cs

@@ -13,14 +13,12 @@ public class CallWindowPane : BaseMainWindowPane
     {
         this.meidoManager = meidoManager;
 
-        placementDropdown = new(
-                Translation.GetArray("placementDropdown", MaidPlacementUtility.placementTypes)
-                );
+        placementDropdown = new(Translation.GetArray("placementDropdown", MaidPlacementUtility.placementTypes));
 
         placementOKButton = new(Translation.Get("maidCallWindow", "okButton"));
         placementOKButton.ControlEvent += (o, a) => this.meidoManager.PlaceMeidos(
-                MaidPlacementUtility.placementTypes[placementDropdown.SelectedItemIndex]
-                );
+            MaidPlacementUtility.placementTypes[placementDropdown.SelectedItemIndex]
+        );
 
         maidSelectorPane = AddPane(new MaidSelectorPane(this.meidoManager));
     }
@@ -40,8 +38,8 @@ public class CallWindowPane : BaseMainWindowPane
     protected override void ReloadTranslation()
     {
         placementDropdown.SetDropdownItems(
-                Translation.GetArray("placementDropdown", MaidPlacementUtility.placementTypes)
-                );
+            Translation.GetArray("placementDropdown", MaidPlacementUtility.placementTypes)
+        );
 
         placementOKButton.Label = Translation.Get("maidCallWindow", "okButton");
     }

+ 0 - 1
src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/FaceWindowPane.cs

@@ -15,7 +15,6 @@ public class FaceWindowPane : BaseMainWindowPane
     public FaceWindowPane(MeidoManager meidoManager, MaidSwitcherPane maidSwitcherPane)
     {
         this.meidoManager = meidoManager;
-
         this.maidSwitcherPane = maidSwitcherPane;
 
         maidFaceSliderPane = AddPane(new MaidFaceSliderPane(this.meidoManager));

+ 1 - 0
src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/SettingsWindowPane.cs

@@ -24,6 +24,7 @@ public class SettingsWindowPane : BaseMainWindowPane
         actionTranslationKeys = Enum.GetNames(typeof(MpsKey))
             .Select(action => char.ToLowerInvariant(action[0]) + action.Substring(1))
             .ToArray();
+
         actionLabels = new string[actionTranslationKeys.Length];
     }
 

+ 2 - 2
src/MeidoPhotoStudio.Plugin/GUI/Panes/OtherPanes/MaidSwitcherPane.cs

@@ -112,8 +112,8 @@ public class MaidSwitcherPane : BasePane
     private void ChangeMaid(int dir)
     {
         var selected = Utility.Wrap(
-                meidoManager.SelectedMeido + (int)Mathf.Sign(dir), 0, meidoManager.ActiveMeidoList.Count
-                );
+            meidoManager.SelectedMeido + (int)Mathf.Sign(dir), 0, meidoManager.ActiveMeidoList.Count
+        );
 
         meidoManager.ChangeMaid(selected);
     }

+ 2 - 2
src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/CopyPosePane.cs

@@ -17,8 +17,8 @@ public class CopyPosePane : BasePane
 
     private Meido FromMeido =>
         meidoManager.HasActiveMeido
-        ? meidoManager.ActiveMeidoList[copyMeidoSlot[meidoDropdown.SelectedItemIndex]]
-        : null;
+            ? meidoManager.ActiveMeidoList[copyMeidoSlot[meidoDropdown.SelectedItemIndex]]
+            : null;
 
     public CopyPosePane(MeidoManager meidoManager)
     {

+ 3 - 3
src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/HandPresetPane.cs

@@ -138,7 +138,7 @@ public class HandPresetPane : BasePane
     }
 
     private string[] UIPresetList() =>
-        CurrentPresetList.Count == 0
-        ? new[] { Translation.Get("handPane", "noPresetsMessage") }
-    : CurrentPresetList.Select(Path.GetFileNameWithoutExtension).ToArray();
+        CurrentPresetList.Count is 0
+            ? new[] { Translation.Get("handPane", "noPresetsMessage") }
+            : CurrentPresetList.Select(Path.GetFileNameWithoutExtension).ToArray();
 }

+ 13 - 18
src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidPoseSelectorPane.cs

@@ -126,17 +126,16 @@ public class MaidPoseSelectorPane : BasePane
 
             if (oldCustomPoseMode != customPoseMode)
                 poseGroupDropdown.SetDropdownItems(
-                        customPoseMode ? CurrentPoseGroupList.ToArray() : Translation.GetArray(
-                            "poseGroupDropdown", CurrentPoseGroupList
-                            )
-                        );
+                    customPoseMode
+                        ? CurrentPoseGroupList.ToArray()
+                        : Translation.GetArray("poseGroupDropdown", CurrentPoseGroupList));
 
             var newPoseGroupIndex = CurrentPoseGroupList.IndexOf(cachedPose.PoseGroup);
 
             if (newPoseGroupIndex < 0)
                 poseGroupDropdown.SelectedItemIndex = 0;
             else if (oldCustomPoseMode != customPoseMode
-                    || poseGroupDropdown.SelectedItemIndex != newPoseGroupIndex)
+                || poseGroupDropdown.SelectedItemIndex != newPoseGroupIndex)
             {
                 poseGroupDropdown.SelectedItemIndex = newPoseGroupIndex;
                 poseDropdown.SetDropdownItems(UIPoseList());
@@ -168,11 +167,7 @@ public class MaidPoseSelectorPane : BasePane
         poseModeGrid.SetItems(Translation.GetArray("posePane", tabTranslations));
 
         if (!customPoseMode)
-        {
-            poseGroupDropdown.SetDropdownItems(
-                    Translation.GetArray("poseGroupDropdown", Constants.PoseGroupList)
-                    );
-        }
+            poseGroupDropdown.SetDropdownItems(Translation.GetArray("poseGroupDropdown", Constants.PoseGroupList));
 
         updating = false;
     }
@@ -194,8 +189,9 @@ public class MaidPoseSelectorPane : BasePane
             updating = true;
             poseModeGrid.SelectedItemIndex = 1;
             poseGroupDropdown.SetDropdownItems(
-                    CurrentPoseGroupList.ToArray(), CurrentPoseGroupList.IndexOf(args.Category)
-                    );
+                CurrentPoseGroupList.ToArray(), CurrentPoseGroupList.IndexOf(args.Category)
+            );
+
             updating = false;
 
             poseDropdown.SetDropdownItems(UIPoseList(), CurrentPoseList.IndexOf(args.Path));
@@ -223,10 +219,9 @@ public class MaidPoseSelectorPane : BasePane
             return;
 
         poseListEnabled = CurrentPoseList.Count > 0;
+
         if (previousPoseGroup == SelectedPoseGroup)
-        {
             poseDropdown.SelectedItemIndex = 0;
-        }
         else
         {
             previousPoseGroup = SelectedPoseGroup;
@@ -244,8 +239,8 @@ public class MaidPoseSelectorPane : BasePane
 
     private string[] UIPoseList() =>
         CurrentPoseList.Count == 0
-        ? new[] { "No Poses" }
-    : CurrentPoseList
-        .Select((pose, i) => $"{i + 1}:{(customPoseMode ? Path.GetFileNameWithoutExtension(pose) : pose)}")
-        .ToArray();
+            ? new[] { "No Poses" }
+            : CurrentPoseList
+                .Select((pose, i) => $"{i + 1}:{(customPoseMode ? Path.GetFileNameWithoutExtension(pose) : pose)}")
+                .ToArray();
 }

+ 2 - 2
src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MpnAttachPropPane.cs

@@ -89,9 +89,9 @@ public class MpnAttachPropPane : BasePane
     {
         IEnumerable<string> dropdownList = !Constants.MpnAttachInitialized
             ? new[] { Translation.Get("systemMessage", "initializing") }
-        : Translation.GetArray(
+            : Translation.GetArray(
                 "mpnAttachPropNames", Constants.MpnAttachPropList.Select(mpnProp => mpnProp.MenuFile)
-                );
+            );
 
         mpnAttachDropdown.SetDropdownItems(dropdownList.ToArray());
     }

+ 3 - 3
src/MeidoPhotoStudio.Plugin/GUI/Panes/SceneManagerPanes/SceneManagerScenePane.cs

@@ -24,13 +24,13 @@ public class SceneManagerScenePane : BasePane
         var sceneImageStyle = new GUIStyle(GUI.skin.label)
         {
             alignment = TextAnchor.MiddleCenter,
-            padding = new RectOffset(0, 0, 0, 0)
+            padding = new RectOffset(0, 0, 0, 0),
         };
 
         var addSceneStyle = new GUIStyle(GUI.skin.button)
         {
             alignment = TextAnchor.MiddleCenter,
-            fontSize = 60
+            fontSize = 60,
         };
 
         GUILayout.BeginVertical();
@@ -42,7 +42,7 @@ public class SceneManagerScenePane : BasePane
         var sceneLayoutOptions = new[]
         {
             GUILayout.Height(sceneHeight),
-                GUILayout.Width(sceneWidth),
+            GUILayout.Width(sceneWidth),
         };
 
         var columns = Mathf.Max(1, (int)(sceneGridWidth / sceneWidth));

+ 2 - 8
src/MeidoPhotoStudio.Plugin/GUI/Panes/SceneManagerPanes/SceneManagerTitleBar.cs

@@ -26,10 +26,7 @@ public class SceneManagerTitleBarPane : BasePane
         refreshButton = new(Translation.Get("sceneManager", "refreshButton"));
         refreshButton.ControlEvent += (s, a) => sceneManager.Refresh();
 
-        sortDropdown = new(
-                Translation.GetArray("sceneManager", sortModes), (int)sceneManager.CurrentSortMode
-                );
-
+        sortDropdown = new(Translation.GetArray("sceneManager", sortModes), (int)sceneManager.CurrentSortMode);
         sortDropdown.SelectionChange += (s, a) =>
         {
             var sortMode = (SceneManager.SortMode)sortDropdown.SelectedItemIndex;
@@ -40,10 +37,7 @@ public class SceneManagerTitleBarPane : BasePane
             sceneManager.SortScenes(sortMode);
         };
 
-        descendingToggle = new(
-                Translation.Get("sceneManager", "descendingToggle"), sceneManager.SortDescending
-                );
-
+        descendingToggle = new(Translation.Get("sceneManager", "descendingToggle"), sceneManager.SortDescending);
         descendingToggle.ControlEvent += (s, a) =>
         {
             sceneManager.SortDescending = descendingToggle.Value;

+ 4 - 4
src/MeidoPhotoStudio.Plugin/GUI/Windows/BaseWindow.cs

@@ -25,12 +25,12 @@ public abstract class BaseWindow : BasePane
         set
         {
             value.x = Mathf.Clamp(
-                    value.x, -value.width + Utility.GetPix(20), Screen.width - Utility.GetPix(20)
-                    );
+                value.x, -value.width + Utility.GetPix(20), Screen.width - Utility.GetPix(20)
+            );
 
             value.y = Mathf.Clamp(
-                    value.y, -value.height + Utility.GetPix(20), Screen.height - Utility.GetPix(20)
-                    );
+                value.y, -value.height + Utility.GetPix(20), Screen.height - Utility.GetPix(20)
+            );
 
             windowRect = value;
         }

+ 3 - 7
src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneModalWindow.cs

@@ -91,10 +91,7 @@ public class SceneModalWindow : BaseWindow
             var scene = sceneManager.CurrentScene;
             var thumb = scene.Thumbnail;
 
-            var scale = Mathf.Min(
-                    (WindowRect.width - 20f) / thumb.width, (WindowRect.height - 110f) / thumb.height
-                    );
-
+            var scale = Mathf.Min((WindowRect.width - 20f) / thumb.width, (WindowRect.height - 110f) / thumb.height);
             var width = Mathf.Min(thumb.width, thumb.width * scale);
             var height = Mathf.Min(thumb.height, thumb.height * scale);
 
@@ -120,9 +117,8 @@ public class SceneModalWindow : BaseWindow
             var labelSize = labelStyle.CalcSize(new GUIContent(infoString));
 
             labelBox = new Rect(
-                    labelBox.x + 10, labelBox.y + labelBox.height - (labelSize.y + 10),
-                    labelSize.x + 10, labelSize.y + 2
-                    );
+                labelBox.x + 10, labelBox.y + labelBox.height - (labelSize.y + 10), labelSize.x + 10, labelSize.y + 2
+            );
 
             GUI.Label(labelBox, infoString, labelStyle);
 

+ 3 - 3
src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneWindow.cs

@@ -99,9 +99,9 @@ public class SceneWindow : BaseWindow
             var rectHeight = Event.current.mousePosition.y;
 
             var minWidth = Utility.GetPix(
-                    SceneManagerDirectoryPane.listWidth
-                    + (int)(SceneManager.sceneDimensions.x * SceneManagerScenePane.thumbnailScale)
-                    );
+                SceneManagerDirectoryPane.listWidth + (int)(SceneManager.sceneDimensions.x
+                    * SceneManagerScenePane.thumbnailScale)
+            );
 
             windowRect.width = Mathf.Max(minWidth, rectWidth);
             windowRect.height = Mathf.Max(300, rectHeight);

+ 1 - 2
src/MeidoPhotoStudio.Plugin/Managers/EffectManagers/BloomEffectManager.cs

@@ -11,8 +11,7 @@ public class BloomEffectManager : IEffectManager
 
     private static readonly CameraMain camera = GameMain.Instance.MainCamera;
     private static readonly float backup_m_fBloomDefIntensity;
-    private static readonly FieldInfo m_fBloomDefIntensity
-        = Utility.GetFieldInfo<CameraMain>("m_fBloomDefIntensity");
+    private static readonly FieldInfo m_fBloomDefIntensity = Utility.GetFieldInfo<CameraMain>("m_fBloomDefIntensity");
 
     // CMSystem's bloomValue;
     private static int backupBloomValue;

+ 4 - 2
src/MeidoPhotoStudio.Plugin/Managers/EnvironmentManager.cs

@@ -130,9 +130,11 @@ public class EnvironmentManager : IManager
         bgDragPoint.gameObject.SetActive(CubeActive);
     }
 
-    private void OnChangeBegin(object sender, EventArgs args) => DestroyDragPoint();
+    private void OnChangeBegin(object sender, EventArgs args) =>
+        DestroyDragPoint();
 
-    private void OnChangeEnd(object sender, EventArgs args) => UpdateBG();
+    private void OnChangeEnd(object sender, EventArgs args) =>
+        UpdateBG();
 
     private void UpdateBG()
     {

+ 2 - 2
src/MeidoPhotoStudio.Plugin/Managers/InputManager.cs

@@ -46,8 +46,8 @@ public static class InputManager
             var configDescription = new ConfigDescription(description, controlRange);
 
             ConfigEntries[action] = Configuration.Config.Bind(
-                    configHeader, action.ToString(), key, configDescription
-                    );
+                configHeader, action.ToString(), key, configDescription
+            );
 
             key = ConfigEntries[action].Value;
             ActionKeys[action] = key;

+ 5 - 5
src/MeidoPhotoStudio.Plugin/Managers/LightManager.cs

@@ -17,11 +17,11 @@ public class LightManager : IManager
         get => cubeActive;
         set
         {
-            if (value != cubeActive)
-            {
-                cubeActive = value;
-                CubeActiveChange?.Invoke(null, EventArgs.Empty);
-            }
+            if (value == cubeActive)
+                return;
+
+            cubeActive = value;
+            CubeActiveChange?.Invoke(null, EventArgs.Empty);
         }
     }
 

+ 4 - 4
src/MeidoPhotoStudio.Plugin/Managers/MeidoManager.cs

@@ -103,8 +103,8 @@ public class MeidoManager : IManager
             return;
 
         if (!TryGetUIControl<SceneEditWindow.CustomPartsWindow>(
-                    uiRoot, "Window/CustomPartsWindow", out var sceneEditWindow
-                    ))
+            uiRoot, "Window/CustomPartsWindow", out var sceneEditWindow
+        ))
             return;
 
         // Preset application
@@ -325,8 +325,8 @@ public class MeidoManager : IManager
         SelectedMeido = 0;
 
         var commonMeidoIDs = new HashSet<int>(
-                ActiveMeidoList.Where(meido => SelectedMeidoSet.Contains(meido.StockNo)).Select(meido => meido.StockNo)
-                );
+            ActiveMeidoList.Where(meido => SelectedMeidoSet.Contains(meido.StockNo)).Select(meido => meido.StockNo)
+        );
 
         foreach (var meido in ActiveMeidoList)
         {

+ 15 - 16
src/MeidoPhotoStudio.Plugin/Managers/PropManager.cs

@@ -28,11 +28,11 @@ public class PropManager : IManager
         get => cubeActive;
         set
         {
-            if (value != cubeActive)
-            {
-                cubeActive = value;
-                CubeActiveChange?.Invoke(null, EventArgs.Empty);
-            }
+            if (value == cubeActive)
+                return;
+
+            cubeActive = value;
+            CubeActiveChange?.Invoke(null, EventArgs.Empty);
         }
     }
 
@@ -41,11 +41,11 @@ public class PropManager : IManager
         get => cubeSmall;
         set
         {
-            if (value != cubeSmall)
-            {
-                cubeSmall = value;
-                CubeSmallChange?.Invoke(null, EventArgs.Empty);
-            }
+            if (value == cubeSmall)
+                return;
+
+            cubeSmall = value;
+            CubeSmallChange?.Invoke(null, EventArgs.Empty);
         }
     }
 
@@ -89,8 +89,8 @@ public class PropManager : IManager
 
     public string[] PropNameList =>
         propList.Count == 0
-        ? new[] { Translation.Get("systemMessage", "noProps") }
-    : propList.Select(prop => prop.Name).ToArray();
+            ? new[] { Translation.Get("systemMessage", "noProps") }
+            : propList.Select(prop => prop.Name).ToArray();
 
     public int PropCount =>
         propList.Count;
@@ -119,14 +119,13 @@ public class PropManager : IManager
 
     static PropManager() =>
         modItemsOnly = Configuration.Config.Bind(
-                "Prop", "ModItemsOnly",
-                false,
-                "Disable waiting for and loading base game clothing"
-                );
+            "Prop", "ModItemsOnly", false, "Disable waiting for and loading base game clothing"
+        );
 
     public PropManager(MeidoManager meidoManager)
     {
         this.meidoManager = meidoManager;
+
         meidoManager.BeginCallMeidos += OnBeginCallMeidos;
         meidoManager.EndCallMeidos += OnEndCallMeidos;
         Activate();

+ 13 - 15
src/MeidoPhotoStudio.Plugin/Managers/SceneManager.cs

@@ -66,16 +66,12 @@ public class SceneManager : IManager
     static SceneManager()
     {
         sortDescending = Configuration.Config.Bind(
-                "SceneManager", "SortDescending",
-                false,
-                "Sort scenes descending (Z-A)"
-                );
+            "SceneManager", "SortDescending", false, "Sort scenes descending (Z-A)"
+        );
 
         currentSortMode = Configuration.Config.Bind(
-                "SceneManager", "SortMode",
-                SortMode.Name,
-                "Scene sorting mode"
-                );
+            "SceneManager", "SortMode", SortMode.Name, "Scene sorting mode"
+        );
 
         Input.Register(MpsKey.OpenSceneManager, KeyCode.F8, "Hide/show scene manager");
         Input.Register(MpsKey.SaveScene, KeyCode.S, "Quick save scene");
@@ -85,6 +81,7 @@ public class SceneManager : IManager
     public SceneManager(MeidoPhotoStudio meidoPhotoStudio)
     {
         this.meidoPhotoStudio = meidoPhotoStudio;
+
         Activate();
     }
 
@@ -92,14 +89,15 @@ public class SceneManager : IManager
 
     public void Initialize()
     {
-        if (!Initialized)
-        {
-            Initialized = true;
-            SelectDirectory(0);
-        }
+        if (Initialized)
+            return;
+
+        Initialized = true;
+        SelectDirectory(0);
     }
 
-    public void Deactivate() => ClearSceneList();
+    public void Deactivate() =>
+        ClearSceneList();
 
     public void Update()
     {
@@ -269,7 +267,7 @@ public class SceneManager : IManager
         var baseDirectoryName = KankyoMode ? Constants.kankyoDirectory : Constants.sceneDirectory;
 
         CurrentDirectoryList.Sort((a, b) =>
-                a.Equals(baseDirectoryName, StringComparison.InvariantCultureIgnoreCase)
+            a.Equals(baseDirectoryName, StringComparison.InvariantCultureIgnoreCase)
                 ? -1
                 : WindowsLogicalComparer.StrCmpLogicalW(a, b));
     }

+ 6 - 6
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointFinger.cs

@@ -25,7 +25,7 @@ public class DragPointFinger : DragPointMeido
         baseFinger = parentName.Length is 7 or 4;
         ikChain = new Transform[2] {
             myObject.parent,
-                myObject
+            myObject
         };
 
         ikCtrlData = IkCtrlData;
@@ -44,11 +44,11 @@ public class DragPointFinger : DragPointMeido
     }
 
     protected override void UpdateDragType() =>
-        CurrentDragType = Input.GetKey(MpsKey.DragFinger)
-        ? Input.Shift
-        ? DragType.RotLocalY
-        : DragType.MoveXZ
-        : DragType.None;
+        CurrentDragType = !Input.GetKey(MpsKey.DragFinger)
+            ? DragType.None
+            : Input.Shift
+                ? DragType.RotLocalY
+                : DragType.MoveXZ;
 
     protected override void OnMouseDown()
     {

+ 4 - 4
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointHead.cs

@@ -97,11 +97,11 @@ public class DragPointHead : DragPointMeido
             var inv = CurrentDragType == DragType.MoveY ? -1 : 1;
 
             meido.Body.quaDefEyeL.eulerAngles = new(
-                    eyeRotationL.x, eyeRotationL.y - mouseDelta.x / 10f, eyeRotationL.z - mouseDelta.y / 10f
-                    );
+                eyeRotationL.x, eyeRotationL.y - mouseDelta.x / 10f, eyeRotationL.z - mouseDelta.y / 10f
+            );
             meido.Body.quaDefEyeR.eulerAngles = new(
-                    eyeRotationR.x, eyeRotationR.y + inv * mouseDelta.x / 10f, eyeRotationR.z + mouseDelta.y / 10f
-                    );
+                eyeRotationR.x, eyeRotationR.y + inv * mouseDelta.x / 10f, eyeRotationR.z + mouseDelta.y / 10f
+            );
         }
     }
 }

+ 7 - 6
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointPelvis.cs

@@ -19,13 +19,14 @@ public class DragPointPelvis : DragPointMeido
     }
 
     protected override void UpdateDragType() =>
+        // TODO: Rethink this
         CurrentDragType = Input.Alt && !Input.Control
-        ? Input.Shift
-        ? DragType.RotLocalY
-        : DragType.RotLocalXZ
-        : OtherDragType()
-        ? DragType.Ignore
-        : DragType.None;
+            ? Input.Shift
+                ? DragType.RotLocalY
+                : DragType.RotLocalXZ
+            : OtherDragType()
+                ? DragType.Ignore
+                : DragType.None;
 
     protected override void OnMouseDown()
     {

+ 8 - 9
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointTorso.cs

@@ -37,13 +37,14 @@ public class DragPointTorso : DragPointMeido
     }
 
     protected override void UpdateDragType() =>
+        // TODO: Rethink this
         CurrentDragType = Input.Alt && !Input.Control
-        ? Input.Shift
-        ? DragType.RotLocalY
-        : DragType.RotLocalXZ
-        : OtherDragType()
-        ? DragType.Ignore
-        : DragType.None;
+            ? Input.Shift
+                ? DragType.RotLocalY
+                : DragType.RotLocalXZ
+            : OtherDragType()
+                ? DragType.Ignore
+                : DragType.None;
 
     protected override void OnMouseDown()
     {
@@ -67,9 +68,7 @@ public class DragPointTorso : DragPointMeido
             for (var i = 0; i < spine.Length; i++)
             {
                 spine[i].localRotation = spineRotation[i];
-                spine[i].Rotate(
-                        camera.transform.forward, -mouseDelta.x / 1.5f * blah[i], Space.World
-                        );
+                spine[i].Rotate(camera.transform.forward, -mouseDelta.x / 1.5f * blah[i], Space.World);
                 spine[i].Rotate(camera.transform.right, mouseDelta.y * blah[i], Space.World);
             }
 

+ 2 - 2
src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointChain.cs

@@ -16,8 +16,8 @@ public abstract class DragPointChain : DragPointMeido
 
         ikChain = new Transform[] {
             myObject.parent,
-                myObject.parent,
-                myObject
+            myObject.parent,
+            myObject
         };
 
         ikCtrlData = IkCtrlData;

+ 18 - 18
src/MeidoPhotoStudio.Plugin/Meido/Meido.cs

@@ -21,17 +21,17 @@ public class Meido
     public static readonly string[] faceKeys = new string[24]
     {
         "eyeclose", "eyeclose2", "eyeclose3", "eyebig", "eyeclose6", "eyeclose5", "hitomih",
-            "hitomis", "mayuha", "mayuw", "mayuup", "mayuv", "mayuvhalf", "moutha", "mouths",
-            "mouthc", "mouthi", "mouthup", "mouthdw", "mouthhe", "mouthuphalf", "tangout",
-            "tangup", "tangopen"
+        "hitomis", "mayuha", "mayuw", "mayuup", "mayuv", "mayuvhalf", "moutha", "mouths",
+        "mouthc", "mouthi", "mouthup", "mouthdw", "mouthhe", "mouthuphalf", "tangout",
+        "tangup", "tangopen"
     };
 
     public static readonly string[] faceToggleKeys = new string[12]
     {
         // blush, shade, nose up, tears, drool, teeth
         "hoho2", "shock", "nosefook", "namida", "yodare", "toothoff",
-            // cry 1, cry 2, cry 3, blush 1, blush 2, blush 3
-            "tear1", "tear2", "tear3", "hohos", "hoho", "hohol"
+        // cry 1, cry 2, cry 3, blush 1, blush 2, blush 3
+        "tear1", "tear2", "tear3", "hohos", "hoho", "hohol"
     };
 
     private readonly FieldInfo m_eMaskMode = Utility.GetFieldInfo<TBody>("m_eMaskMode");
@@ -502,8 +502,8 @@ public class Meido
                     }
                     else
                         Utility.LogWarning(
-                                $"{blendSetFileName}: Could not parse value '{element.Value}' of '{key}' at line {line}"
-                                );
+                            $"{blendSetFileName}: Could not parse value '{element.Value}' of '{key}' at line {line}"
+                        );
                 }
             }
             catch (System.Xml.XmlException e)
@@ -570,7 +570,7 @@ public class Meido
 
         var blendIndex = (int)morph.hash[hash];
 
-        if (faceKey == "nosefook")
+        if (faceKey is "nosefook")
             Maid.boNoseFook = morph.boNoseFook = value > 0f;
         else
             morph.dicBlendSet[CurrentFaceBlendSet][blendIndex] = value;
@@ -583,7 +583,7 @@ public class Meido
     {
         var morph = Body.Face.morph;
 
-        if (hash == "nosefook")
+        if (hash is "nosefook")
             return (Maid.boNoseFook || morph.boNoseFook) ? 1f : 0f;
 
         hash = Utility.GP01FbFaceHash(morph, hash);
@@ -599,7 +599,7 @@ public class Meido
     }
 
     public void SetMaskMode(Mask maskMode) =>
-        SetMaskMode(maskMode == Mask.Nude ? MaskMode.Nude : (MaskMode)maskMode);
+        SetMaskMode(maskMode is Mask.Nude ? MaskMode.Nude : (MaskMode)maskMode);
 
     public void SetMaskMode(MaskMode maskMode)
     {
@@ -624,9 +624,9 @@ public class Meido
 
     public void SetCurling(Curl curling, bool enabled)
     {
-        var name = curling == Curl.Shift
+        var name = curling is Curl.Shift
             ? new[] { "panz", "mizugi" }
-        : new[] { "skirt", "onepiece" };
+            : new[] { "skirt", "onepiece" };
 
         if (enabled)
         {
@@ -740,7 +740,7 @@ public class Meido
 
         var gravityControlProps = new[] {
             MPN.skirt, MPN.onepiece, MPN.mizugi, MPN.panz, MPN.set_maidwear, MPN.set_mywear, MPN.set_underwear,
-                MPN.hairf, MPN.hairr, MPN.hairs, MPN.hairt
+            MPN.hairf, MPN.hairr, MPN.hairs, MPN.hairt
         };
 
         Action action = null;
@@ -784,7 +784,6 @@ public class Meido
 
             // Maid animation needs to be set again for custom parts edit
             var uiRoot = GameObject.Find("UI Root");
-
             var customPartsWindow = UTY.GetChildObject(uiRoot, "Window/CustomPartsWindow")
                 .GetComponent<SceneEditWindow.CustomPartsWindow>();
 
@@ -858,8 +857,8 @@ public class Meido
     private DragPointGravity MakeGravityControl(bool skirt = false)
     {
         var gravityDragpoint = DragPoint.Make<DragPointGravity>(
-                PrimitiveType.Cube, Vector3.one * 0.12f
-                );
+            PrimitiveType.Cube, Vector3.one * 0.12f
+        );
 
         var control = DragPointGravity.MakeGravityControl(Maid, skirt);
 
@@ -880,8 +879,8 @@ public class Meido
     private void OnGravityChange(DragPointGravity dragPoint)
     {
         var args = new GravityEventArgs(
-                dragPoint == SkirtGravityControl, dragPoint.MyObject.transform.localPosition
-                );
+            dragPoint == SkirtGravityControl, dragPoint.MyObject.transform.localPosition
+        );
 
         GravityMove?.Invoke(this, args);
     }
@@ -903,6 +902,7 @@ public readonly struct PoseInfo
 {
     private static readonly PoseInfo defaultPose =
         new(Constants.PoseGroupList[0], Constants.PoseDict[Constants.PoseGroupList[0]][0]);
+
     public static ref readonly PoseInfo DefaultPose =>
         ref defaultPose;
 

+ 48 - 73
src/MeidoPhotoStudio.Plugin/Meido/MeidoDragPointManager.cs

@@ -232,15 +232,15 @@ public class MeidoDragPointManager
             ? new[]
             {
                 Bone.Pelvis, Bone.Spine, Bone.Spine0a, Bone.Spine1, Bone.Spine1a, Bone.Neck, Bone.UpperArmL,
-                    Bone.UpperArmR, Bone.ForearmL, Bone.ForearmR, Bone.ThighL, Bone.ThighR, Bone.CalfL, Bone.CalfR,
-                    Bone.HandL, Bone.HandR, Bone.FootL, Bone.FootR,
+                Bone.UpperArmR, Bone.ForearmL, Bone.ForearmR, Bone.ThighL, Bone.ThighR, Bone.CalfL, Bone.CalfR,
+                Bone.HandL, Bone.HandR, Bone.FootL, Bone.FootR,
             }
         : new[]
         {
             Bone.Hip, Bone.Pelvis, Bone.Spine, Bone.Spine0a, Bone.Spine1, Bone.Spine1a, Bone.Neck,
-                Bone.ClavicleL, Bone.ClavicleR, Bone.UpperArmL, Bone.UpperArmR, Bone.ForearmL, Bone.ForearmR,
-                Bone.ThighL, Bone.ThighR, Bone.CalfL, Bone.CalfR, Bone.MuneL, Bone.MuneR, Bone.MuneSubL,
-                Bone.MuneSubR, Bone.HandL, Bone.HandR, Bone.FootL, Bone.FootR,
+            Bone.ClavicleL, Bone.ClavicleR, Bone.UpperArmL, Bone.UpperArmR, Bone.ForearmL, Bone.ForearmR,
+            Bone.ThighL, Bone.ThighR, Bone.CalfL, Bone.CalfR, Bone.MuneL, Bone.MuneR, Bone.MuneSubL,
+            Bone.MuneSubR, Bone.HandL, Bone.HandR, Bone.FootL, Bone.FootR,
         };
 
         var localRotationIndex = Array.IndexOf(bones, Bone.CalfR);
@@ -289,7 +289,7 @@ public class MeidoDragPointManager
         var single = new[] { Bone.Pelvis, Bone.Spine, Bone.Spine0a, Bone.Spine1, Bone.Spine1a, Bone.Neck };
         var pair = new[] {
             Bone.ClavicleL, Bone.ClavicleR, Bone.UpperArmL, Bone.UpperArmR, Bone.ForearmL, Bone.ForearmR,
-                Bone.ThighL, Bone.ThighR, Bone.CalfL, Bone.CalfR, Bone.HandL, Bone.HandR, Bone.FootL, Bone.FootR
+            Bone.ThighL, Bone.ThighR, Bone.CalfL, Bone.CalfR, Bone.HandL, Bone.HandR, Bone.FootL, Bone.FootR
         };
 
         var singleRotations = single.Select(bone => BoneTransform[bone].eulerAngles).ToList();
@@ -305,8 +305,8 @@ public class MeidoDragPointManager
         var vecHipR = hipR.eulerAngles;
 
         hip.rotation = Quaternion.Euler(
-                360f - (vecHip.x + 270f) - 270f, 360f - (vecHip.y + 90f) - 90f, 360f - vecHip.z
-                );
+            360f - (vecHip.x + 270f) - 270f, 360f - (vecHip.y + 90f) - 90f, 360f - vecHip.z
+        );
 
         hipL.rotation = FlipRotation(vecHipR);
         hipR.rotation = FlipRotation(vecHipL);
@@ -465,10 +465,9 @@ public class MeidoDragPointManager
         for (var bone = start; bone <= end; bone += joints)
             for (var i = 0; i < joints - 1; i++)
                 BoneTransform[bone + i].localRotation =
-                    new(
-                            binaryReader.ReadSingle() * mirror, binaryReader.ReadSingle() * mirror,
-                            binaryReader.ReadSingle(), binaryReader.ReadSingle()
-                       );
+                    new(binaryReader.ReadSingle() * mirror, binaryReader.ReadSingle() * mirror,
+                        binaryReader.ReadSingle(), binaryReader.ReadSingle()
+                   );
     }
 
     private void InitializeDragPoints()
@@ -486,39 +485,34 @@ public class MeidoDragPointManager
         dragBody = DragPoint.Make<DragPointBody>(PrimitiveType.Capsule, new Vector3(0.2f, 0.3f, 0.24f));
 
         dragBody.Initialize(
-                () => new Vector3(
-                                  (BoneTransform[Bone.Hip].position.x + BoneTransform[Bone.Spine0a].position.x) / 2f,
-                                  (BoneTransform[Bone.Spine1].position.y + BoneTransform[Bone.Spine0a].position.y) / 2f,
-                                  (BoneTransform[Bone.Spine0a].position.z + BoneTransform[Bone.Hip].position.z) / 2f
-                                 ),
-                () => new Vector3(
-                                  BoneTransform[Bone.Spine0a].eulerAngles.x,
-                                  BoneTransform[Bone.Spine0a].eulerAngles.y,
-                                  BoneTransform[Bone.Spine0a].eulerAngles.z + 90f
-                                 )
-                );
+            () => new(
+                (BoneTransform[Bone.Hip].position.x + BoneTransform[Bone.Spine0a].position.x) / 2f,
+                (BoneTransform[Bone.Spine1].position.y + BoneTransform[Bone.Spine0a].position.y) / 2f,
+                (BoneTransform[Bone.Spine0a].position.z + BoneTransform[Bone.Hip].position.z) / 2f
+            ),
+            () => new(
+                BoneTransform[Bone.Spine0a].eulerAngles.x, BoneTransform[Bone.Spine0a].eulerAngles.y,
+                BoneTransform[Bone.Spine0a].eulerAngles.z + 90f
+            )
+        );
 
         dragBody.Set(meido.Maid.transform);
         dragBody.Select += OnSelectBody;
         dragBody.EndScale += OnSetDragPointScale;
 
         // Neck Dragpoint
-        var dragNeck = DragPoint.Make<DragPointHead>(
-                PrimitiveType.Sphere, new Vector3(0.2f, 0.24f, 0.2f)
-                );
+        var dragNeck = DragPoint.Make<DragPointHead>(PrimitiveType.Sphere, new(0.2f, 0.24f, 0.2f));
 
         dragNeck.Initialize(meido,
-                () => new Vector3(
-                                  BoneTransform[Bone.Head].position.x,
-                                  (BoneTransform[Bone.Head].position.y * 1.2f + BoneTransform[Bone.HeadNub].position.y * 0.8f) / 2f,
-                                  BoneTransform[Bone.Head].position.z
-                                 ),
-                () => new Vector3(
-                                  BoneTransform[Bone.Head].eulerAngles.x,
-                                  BoneTransform[Bone.Head].eulerAngles.y,
-                                  BoneTransform[Bone.Head].eulerAngles.z + 90f
-                                 )
-                );
+            () => new(
+                BoneTransform[Bone.Head].position.x,
+                (BoneTransform[Bone.Head].position.y * 1.2f + BoneTransform[Bone.HeadNub].position.y * 0.8f) / 2f,
+                BoneTransform[Bone.Head].position.z
+            ),
+            () => new(BoneTransform[Bone.Head].eulerAngles.x, BoneTransform[Bone.Head].eulerAngles.y,
+                BoneTransform[Bone.Head].eulerAngles.z + 90f
+            )
+        );
 
         dragNeck.Set(BoneTransform[Bone.Neck]);
         dragNeck.Select += OnSelectFace;
@@ -538,22 +532,12 @@ public class MeidoDragPointManager
         var spineTrans1 = BoneTransform[Bone.Spine1];
         var spineTrans2 = BoneTransform[Bone.Spine1a];
 
-        var dragTorso = DragPoint.Make<DragPointTorso>(
-                PrimitiveType.Capsule, new Vector3(0.2f, 0.19f, 0.24f)
-                );
+        var dragTorso = DragPoint.Make<DragPointTorso>(PrimitiveType.Capsule, new Vector3(0.2f, 0.19f, 0.24f));
 
         dragTorso.Initialize(meido,
-                () => new Vector3(
-                                  spineTrans1.position.x,
-                                  spineTrans2.position.y,
-                                  spineTrans1.position.z - 0.05f
-                                 ),
-                () => new Vector3(
-                                  spineTrans1.eulerAngles.x,
-                                  spineTrans1.eulerAngles.y,
-                                  spineTrans1.eulerAngles.z + 90f
-                                 )
-                );
+            () => new(spineTrans1.position.x, spineTrans2.position.y, spineTrans1.position.z - 0.05f),
+            () => new(spineTrans1.eulerAngles.x, spineTrans1.eulerAngles.y, spineTrans1.eulerAngles.z + 90f)
+        );
 
         dragTorso.Set(BoneTransform[Bone.Spine1a]);
 
@@ -563,22 +547,16 @@ public class MeidoDragPointManager
         var pelvisTrans = BoneTransform[Bone.Pelvis];
         var spineTrans = BoneTransform[Bone.Spine];
 
-        var dragPelvis = DragPoint.Make<DragPointPelvis>(
-                PrimitiveType.Capsule, new Vector3(0.2f, 0.15f, 0.24f)
-                );
+        var dragPelvis = DragPoint.Make<DragPointPelvis>(PrimitiveType.Capsule, new(0.2f, 0.15f, 0.24f));
+
         dragPelvis.Initialize(meido,
+            () => new(
+                pelvisTrans.position.x, (pelvisTrans.position.y + spineTrans.position.y) / 2f,
+                pelvisTrans.position.z
+            ),
+            () => new(pelvisTrans.eulerAngles.x + 90f, pelvisTrans.eulerAngles.y + 90f, pelvisTrans.eulerAngles.z)
+        );
 
-                () => new Vector3(
-                                  pelvisTrans.position.x,
-                                  (pelvisTrans.position.y + spineTrans.position.y) / 2f,
-                                  pelvisTrans.position.z
-                                 ),
-                () => new Vector3(
-                                  pelvisTrans.eulerAngles.x + 90f,
-                                  pelvisTrans.eulerAngles.y + 90f,
-                                  pelvisTrans.eulerAngles.z
-                                 )
-                );
         dragPelvis.Set(BoneTransform[Bone.Pelvis]);
 
         DragPoints[Bone.Pelvis] = dragPelvis;
@@ -632,9 +610,8 @@ public class MeidoDragPointManager
         var muneDragPoint = DragPoint.Make<DragPointMune>(PrimitiveType.Sphere, Vector3.one * 0.12f);
 
         muneDragPoint.Initialize(meido,
-                () => (BoneTransform[mune].position + BoneTransform[sub].position) / 2f,
-                () => Vector3.zero
-                );
+            () => (BoneTransform[mune].position + BoneTransform[sub].position) / 2f, () => Vector3.zero
+        );
 
         muneDragPoint.Set(BoneTransform[sub]);
         DragPoints[mune] = muneDragPoint;
@@ -643,7 +620,6 @@ public class MeidoDragPointManager
     private DragPointLimb[] MakeLegChain(Transform lower)
     {
         var limbDragPointSize = Vector3.one * 0.12f;
-
         var dragPoints = new DragPointLimb[2];
 
         for (var i = dragPoints.Length - 1; i >= 0; i--)
@@ -690,10 +666,7 @@ public class MeidoDragPointManager
             var primitive = bone == Bone.Hip ? PrimitiveType.Cube : PrimitiveType.Sphere;
             var dragPoint = DragPoint.Make<DragPointSpine>(primitive, spineDragPointSize);
 
-            dragPoint.Initialize(meido,
-                    () => spine.position,
-                    () => Vector3.zero
-                    );
+            dragPoint.Initialize(meido, () => spine.position, () => Vector3.zero);
 
             dragPoint.Set(spine);
             dragPoint.AddGizmo();
@@ -753,6 +726,7 @@ public class MeidoDragPointManager
             [Bone.ThighR] = CMT.SearchObjName(transform, "Bip01 R Thigh"),
             [Bone.CalfR] = CMT.SearchObjName(transform, "Bip01 R Calf"),
             [Bone.FootR] = CMT.SearchObjName(transform, "Bip01 R Foot"),
+
             // fingers
             [Bone.Finger0L] = CMT.SearchObjName(transform, "Bip01 L Finger0"),
             [Bone.Finger01L] = CMT.SearchObjName(transform, "Bip01 L Finger01"),
@@ -794,6 +768,7 @@ public class MeidoDragPointManager
             [Bone.Finger41R] = CMT.SearchObjName(transform, "Bip01 R Finger41"),
             [Bone.Finger42R] = CMT.SearchObjName(transform, "Bip01 R Finger42"),
             [Bone.Finger4NubR] = CMT.SearchObjName(transform, "Bip01 R Finger4Nub"),
+
             // Toes
             [Bone.Toe0L] = CMT.SearchObjName(transform, "Bip01 L Toe0"),
             [Bone.Toe01L] = CMT.SearchObjName(transform, "Bip01 L Toe01"),

+ 28 - 19
src/MeidoPhotoStudio.Plugin/MeidoPhotoStudio.cs

@@ -151,26 +151,34 @@ public class MeidoPhotoStudio : BaseUnityPlugin
                 {
                     case MeidoManager.header:
                         Serialization.Get<MeidoManager>().Deserialize(meidoManager, dataReader, metadata);
+
                         break;
                     case MessageWindowManager.header:
                         Serialization.Get<MessageWindowManager>().Deserialize(messageWindowManager, dataReader, metadata);
+
                         break;
                     case CameraManager.header:
                         Serialization.Get<CameraManager>().Deserialize(cameraManager, dataReader, metadata);
+
                         break;
                     case LightManager.header:
                         Serialization.Get<LightManager>().Deserialize(lightManager, dataReader, metadata);
+
                         break;
                     case EffectManager.header:
                         Serialization.Get<EffectManager>().Deserialize(effectManager, dataReader, metadata);
+
                         break;
                     case EnvironmentManager.header:
                         Serialization.Get<EnvironmentManager>().Deserialize(environmentManager, dataReader, metadata);
+
                         break;
                     case PropManager.header:
                         Serialization.Get<PropManager>().Deserialize(propManager, dataReader, metadata);
+
                         break;
-                    default: throw new Exception($"Unknown header '{header}'");
+                    default:
+                        throw new Exception($"Unknown header '{header}'");
                 }
 
                 previousHeader = header;
@@ -179,9 +187,10 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         catch (Exception e)
         {
             Utility.LogError(
-                    $"Failed to deserialize scene because {e.Message}"
-                    + $"\nCurrent header: '{header}'. Last header: '{previousHeader}'"
-                    );
+                $"Failed to deserialize scene because {e.Message}"
+                + $"\nCurrent header: '{header}'. Last header: '{previousHeader}'"
+            );
+
             Utility.LogError(e.StackTrace);
         }
     }
@@ -289,9 +298,9 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         // Hide other drag points
         var isCubeActive = new[] {
             MeidoDragPointManager.CubeActive,
-                PropManager.CubeActive,
-                LightManager.CubeActive,
-                EnvironmentManager.CubeActive
+            PropManager.CubeActive,
+            LightManager.CubeActive,
+            EnvironmentManager.CubeActive
         };
 
         MeidoDragPointManager.CubeActive = false;
@@ -423,8 +432,8 @@ public class MeidoPhotoStudio : BaseUnityPlugin
                 [Constants.Window.Pose] = new PoseWindowPane(meidoManager, maidSwitcherPane),
                 [Constants.Window.Face] = new FaceWindowPane(meidoManager, maidSwitcherPane),
                 [Constants.Window.BG] = new BGWindowPane(
-                            environmentManager, lightManager, effectManager, sceneWindow, cameraManager
-                            ),
+                    environmentManager, lightManager, effectManager, sceneWindow, cameraManager
+                ),
                 [Constants.Window.BG2] = new BG2WindowPane(meidoManager, propManager),
                 [Constants.Window.Settings] = new SettingsWindowPane()
             },
@@ -487,16 +496,16 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         }
 
         sysDialog.Show(
-                string.Format(Translation.Get("systemMessage", "exitConfirm"), pluginName),
-                SystemDialog.TYPE.OK_CANCEL,
-                Exit,
-                () =>
-                {
-                    sysDialog.Close();
-                    uiActive = true;
-                    active = true;
-                }
-                );
+            string.Format(Translation.Get("systemMessage", "exitConfirm"), pluginName),
+            SystemDialog.TYPE.OK_CANCEL,
+            Exit,
+            () =>
+            {
+                sysDialog.Close();
+                uiActive = true;
+                active = true;
+            }
+        );
 
         void Exit()
         {

+ 2 - 0
src/MeidoPhotoStudio.Plugin/MenuFileUtility.cs

@@ -70,6 +70,7 @@ public static class MenuFileUtility
     public static bool ParseNativeMenuFile(int menuIndex, ModItem modItem)
     {
         var menuDataBase = GameMain.Instance.MenuDataBase;
+
         menuDataBase.SetIndex(menuIndex);
 
         if (menuDataBase.GetBoDelOnly())
@@ -241,6 +242,7 @@ public static class MenuFileUtility
         catch (Exception e)
         {
             Utility.LogWarning($"Could not parse mod menu file '{modMenuFile}' because {e}");
+
             return false;
         }
 

+ 8 - 8
src/MeidoPhotoStudio.Plugin/ModelUtility.cs

@@ -147,8 +147,8 @@ public static class ModelUtility
                 catch (Exception e)
                 {
                     Utility.LogError(
-                            $"Could not read mod menu file '{modItem.MenuFile}' because {e.Message}\n{e.StackTrace}"
-                            );
+                        $"Could not read mod menu file '{modItem.MenuFile}' because {e.Message}\n{e.StackTrace}"
+                    );
 
                     return null;
                 }
@@ -564,12 +564,12 @@ public static class ModelUtility
                                 break;
                             case "色設定":
                                 material.SetColor(
-                                        data[1],
-                                        new Color(
-                                            float.Parse(data[2]) / 255f, float.Parse(data[3]) / 255f,
-                                            float.Parse(data[4]) / 255f, float.Parse(data[5]) / 255f
-                                            )
-                                        );
+                                    data[1],
+                                    new Color(
+                                        float.Parse(data[2]) / 255f, float.Parse(data[3]) / 255f,
+                                        float.Parse(data[4]) / 255f, float.Parse(data[5]) / 255f
+                                    )
+                                );
 
                                 break;
                             case "数値設定":

+ 2 - 2
src/MeidoPhotoStudio.Plugin/Serialization/Serializers/ManagerSerializers/EnvironmentManagerSerializer.cs

@@ -40,8 +40,8 @@ public class EnvironmentManagerSerializer : Serializer<EnvironmentManager>
             : Constants.BGList;
 
         var assetIndex = bgList.FindIndex(
-                asset => asset.Equals(bgAsset, StringComparison.InvariantCultureIgnoreCase)
-                );
+            asset => asset.Equals(bgAsset, StringComparison.InvariantCultureIgnoreCase)
+        );
 
         var validBg = assetIndex >= 0;
 

+ 3 - 0
src/MeidoPhotoStudio.Plugin/Serialization/Serializers/ManagerSerializers/MeidoManagerSerializer.cs

@@ -28,6 +28,7 @@ public class MeidoManagerSerializer : Serializer<MeidoManager>
         var globalGravity = manager.GlobalGravity;
 
         writer.Write(meidoCount);
+
         foreach (var meido in meidoList)
         {
             MeidoSerializer.Serialize(meido, writer);
@@ -63,6 +64,7 @@ public class MeidoManagerSerializer : Serializer<MeidoManager>
             if (i >= manager.ActiveMeidoList.Count)
             {
                 reader.BaseStream.Seek(reader.ReadInt64(), SeekOrigin.Current);
+
                 continue;
             }
 
@@ -72,6 +74,7 @@ public class MeidoManagerSerializer : Serializer<MeidoManager>
         var globalGravity = reader.ReadBoolean();
         var hairPosition = reader.ReadVector3();
         var skirtPosition = reader.ReadVector3();
+
         Utility.SetFieldValue(manager, "globalGravity", globalGravity);
 
         if (!globalGravity)

+ 2 - 2
src/MeidoPhotoStudio.Plugin/Serialization/Serializers/MeidoSerializer.cs

@@ -229,13 +229,13 @@ public class MeidoSerializer : Serializer<Meido>
             if (metadata.MMConverted)
                 continue;
 
-            if (clothingSlot == TBody.SlotID.wear)
+            if (clothingSlot is TBody.SlotID.wear)
             {
                 body.SetMask(TBody.SlotID.wear, value);
                 body.SetMask(TBody.SlotID.mizugi, value);
                 body.SetMask(TBody.SlotID.onepiece, value);
             }
-            else if (clothingSlot == TBody.SlotID.megane)
+            else if (clothingSlot is TBody.SlotID.megane)
             {
                 body.SetMask(TBody.SlotID.megane, value);
                 body.SetMask(TBody.SlotID.accHead, value);

+ 9 - 13
src/MeidoPhotoStudio.Plugin/Translation.cs

@@ -40,17 +40,13 @@ public static class Translation
     static Translation()
     {
         currentLanguage = Configuration.Config.Bind(
-                settingsHeader, "Language",
-                "en",
-                "Directory to pull translations from"
-                + "\nTranslations are found in the 'Translations' folder"
-                );
+            settingsHeader, "Language", "en",
+            "Directory to pull translations from\nTranslations are found in the 'Translations' folder"
+        );
 
         suppressWarnings = Configuration.Config.Bind(
-                settingsHeader, "SuppressWarnings",
-                false,
-                "Suppress translation warnings from showing up in the console"
-                );
+            settingsHeader, "SuppressWarnings", false, "Suppress translation warnings from showing up in the console"
+        );
 
         suppressWarningsCached = !suppressWarnings.Value;
     }
@@ -87,8 +83,8 @@ public static class Translation
                     var token = translationProp.Value;
 
                     Translations[translationProp.Path] = new(
-                            token.ToObject<Dictionary<string, string>>(), StringComparer.InvariantCultureIgnoreCase
-                            );
+                        token.ToObject<Dictionary<string, string>>(), StringComparer.InvariantCultureIgnoreCase
+                    );
                 }
             }
             catch
@@ -122,8 +118,8 @@ public static class Translation
             if (warn)
             {
                 Utility.LogWarning(
-                        $"Could not translate '{text}': '{text}' was not found in category '{category}'"
-                        );
+                    $"Could not translate '{text}': '{text}' was not found in category '{category}'"
+                );
             }
 
             return false;

+ 15 - 17
src/MeidoPhotoStudio.Plugin/Utility.cs

@@ -28,8 +28,8 @@ public static class Utility
     internal static readonly byte[] pngHeader = { 137, 80, 78, 71, 13, 10, 26, 10 };
     internal static readonly byte[] pngEnd = System.Text.Encoding.ASCII.GetBytes("IEND");
     internal static readonly Regex guidRegEx = new(
-            @"^[a-f0-9]{8}(\-[a-f0-9]{4}){3}\-[a-f0-9]{12}$", RegexOptions.IgnoreCase
-            );
+        @"^[a-f0-9]{8}(\-[a-f0-9]{4}){3}\-[a-f0-9]{12}$", RegexOptions.IgnoreCase
+    );
     internal static readonly GameObject mousePositionGo;
     internal static readonly MousePosition mousePosition;
 
@@ -93,8 +93,8 @@ public static class Utility
         var fieldInfo = GetFieldInfo<TType>(field);
 
         return fieldInfo is null || !fieldInfo.IsStatic && instance == null
-            ? default :
-            (TValue)fieldInfo.GetValue(instance);
+            ? default
+            : (TValue)fieldInfo.GetValue(instance);
     }
 
     public static void SetFieldValue<TType, TValue>(TType instance, string name, TValue value) =>
@@ -121,8 +121,8 @@ public static class Utility
     public static string ScreenshotFilename()
     {
         var screenShotDir = Path.Combine(
-                GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "ScreenShot"
-                );
+            GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "ScreenShot"
+        );
 
         if (!Directory.Exists(screenShotDir))
             Directory.CreateDirectory(screenShotDir);
@@ -286,9 +286,7 @@ public class MousePosition : MonoBehaviour
 
 public static class KeyValuePairExtensions
 {
-    public static void Deconstruct<TKey, TValue>(
-            this KeyValuePair<TKey, TValue> kvp, out TKey key, out TValue value
-            )
+    public static void Deconstruct<TKey, TValue>(this KeyValuePair<TKey, TValue> kvp, out TKey key, out TValue value)
     {
         key = kvp.Key;
         value = kvp.Value;
@@ -327,7 +325,9 @@ public static class StreamExtensions
 
 public static class CameraUtility
 {
-    public static CameraMain MainCamera => GameMain.Instance.MainCamera;
+    public static CameraMain MainCamera =>
+        GameMain.Instance.MainCamera;
+
     public static UltimateOrbitCamera UOCamera { get; } =
         GameMain.Instance.MainCamera.GetComponent<UltimateOrbitCamera>();
 
@@ -367,7 +367,9 @@ public static class CameraUtility
 public static class BinaryExtensions
 {
     public static string ReadNullableString(this BinaryReader binaryReader) =>
-        binaryReader.ReadBoolean() ? binaryReader.ReadString() : null;
+        binaryReader.ReadBoolean()
+            ? binaryReader.ReadString()
+            : null;
 
     public static void WriteNullableString(this BinaryWriter binaryWriter, string str)
     {
@@ -419,9 +421,7 @@ public static class BinaryExtensions
     }
 
     public static Quaternion ReadQuaternion(this BinaryReader binaryReader) =>
-        new(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(),
-                binaryReader.ReadSingle()
-           );
+        new(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
 
     public static void Write(this BinaryWriter binaryWriter, Color colour)
     {
@@ -440,9 +440,7 @@ public static class BinaryExtensions
     }
 
     public static Color ReadColour(this BinaryReader binaryReader) =>
-        new(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(),
-                binaryReader.ReadSingle()
-           );
+        new(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
 
     public static Matrix4x4 ReadMatrix4x4(this BinaryReader binaryReader)
     {