浏览代码

Reformat part 4 more indentation and small touches

In addition, I prefer having the expression of an assignment be on its
own line if it cannot fit on one line. If the expression cannot fit one
its own line then just chop the line up to fit in whatever way seems
fit.

// Expression can fit on its own line.
var a =
    SomeFunction(b);

// Expression cannot fit on its own line.
var a = someFunction(
    b.ToLowerInvariant()
);

var a = b * anotherVariable
    + someOtherVariable;
habeebweeb 2 年之前
父节点
当前提交
7e213e7db6
共有 67 个文件被更改,包括 689 次插入644 次删除
  1. 1 0
      src/MeidoPhotoStudio.Converter/Converters/MMConverter.cs
  2. 2 2
      src/MeidoPhotoStudio.Converter/MultipleMaids/MMConstants.cs
  3. 14 25
      src/MeidoPhotoStudio.Converter/MultipleMaids/MMSceneConverter.cs
  4. 0 1
      src/MeidoPhotoStudio.Converter/Utility/PngUtility.cs
  5. 192 177
      src/MeidoPhotoStudio.Plugin/Constants.cs
  6. 11 17
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPoint.cs
  7. 6 3
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPointGeneral.cs
  8. 7 7
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPointGravity.cs
  9. 3 7
      src/MeidoPhotoStudio.Plugin/DragPoint/DragPointProp.cs
  10. 4 8
      src/MeidoPhotoStudio.Plugin/GUI/Controls/DropDown.cs
  11. 1 3
      src/MeidoPhotoStudio.Plugin/GUI/Controls/KeyRebindButton.cs
  12. 2 3
      src/MeidoPhotoStudio.Plugin/GUI/Controls/Modal.cs
  13. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Controls/SelectionGrid.cs
  14. 2 3
      src/MeidoPhotoStudio.Plugin/GUI/Controls/Slider.cs
  15. 4 7
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/ModPropsPane.cs
  16. 2 1
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/MyRoomPropsPane.cs
  17. 4 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/PropManagerPane.cs
  18. 4 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/PropsPane.cs
  19. 6 4
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/BackgroundSelectorPane.cs
  20. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/CameraPane.cs
  21. 4 0
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/DragPointPane.cs
  22. 2 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs
  23. 2 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/DepthOfFieldPane.cs
  24. 8 7
      src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/LightsPane.cs
  25. 6 8
      src/MeidoPhotoStudio.Plugin/GUI/Panes/CallWindowPanes/MaidSelectorPane.cs
  26. 7 12
      src/MeidoPhotoStudio.Plugin/GUI/Panes/FaceWindowPanes/MaidFaceBlendPane.cs
  27. 2 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/FaceWindowPanes/MaidFaceSliderPane.cs
  28. 5 5
      src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/FaceWindowPane.cs
  29. 0 1
      src/MeidoPhotoStudio.Plugin/GUI/Panes/MainWindowPanes/SettingsWindowPane.cs
  30. 8 7
      src/MeidoPhotoStudio.Plugin/GUI/Panes/OtherPanes/MaidSwitcherPane.cs
  31. 3 2
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/HandPresetPane.cs
  32. 8 8
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidDressingPane.cs
  33. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidFreeLookPane.cs
  34. 3 3
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidIKPane.cs
  35. 12 13
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidPoseSelectorPane.cs
  36. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MpnAttachPropPane.cs
  37. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Panes/SceneManagerPanes/SceneManagerScenePane.cs
  38. 4 6
      src/MeidoPhotoStudio.Plugin/GUI/Windows/BaseWindow.cs
  39. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneModalWindow.cs
  40. 1 1
      src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneWindow.cs
  41. 54 16
      src/MeidoPhotoStudio.Plugin/MaidPlacementUtility.cs
  42. 5 3
      src/MeidoPhotoStudio.Plugin/Managers/CameraManager.cs
  43. 1 1
      src/MeidoPhotoStudio.Plugin/Managers/EnvironmentManager.cs
  44. 2 3
      src/MeidoPhotoStudio.Plugin/Managers/InputManager.cs
  45. 5 5
      src/MeidoPhotoStudio.Plugin/Managers/LightManager.cs
  46. 2 1
      src/MeidoPhotoStudio.Plugin/Managers/MeidoManager.cs
  47. 8 5
      src/MeidoPhotoStudio.Plugin/Managers/PropManager.cs
  48. 15 13
      src/MeidoPhotoStudio.Plugin/Managers/SceneManager.cs
  49. 6 8
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointFinger.cs
  50. 21 19
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointHead.cs
  51. 6 5
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointPelvis.cs
  52. 8 8
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointSpine.cs
  53. 6 6
      src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointTorso.cs
  54. 2 1
      src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointChain.cs
  55. 16 11
      src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointLimb.cs
  56. 12 12
      src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointMune.cs
  57. 45 34
      src/MeidoPhotoStudio.Plugin/Meido/Meido.cs
  58. 42 38
      src/MeidoPhotoStudio.Plugin/Meido/MeidoDragPointManager.cs
  59. 47 41
      src/MeidoPhotoStudio.Plugin/MeidoPhotoStudio.cs
  60. 5 5
      src/MeidoPhotoStudio.Plugin/MenuFileCache.cs
  61. 4 2
      src/MeidoPhotoStudio.Plugin/MenuFileUtility.cs
  62. 4 4
      src/MeidoPhotoStudio.Plugin/ModelUtility.cs
  63. 6 18
      src/MeidoPhotoStudio.Plugin/MyGui.cs
  64. 4 2
      src/MeidoPhotoStudio.Plugin/Serialization/Serializers/ManagerSerializers/EffectManagerSerializer.cs
  65. 2 3
      src/MeidoPhotoStudio.Plugin/Serialization/Serializers/ManagerSerializers/EnvironmentManagerSerializer.cs
  66. 2 3
      src/MeidoPhotoStudio.Plugin/Translation.cs
  67. 12 17
      src/MeidoPhotoStudio.Plugin/Utility.cs

+ 1 - 0
src/MeidoPhotoStudio.Converter/Converters/MMConverter.cs

@@ -65,6 +65,7 @@ public class MMConverter : IConverter
                 return;
 
             Plugin.Instance.Logger.LogError($"Could not convert {Path.GetFileName(filePath)} scene because {e}");
+
             return;
         }
 

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

@@ -17,7 +17,7 @@ public static class MMConstants
         "tangup", "eyebig", "eyeclose5", "mayuw", "mouthhe", "mouthc", "mouthi", "mouthuphalf",
         "tangopen",
         "namida", "tear1", "tear2", "tear3", "shock", "yodare", "hoho", "hoho2", "hohos", "hohol",
-        "toothoff", "nosefook",
+        "toothoff", "nosefook"
     };
 
     public static readonly string[] MpnAttachProps =
@@ -25,7 +25,7 @@ public static class MMConstants
         /* "", "", "", "", "", "", "", "", "", */
         "kousokuu_tekaseone_i_.menu", "kousokuu_tekasetwo_i_.menu", "kousokul_ashikaseup_i_.menu",
         "kousokuu_tekasetwo_i_.menu", "kousokul_ashikasedown_i_.menu", "kousokuu_tekasetwodown_i_.menu",
-        "kousokuu_ushirode_i_.menu", "kousokuu_smroom_haritsuke_i_.menu",
+        "kousokuu_ushirode_i_.menu", "kousokuu_smroom_haritsuke_i_.menu"
     };
 
     private static Dictionary<string, PlacementData.Data>? myrAssetNameToData;

+ 14 - 25
src/MeidoPhotoStudio.Converter/MultipleMaids/MMSceneConverter.cs

@@ -76,9 +76,7 @@ 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()
         {
@@ -214,9 +212,7 @@ 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)
@@ -327,7 +323,6 @@ 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 hairGravityActive = softG != MMConstants.DefaultSoftG;
 
             writer.Write(hairGravityActive);
@@ -390,9 +385,8 @@ public static class MMSceneConverter
 
             cameraDistance = float.Parse(strArray3[30]);
 
-            cameraRotation = Quaternion.Euler(
-                float.Parse(strArray3[31]), float.Parse(strArray3[32]), float.Parse(strArray3[33])
-            );
+            cameraRotation =
+                Quaternion.Euler(float.Parse(strArray3[31]), float.Parse(strArray3[32]), float.Parse(strArray3[33]));
         }
 
         Serialization.Get<CameraInfo>().Serialize(
@@ -445,9 +439,8 @@ public static class MMSceneConverter
                 SpotAngle = spotAngle,
                 Range = spotAngle / 5f,
                 ShadowStrength = strArray4 is null ? 0.098f : float.Parse(strArray4[0]),
-                LightColour = new(
-                    float.Parse(strArray3[18]), float.Parse(strArray3[19]), float.Parse(strArray3[20]), 1f
-                ),
+                LightColour =
+                    new(float.Parse(strArray3[18]), float.Parse(strArray3[19]), float.Parse(strArray3[20]), 1f),
             };
 
             var lightType = int.Parse(strArray3[17]);
@@ -496,9 +489,7 @@ public static class MMSceneConverter
         for (var i = 0; i < strArray5.Length - 1; i++)
         {
             var lightProperties = strArray5[i].Split(',');
-
             var spotAngle = float.Parse(lightProperties[7]);
-
             var lightProperty = new LightProperty
             {
                 Rotation = Quaternion.Euler(float.Parse(lightProperties[4]), float.Parse(lightProperties[5]), 18f),
@@ -678,14 +669,13 @@ public static class MMSceneConverter
             {
                 TransformDTO = new()
                 {
-                    Position = new(
-                        float.Parse(strArray3[41]), float.Parse(strArray3[42]), float.Parse(strArray3[43])
-                    ),
+                    Position =
+                        new(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]),
@@ -710,9 +700,8 @@ public static class MMSceneConverter
                 PropInfo = propInfo,
                 TransformDTO = new()
                 {
-                    Position = new(
-                        float.Parse(assetParts[4]), float.Parse(assetParts[5]), float.Parse(assetParts[6])
-                    ),
+                    Position =
+                        new(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])
                     ),
@@ -775,7 +764,7 @@ public static class MMSceneConverter
                     // ex. 'Pancakes                    #odogu_pancake'
                     return new(PropInfo.PropType.Odogu)
                     {
-                        Filename = asset.Split('#')[1]
+                        Filename = asset.Split('#')[1],
                     };
                 }
 

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

@@ -11,7 +11,6 @@ internal static class PngUtility
     public static byte[]? ExtractPng(Stream stream)
     {
         var memoryStream = new MemoryStream();
-
         var headerBuffer = new byte[PngHeader.Length];
 
         stream.Read(headerBuffer, 0, headerBuffer.Length);

+ 192 - 177
src/MeidoPhotoStudio.Plugin/Constants.cs

@@ -94,9 +94,8 @@ public static class Constants
         kankyoPath = Path.Combine(configPath, kankyoDirectory);
         databasePath = Path.Combine(configPath, databaseDirectory);
 
-        var directories = new[] {
-            customPosePath, customHandPath, scenesPath, kankyoPath, configPath, customFacePath, databasePath
-        };
+        var directories =
+            new[] { customPosePath, customHandPath, scenesPath, kankyoPath, configPath, customFacePath, databasePath };
 
         foreach (var directory in directories)
             if (!Directory.Exists(directory))
@@ -268,9 +267,11 @@ 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"),
+        var finalXml = new XDocument(
+            new XDeclaration("1.0", "utf-8", "true"),
             new XComment("CM3D2 FingerData"),
-            new XElement("FingerData",
+            new XElement(
+                "FingerData",
                 new XElement("GameVersion", gameVersion),
                 new XElement("RightData", right),
                 new XElement("BinaryData", Convert.ToBase64String(handBinary))
@@ -324,15 +325,6 @@ public static class Constants
 
     public static void InitializePoses()
     {
-        static void AddDefaultPose()
-        {
-            if (!PoseDict.ContainsKey("normal"))
-                PoseDict["normal"] = new() { "maid_stand01" };
-
-            if (!PoseGroupList.Contains("normal"))
-                PoseGroupList.Insert(0, "normal");
-        }
-
         // Load Poses
         var poseListPath = Path.Combine(databasePath, "mm_pose_list.json");
 
@@ -377,29 +369,29 @@ public static class Constants
             // TODO: Try to group these poses into more than "normal2" and "ero2"
             foreach (var path in com3d2MotionList)
             {
-                if (Path.GetExtension(path) is ".anm")
-                {
-                    var file = Path.GetFileNameWithoutExtension(path);
+                if (Path.GetExtension(path) is not ".anm")
+                    continue;
 
-                    if (!poseSet.Contains(file))
-                    {
-                        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_")
-                        )
-                        {
-                            if (path.Contains(@"\sex\"))
-                                PoseDict["ero2"].Add(file);
-                            else
-                                PoseDict["normal2"].Add(file);
-                        }
-                    }
+                var file = Path.GetFileNameWithoutExtension(path);
+
+                if (poseSet.Contains(file))
+                    continue;
+
+                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_")
+                )
+                {
+                    if (path.Contains(@"\sex\"))
+                        PoseDict["ero2"].Add(file);
+                    else
+                        PoseDict["normal2"].Add(file);
                 }
             }
 
@@ -416,27 +408,19 @@ public static class Constants
         }
 
         InitializeCustomPoses();
-    }
 
-    public static void InitializeCustomPoses()
-    {
-        static void GetPoses(string directory)
+        static void AddDefaultPose()
         {
-            var poseList = Directory.GetFiles(directory)
-                .Where(file => Path.GetExtension(file) is ".anm");
-
-            if (poseList.Any())
-            {
-                var poseGroupName = new DirectoryInfo(directory).Name;
-
-                if (poseGroupName != customPoseDirectory)
-                    CustomPoseGroupList.Add(poseGroupName);
+            if (!PoseDict.ContainsKey("normal"))
+                PoseDict["normal"] = new() { "maid_stand01" };
 
-                CustomPoseDict[poseGroupName] = poseList.ToList();
-                CustomPoseDict[poseGroupName].Sort(WindowsLogicalComparer.StrCmpLogicalW);
-            }
+            if (!PoseGroupList.Contains("normal"))
+                PoseGroupList.Insert(0, "normal");
         }
+    }
 
+    public static void InitializeCustomPoses()
+    {
         CustomPoseGroupList.Clear();
         CustomPoseDict.Clear();
 
@@ -451,26 +435,27 @@ public static class Constants
         CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, customPoseDirectory));
 
         CustomPoseChange?.Invoke(null, PresetChangeEventArgs.Empty);
-    }
 
-    public static void InitializeHandPresets()
-    {
-        static void GetPresets(string directory)
+        static void GetPoses(string directory)
         {
-            var presetList = Directory.GetFiles(directory)
-                .Where(file => Path.GetExtension(file) is ".xml");
+            var poseList = Directory.GetFiles(directory)
+                .Where(file => Path.GetExtension(file) is ".anm");
 
-            if (presetList.Any())
+            if (poseList.Any())
             {
-                var presetCategory = new DirectoryInfo(directory).Name;
+                var poseGroupName = new DirectoryInfo(directory).Name;
 
-                if (presetCategory != customHandDirectory)
-                    CustomHandGroupList.Add(presetCategory);
+                if (poseGroupName != customPoseDirectory)
+                    CustomPoseGroupList.Add(poseGroupName);
 
-                CustomHandDict[presetCategory] = presetList.ToList();
-                CustomHandDict[presetCategory].Sort(WindowsLogicalComparer.StrCmpLogicalW);
+                CustomPoseDict[poseGroupName] = poseList.ToList();
+                CustomPoseDict[poseGroupName].Sort(WindowsLogicalComparer.StrCmpLogicalW);
             }
         }
+    }
+
+    public static void InitializeHandPresets()
+    {
 
         CustomHandGroupList.Clear();
         CustomHandDict.Clear();
@@ -486,6 +471,23 @@ public static class Constants
         CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, customHandDirectory));
 
         CustomHandChange?.Invoke(null, PresetChangeEventArgs.Empty);
+
+        static void GetPresets(string directory)
+        {
+            var presetList = Directory.GetFiles(directory)
+                .Where(file => Path.GetExtension(file) is ".xml");
+
+            if (!presetList.Any())
+                return;
+
+            var presetCategory = new DirectoryInfo(directory).Name;
+
+            if (presetCategory != customHandDirectory)
+                CustomHandGroupList.Add(presetCategory);
+
+            CustomHandDict[presetCategory] = presetList.ToList();
+            CustomHandDict[presetCategory].Sort(WindowsLogicalComparer.StrCmpLogicalW);
+        }
     }
 
     public static void InitializeFaceBlends()
@@ -502,6 +504,21 @@ public static class Constants
 
     public static void InitializeCustomFaceBlends()
     {
+        CustomFaceGroupList.Clear();
+        CustomFaceDict.Clear();
+
+        CustomFaceGroupList.Add(customFaceDirectory);
+        CustomFaceDict[customFaceDirectory] = new();
+
+        GetFacePresets(customFacePath);
+
+        foreach (var directory in Directory.GetDirectories(customFacePath))
+            GetFacePresets(directory);
+
+        CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
+
+        CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
+
         static void GetFacePresets(string directory)
         {
             IEnumerable<string> presetList = Directory.GetFiles(directory)
@@ -518,21 +535,6 @@ public static class Constants
                 CustomFaceDict[faceGroupName].Sort(WindowsLogicalComparer.StrCmpLogicalW);
             }
         }
-
-        CustomFaceGroupList.Clear();
-        CustomFaceDict.Clear();
-
-        CustomFaceGroupList.Add(customFaceDirectory);
-        CustomFaceDict[customFaceDirectory] = new();
-
-        GetFacePresets(customFacePath);
-
-        foreach (var directory in Directory.GetDirectories(customFacePath))
-            GetFacePresets(directory);
-
-        CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
-
-        CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
     }
 
     public static void InitializeBGs()
@@ -543,12 +545,12 @@ public static class Constants
         // COM3D2 BGs
         foreach (var bgData in PhotoBGData.data)
         {
-            if (!string.IsNullOrEmpty(bgData.create_prefab_name))
-            {
-                var bg = bgData.create_prefab_name;
+            if (string.IsNullOrEmpty(bgData.create_prefab_name))
+                continue;
 
-                BGList.Add(bg);
-            }
+            var bg = bgData.create_prefab_name;
+
+            BGList.Add(bg);
         }
 
         // CM3D2 BGs
@@ -558,12 +560,12 @@ public static class Constants
 
             for (var cell_y = 1; cell_y < csvParser.max_cell_y; cell_y++)
             {
-                if (csvParser.IsCellToExistData(3, cell_y))
-                {
-                    var bg = csvParser.GetCellAsString(3, cell_y);
+                if (!csvParser.IsCellToExistData(3, cell_y))
+                    continue;
 
-                    BGList.Add(bg);
-                }
+                var bg = csvParser.GetCellAsString(3, cell_y);
+
+                BGList.Add(bg);
             }
         }
 
@@ -603,6 +605,7 @@ public static class Constants
         if (!PropManager.ModItemsOnly && !MenuFilesReady)
         {
             Utility.LogMessage("Menu files are not ready yet");
+
             return null;
         }
 
@@ -630,37 +633,39 @@ public static class Constants
 
             selectedList.RemoveAll(item =>
             {
-                if (item.Icon == null)
+                if (item.Icon != null)
+                    return false;
+
+                Texture2D icon;
+                var iconFile = item.IconFile;
+
+                if (string.IsNullOrEmpty(iconFile))
                 {
-                    Texture2D icon;
-                    var iconFile = item.IconFile;
+                    Utility.LogWarning($"Could not find icon '{iconFile}' for menu '{item.MenuFile}");
 
-                    if (string.IsNullOrEmpty(iconFile))
-                    {
-                        Utility.LogWarning($"Could not find icon '{iconFile}' for menu '{item.MenuFile}");
-                        return true;
-                    }
+                    return true;
+                }
 
+                try
+                {
+                    icon = ImportCM.CreateTexture(iconFile);
+                }
+                catch
+                {
                     try
                     {
-                        icon = ImportCM.CreateTexture(iconFile);
+                        icon = ImportCM.CreateTexture($"tex\\{iconFile}");
                     }
                     catch
                     {
-                        try
-                        {
-                            icon = ImportCM.CreateTexture($"tex\\{iconFile}");
-                        }
-                        catch
-                        {
-                            Utility.LogWarning($"Could not load '{iconFile}' for menu '{item.MenuFile}");
-                            return true;
-                        }
-                    }
+                        Utility.LogWarning($"Could not load '{iconFile}' for menu '{item.MenuFile}");
 
-                    item.Icon = icon;
+                        return true;
+                    }
                 }
 
+                item.Icon = icon;
+
                 return false;
             });
         }
@@ -671,11 +676,14 @@ 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"
-        });
+        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"
+            }
+        );
 
         var DoguList = DoguDict[customDoguCategories[DoguCategory.Other]];
 
@@ -703,16 +711,16 @@ public static class Constants
 
         foreach (var path in GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile))
         {
-            if (Path.GetExtension(path) is ".asset_bg" && !path.Contains("myroomcustomize"))
-            {
-                var file = Path.GetFileNameWithoutExtension(path);
+            if (Path.GetExtension(path) is not ".asset_bg" || path.Contains("myroomcustomize"))
+                continue;
 
-                if (!doguHashSet.Contains(file) && !file.EndsWith("_hit"))
-                {
-                    DoguList.Add(file);
-                    doguHashSet.Add(file);
-                }
-            }
+            var file = Path.GetFileNameWithoutExtension(path);
+
+            if (doguHashSet.Contains(file) || file.EndsWith("_hit"))
+                continue;
+
+            DoguList.Add(file);
+            doguHashSet.Add(file);
         }
 
         // Get cherry picked dogu that I can't find in the game files
@@ -734,13 +742,13 @@ public static class Constants
 
         foreach (var path in GameUty.FileSystemOld.GetList("bg", AFileSystemBase.ListType.AllFile))
         {
-            if (Path.GetExtension(path) is ".asset_bg")
-            {
-                var file = Path.GetFileNameWithoutExtension(path);
+            if (Path.GetExtension(path) is not ".asset_bg")
+                continue;
 
-                if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
-                    DoguList.Add(file);
-            }
+            var file = Path.GetFileNameWithoutExtension(path);
+
+            if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
+                DoguList.Add(file);
         }
     }
 
@@ -751,6 +759,7 @@ public static class Constants
         CsvCommonIdManager.ReadEnabledIdList(
             CsvCommonIdManager.FileSystemType.Normal, true, "desk_item_enabled_id", ref enabledIDs
         );
+
         CsvCommonIdManager.ReadEnabledIdList(
             CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
         );
@@ -763,23 +772,23 @@ public static class Constants
 
             for (var cell_y = 1; cell_y < csvParser.max_cell_y; cell_y++)
             {
-                if (csvParser.IsCellToExistData(0, cell_y))
-                {
-                    var cell = csvParser.GetCellAsInteger(0, cell_y);
+                if (!csvParser.IsCellToExistData(0, cell_y))
+                    continue;
 
-                    if (enabledIDs.Contains(cell))
-                    {
-                        var dogu = string.Empty;
+                var cell = csvParser.GetCellAsInteger(0, cell_y);
 
-                        if (csvParser.IsCellToExistData(3, cell_y))
-                            dogu = csvParser.GetCellAsString(3, cell_y);
-                        else if (csvParser.IsCellToExistData(4, cell_y))
-                            dogu = csvParser.GetCellAsString(4, cell_y);
+                if (!enabledIDs.Contains(cell))
+                    continue;
 
-                        if (!string.IsNullOrEmpty(dogu))
-                            com3d2DeskDogu.Add(dogu);
-                    }
-                }
+                var dogu = string.Empty;
+
+                if (csvParser.IsCellToExistData(3, cell_y))
+                    dogu = csvParser.GetCellAsString(3, cell_y);
+                else if (csvParser.IsCellToExistData(4, cell_y))
+                    dogu = csvParser.GetCellAsString(4, cell_y);
+
+                if (!string.IsNullOrEmpty(dogu))
+                    com3d2DeskDogu.Add(dogu);
             }
         }
 
@@ -821,10 +830,13 @@ public static class Constants
                 DoguDict[category].Add(dogu);
         }
 
-        DoguDict["パーティクル"].AddRange(new[] {
-            "Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
-            "Particle/pLine_act2", "Particle/pstarY_act2"
-        });
+        DoguDict["パーティクル"].AddRange(
+            new[]
+            {
+                "Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
+                "Particle/pLine_act2", "Particle/pstarY_act2"
+            }
+        );
     }
 
     private static void InitializeHandItems()
@@ -874,26 +886,26 @@ public static class Constants
         {
             menuDataBase.SetIndex(i);
 
-            if ((MPN)menuDataBase.GetCategoryMpn() is MPN.handitem)
-            {
-                var menuFileName = menuDataBase.GetMenuFileName();
+            if ((MPN)menuDataBase.GetCategoryMpn() is not MPN.handitem)
+                continue;
 
-                if (menuDataBase.GetBoDelOnly() || menuFileName.EndsWith("_del.menu"))
-                    continue;
+            var menuFileName = menuDataBase.GetMenuFileName();
 
-                var handItemAsOdogu = Utility.HandItemToOdogu(menuFileName);
-                var isolatedHandItem = menuFileName.Substring(menuFileName.IndexOf('_') + 1);
+            if (menuDataBase.GetBoDelOnly() || menuFileName.EndsWith("_del.menu"))
+                continue;
 
-                if (!doguHashSet.Contains(handItemAsOdogu) && !doguHashSet.Contains(isolatedHandItem))
-                {
-                    doguHashSet.Add(isolatedHandItem);
-                    DoguDict[category].Add(menuFileName);
+            var handItemAsOdogu = Utility.HandItemToOdogu(menuFileName);
+            var isolatedHandItem = menuFileName.Substring(menuFileName.IndexOf('_') + 1);
 
-                    // Check for a half deck of cards to add the full deck as well
-                    if (menuFileName is "handitemd_cards_i_.menu")
-                        DoguDict[category].Add("handiteml_cards_i_.menu");
-                }
-            }
+            if (doguHashSet.Contains(handItemAsOdogu) || doguHashSet.Contains(isolatedHandItem))
+                continue;
+
+            doguHashSet.Add(isolatedHandItem);
+            DoguDict[category].Add(menuFileName);
+
+            // Check for a half deck of cards to add the full deck as well
+            if (menuFileName is "handitemd_cards_i_.menu")
+                DoguDict[category].Add("handiteml_cards_i_.menu");
         }
 
         HandItemsInitialized = true;
@@ -947,14 +959,15 @@ public static class Constants
         var myRoomData = PlacementData.GetAllDatas(false);
 
         myRoomData.Sort((a, b) =>
-                {
-                    var res = a.categoryID.CompareTo(b.categoryID);
+            {
+                var res = a.categoryID.CompareTo(b.categoryID);
 
-                    if (res is 0)
-                        res = a.ID.CompareTo(b.ID);
+                if (res is 0)
+                    res = a.ID.CompareTo(b.ID);
 
-                    return res;
-                });
+                return res;
+            }
+        );
 
         foreach (var data in myRoomData)
         {
@@ -1030,16 +1043,18 @@ public static class Constants
     {
         try
         {
-            if (fs.IsExistentFile(nei))
-            {
-                var file = fs.FileOpen(nei);
-                var csvParser = new CsvParser();
+            if (!fs.IsExistentFile(nei))
+                return null;
 
-                if (csvParser.Open(file))
-                    return csvParser;
+            var file = fs.FileOpen(nei);
+            var csvParser = new CsvParser();
 
-                file?.Dispose();
-            }
+            if (csvParser.Open(file))
+                return csvParser;
+
+            file?.Dispose();
+
+            return null;
         }
         catch { }
 

+ 11 - 17
src/MeidoPhotoStudio.Plugin/DragPoint/DragPoint.cs

@@ -7,10 +7,7 @@ namespace MeidoPhotoStudio.Plugin;
 
 public abstract class DragPoint : MonoBehaviour
 {
-    public enum DragType
-    {
-        None, Ignore, Select, Delete, MoveXZ, MoveY, RotLocalXZ, RotY, RotLocalY, Scale
-    }
+    public enum DragType { None, Ignore, Select, Delete, MoveXZ, MoveY, RotLocalXZ, RotY, RotLocalY, Scale }
 
     public const float defaultAlpha = 0.75f;
 
@@ -101,13 +98,13 @@ public abstract class DragPoint : MonoBehaviour
         get => currentDragType;
         set
         {
-            if (value != oldDragType)
-            {
-                currentDragType = value;
-                reinitializeDrag = true;
-                oldDragType = currentDragType;
-                ApplyDragType();
-            }
+            if (value == oldDragType)
+                return;
+
+            currentDragType = value;
+            reinitializeDrag = true;
+            oldDragType = currentDragType;
+            ApplyDragType();
         }
     }
 
@@ -159,9 +156,7 @@ 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();
 
@@ -210,9 +205,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)
-        );
+        startOffset =
+            transform.position - camera.ScreenToWorldPoint(new(startMousePosition.x, startMousePosition.y, screenPoint.z));
         newOffset = transform.position - MyObject.position;
     }
 

+ 6 - 3
src/MeidoPhotoStudio.Plugin/DragPoint/DragPointGeneral.cs

@@ -147,14 +147,14 @@ public abstract class DragPointGeneral : DragPoint
         if (CurrentDragType is DragType.MoveXZ)
         {
             MyObject.position = new(cursorPosition.x, MyObject.position.y, cursorPosition.z);
+
             OnMove();
         }
 
         if (CurrentDragType is DragType.MoveY)
         {
-            MyObject.position = new(
-                MyObject.position.x, cursorPosition.y, MyObject.position.z
-            );
+            MyObject.position = new(MyObject.position.x, cursorPosition.y, MyObject.position.z);
+
             OnMove();
         }
 
@@ -176,6 +176,7 @@ public abstract class DragPointGeneral : DragPoint
             right.y = 0f;
             MyObject.Rotate(forward, -mouseDelta.x / 6f, Space.World);
             MyObject.Rotate(right, mouseDelta.y / 4f, Space.World);
+
             OnRotate();
         }
 
@@ -183,6 +184,7 @@ public abstract class DragPointGeneral : DragPoint
         {
             MyObject.rotation = currentRotation;
             MyObject.Rotate(Vector3.up * -mouseDelta.x / 2.2f);
+
             OnRotate();
         }
 
@@ -196,6 +198,7 @@ public abstract class DragPointGeneral : DragPoint
                 scale = 0f;
 
             MyObject.localScale = new(scale, scale, scale);
+
             OnScale();
         }
     }

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

@@ -94,13 +94,13 @@ public class DragPointGravity : DragPointGeneral
 
     private void OnEnable()
     {
-        if (Control)
-        {
-            // TODO: WTF?
-            Control.isEnabled = true;
+        if (!Control)
+            return;
 
-            if (!Control.isEnabled)
-                gameObject.SetActive(false);
-        }
+        // TODO: WTF?
+        Control.isEnabled = true;
+
+        if (!Control.isEnabled)
+            gameObject.SetActive(false);
     }
 }

+ 3 - 7
src/MeidoPhotoStudio.Plugin/DragPoint/DragPointProp.cs

@@ -32,9 +32,7 @@ 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;
@@ -43,10 +41,8 @@ public class DragPointProp : DragPointGeneral
         MyObject.transform.SetParent(attachPoint, keepWorldPosition);
 
         if (keepWorldPosition)
-        {
             // TODO: Use transform.SetPositionAndRotation MyObject.position = position;
             MyObject.rotation = rotation;
-        }
         else
         {
             MyObject.localPosition = Vector3.zero;
@@ -110,14 +106,14 @@ public class PropInfo
         new(PropType.Mod)
         {
             Filename = modItem.IsOfficialMod ? Path.GetFileName(modItem.MenuFile) : modItem.MenuFile,
-            SubFilename = modItem.BaseMenuFile
+            SubFilename = modItem.BaseMenuFile,
         };
 
     public static PropInfo FromMyRoom(MyRoomItem myRoomItem) =>
         new(PropType.MyRoom)
         {
             MyRoomID = myRoomItem.ID,
-            Filename = myRoomItem.PrefabName
+            Filename = myRoomItem.PrefabName,
         };
 
     public static PropInfo FromBg(string name) =>

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

@@ -116,9 +116,7 @@ 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
-        );
+        var clicked = GUILayout.Button(isMenu ? label : DropdownList[selectedItemIndex], buttonStyle, layoutOptions);
 
         if (clicked)
         {
@@ -386,9 +384,8 @@ 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
@@ -396,8 +393,7 @@ 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;

+ 1 - 3
src/MeidoPhotoStudio.Plugin/GUI/Controls/KeyRebindButton.cs

@@ -52,9 +52,7 @@ public class KeyRebindButton : BaseControl
     {
         listening = false;
 
-        KeyCode = InputManager.CurrentKeyCode is not KeyCode.Escape
-            ? InputManager.CurrentKeyCode
-            : KeyCode;
+        KeyCode = InputManager.CurrentKeyCode is not KeyCode.Escape ? InputManager.CurrentKeyCode : KeyCode;
 
         InputManager.KeyChange -= KeyChange;
 

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

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

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

@@ -67,7 +67,7 @@ public class SelectionGrid : BaseControl
         {
             var toggle = new SimpleToggle(items[i], i == SelectedItemIndex)
             {
-                toggleIndex = i
+                toggleIndex = i,
             };
 
             toggle.ControlEvent += (s, a) =>

+ 2 - 3
src/MeidoPhotoStudio.Plugin/GUI/Controls/Slider.cs

@@ -133,9 +133,8 @@ public class Slider : BaseControl
 
         var sliderStyle = hasUpper ? MpsGui.SliderStyle : MpsGui.SliderStyleNoLabel;
 
-        var tempValue = GUILayout.HorizontalSlider(
-                Value, Left, Right, sliderStyle, MpsGui.SliderThumbStyle, layoutOptions
-                );
+        var tempValue =
+            GUILayout.HorizontalSlider(Value, Left, Right, sliderStyle, MpsGui.SliderThumbStyle, layoutOptions);
 
         if (hasUpper)
             GUILayout.EndVertical();

+ 4 - 7
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindow2Panes/ModPropsPane.cs

@@ -44,9 +44,7 @@ public class ModPropsPane : BasePane
             MenuFilesReadyChange += (s, a) =>
             {
                 modItemsReady = true;
-                propCategoryDropdown.SetDropdownItems(
-                    Translation.GetArray("clothing", MenuCategories)
-                );
+                propCategoryDropdown.SetDropdownItems(Translation.GetArray("clothing", MenuCategories));
             };
         }
 
@@ -75,7 +73,8 @@ public class ModPropsPane : BasePane
 
         var dropdownButtonWidth = isModsOnly ? 120f : 90f;
 
-        var dropdownLayoutOptions = new[] {
+        var dropdownLayoutOptions = new[]
+        {
             GUILayout.Height(dropdownButtonHeight),
             GUILayout.Width(dropdownButtonWidth),
         };
@@ -112,9 +111,7 @@ public class ModPropsPane : BasePane
 
             var buttonSize = windowWidth / columns - 10f;
 
-            var positionRect = new Rect(
-                5f, offsetTop + dropdownButtonHeight, windowWidth - 10f, windowHeight - 145f
-            );
+            var positionRect = new Rect(5f, offsetTop + dropdownButtonHeight, windowWidth - 10f, windowHeight - 145f);
 
             var viewRect = new Rect(
                 0f, 0f, buttonSize * columns, buttonSize * Mathf.Ceil(currentListCount / (float)columns) + 5

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

@@ -30,7 +30,8 @@ public class MyRoomPropsPane : BasePane
         const float dropdownButtonHeight = 30f;
         const float dropdownButtonWidth = 120f;
 
-        var dropdownLayoutOptions = new[] {
+        var dropdownLayoutOptions = new[]
+        {
             GUILayout.Height(dropdownButtonHeight),
             GUILayout.Width(dropdownButtonWidth),
         };

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

@@ -93,14 +93,16 @@ public class PropManagerPane : BasePane
     {
         const float buttonHeight = 30;
 
-        var arrowLayoutOptions = new[] {
+        var arrowLayoutOptions = new[]
+        {
             GUILayout.Width(buttonHeight),
             GUILayout.Height(buttonHeight),
         };
 
         const float dropdownButtonWidth = 140f;
 
-        var dropdownLayoutOptions = new[] {
+        var dropdownLayoutOptions = new[]
+        {
             GUILayout.Height(buttonHeight),
             GUILayout.Width(dropdownButtonWidth),
         };

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

@@ -59,14 +59,16 @@ public class PropsPane : BasePane
     {
         const float buttonHeight = 30;
 
-        var arrowLayoutOptions = new[] {
+        var arrowLayoutOptions = new[]
+        {
             GUILayout.Width(buttonHeight),
             GUILayout.Height(buttonHeight),
         };
 
         const float dropdownButtonWidth = 120f;
 
-        var dropdownLayoutOptions = new[] {
+        var dropdownLayoutOptions = new[]
+        {
             GUILayout.Height(buttonHeight),
             GUILayout.Width(dropdownButtonWidth),
         };

+ 6 - 4
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/BackgroundSelectorPane.cs

@@ -36,16 +36,18 @@ public class BackgroundSelectorPane : BasePane
     {
         const float buttonHeight = 30;
 
-        var arrowLayoutOptions = new[] {
+        var arrowLayoutOptions = new[]
+        {
             GUILayout.Width(buttonHeight),
-                GUILayout.Height(buttonHeight)
+            GUILayout.Height(buttonHeight),
         };
 
         const float dropdownButtonWidth = 153f;
 
-        var dropdownLayoutOptions = new[] {
+        var dropdownLayoutOptions = new[]
+        {
             GUILayout.Height(buttonHeight),
-                GUILayout.Width(dropdownButtonWidth)
+            GUILayout.Width(dropdownButtonWidth),
         };
 
         GUILayout.BeginHorizontal();

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

@@ -23,7 +23,7 @@ public class CameraPane : BasePane
         zRotationSlider = new(Translation.Get("cameraPane", "zRotation"), 0f, 360f, eulerAngles.z)
         {
             HasReset = true,
-            HasTextField = true
+            HasTextField = true,
         };
 
         zRotationSlider.ControlEvent += (s, a) =>
@@ -42,7 +42,7 @@ public class CameraPane : BasePane
         fovSlider = new(Translation.Get("cameraPane", "fov"), 20f, 150f, fieldOfView, fieldOfView)
         {
             HasReset = true,
-            HasTextField = true
+            HasTextField = true,
         };
 
         fovSlider.ControlEvent += (s, a) =>

+ 4 - 0
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/DragPointPane.cs

@@ -58,17 +58,21 @@ public class DragPointPane : BasePane
         {
             case Setting.Prop:
                 PropManager.CubeActive = value;
+
                 break;
             case Setting.Background:
                 EnvironmentManager.CubeActive = value;
+
                 break;
             case Setting.Maid:
                 MeidoDragPointManager.CubeActive = value;
+
                 break;
             case Setting.Size:
                 MeidoDragPointManager.CubeSmall = value;
                 EnvironmentManager.CubeSmall = value;
                 PropManager.CubeSmall = value;
+
                 break;
             default:
                 break;

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

@@ -42,9 +42,8 @@ public class BloomPane : EffectPane<BloomEffectManager>
             EffectManager.BloomThresholdColorRed = redSlider.Value;
         };
 
-        greenSlider = new(
-            Translation.Get("backgroundWindow", "green"), 1f, 0.5f, EffectManager.BloomThresholdColorGreen
-        );
+        greenSlider =
+            new(Translation.Get("backgroundWindow", "green"), 1f, 0.5f, EffectManager.BloomThresholdColorGreen);
 
         greenSlider.ControlEvent += (s, a) =>
         {

+ 2 - 3
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/EffectsPanes/DepthOfFieldPane.cs

@@ -14,9 +14,8 @@ public class DepthOfFieldPane : EffectPane<DepthOfFieldEffectManager>
 
     public DepthOfFieldPane(EffectManager effectManager) : base(effectManager)
     {
-        focalLengthSlider = new(
-            Translation.Get("effectDof", "focalLength"), 0f, 10f, EffectManager.FocalLength
-        );
+        focalLengthSlider =
+            new(Translation.Get("effectDof", "focalLength"), 0f, 10f, EffectManager.FocalLength);
 
         focalLengthSlider.ControlEvent += (s, a) =>
         {

+ 8 - 7
src/MeidoPhotoStudio.Plugin/GUI/Panes/BackgroundWindowPanes/LightsPane.cs

@@ -10,7 +10,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 = {
+    private static readonly string[,] sliderNames =
+    {
         { "lights", "x" }, { "lights", "y" }, { "lights", "intensity" }, { "lights", "shadow" }, { "lights", "spot" },
         { "lights", "range" }, { "backgroundWindow", "red" }, { "backgroundWindow", "green" },
         { "backgroundWindow", "blue" }
@@ -88,7 +89,7 @@ public class LightsPane : BasePane
             var slider = new Slider(Translation.Get(sliderNames[i, 0], sliderNames[i, 1]), sliderProp)
             {
                 HasTextField = true,
-                HasReset = true
+                HasReset = true,
             };
 
             if (lightProp <= LightProp.LightRotY)
@@ -136,7 +137,7 @@ public class LightsPane : BasePane
 
     public override void Draw()
     {
-        var isMain = lightManager.SelectedLightIndex == 0;
+        var isMain = lightManager.SelectedLightIndex is 0;
 
         var noExpandWidth = GUILayout.ExpandWidth(false);
 
@@ -166,14 +167,14 @@ public class LightsPane : BasePane
             disableToggle.Draw();
         }
 
-        if (lightManager.SelectedLightIndex == 0 && currentLightType == MPSLightType.Normal)
+        if (lightManager.SelectedLightIndex is 0 && currentLightType is MPSLightType.Normal)
             colorToggle.Draw();
 
         GUILayout.EndHorizontal();
 
         GUI.enabled = !isDisabled;
 
-        if (currentLightType != MPSLightType.Point)
+        if (currentLightType is not MPSLightType.Point)
         {
             lightSlider[LightProp.LightRotX].Draw();
             lightSlider[LightProp.LightRotY].Draw();
@@ -181,12 +182,12 @@ public class LightsPane : BasePane
 
         lightSlider[LightProp.Intensity].Draw();
 
-        if (currentLightType == MPSLightType.Normal)
+        if (currentLightType is MPSLightType.Normal)
             lightSlider[LightProp.ShadowStrength].Draw();
         else
             lightSlider[LightProp.Range].Draw();
 
-        if (currentLightType == MPSLightType.Spot)
+        if (currentLightType is MPSLightType.Spot)
             lightSlider[LightProp.SpotAngle].Draw();
 
         MpsGui.BlackLine();

+ 6 - 8
src/MeidoPhotoStudio.Plugin/GUI/Panes/CallWindowPanes/MaidSelectorPane.cs

@@ -67,17 +67,13 @@ public class MaidSelectorPane : BasePane
 
         var selectLabelStyle = new GUIStyle(labelStyle)
         {
-            normal = {
-                textColor = Color.black,
-            },
+            normal = { textColor = Color.black },
             alignment = TextAnchor.UpperRight,
         };
 
         var labelSelectedStyle = new GUIStyle(labelStyle)
         {
-            normal = {
-                textColor = Color.black,
-            },
+            normal = { textColor = Color.black },
         };
 
         var windowRect = parent.WindowRect;
@@ -116,8 +112,10 @@ public class MaidSelectorPane : BasePane
             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
             );
         }
 

+ 7 - 12
src/MeidoPhotoStudio.Plugin/GUI/Panes/FaceWindowPanes/MaidFaceBlendPane.cs

@@ -22,14 +22,10 @@ public class MaidFaceBlendPane : BasePane
     private bool faceListEnabled;
 
     private Dictionary<string, List<string>> CurrentFaceDict =>
-        facePresetMode
-            ? Constants.CustomFaceDict
-            : Constants.FaceDict;
+        facePresetMode ? Constants.CustomFaceDict : Constants.FaceDict;
 
     private List<string> CurrentFaceGroupList =>
-        facePresetMode
-            ? Constants.CustomFaceGroupList
-            : Constants.FaceGroupList;
+        facePresetMode ? Constants.CustomFaceGroupList : Constants.FaceGroupList;
 
     private string SelectedFaceGroup =>
         CurrentFaceGroupList[faceBlendCategoryDropdown.SelectedItemIndex];
@@ -65,10 +61,7 @@ public class MaidFaceBlendPane : BasePane
             faceBlendCategoryDropdown.SetDropdownItems(list, 0);
         };
 
-        faceBlendCategoryDropdown = new(
-            Translation.GetArray("faceBlendCategory", Constants.FaceGroupList)
-        );
-
+        faceBlendCategoryDropdown = new(Translation.GetArray("faceBlendCategory", Constants.FaceGroupList));
         faceBlendCategoryDropdown.SelectionChange += (s, a) =>
         {
             faceListEnabled = CurrentFaceList.Count > 0;
@@ -103,14 +96,16 @@ public class MaidFaceBlendPane : BasePane
     {
         const float buttonHeight = 30;
 
-        var arrowLayoutOptions = new[] {
+        var arrowLayoutOptions = new[]
+        {
             GUILayout.Width(buttonHeight),
             GUILayout.Height(buttonHeight),
         };
 
         const float dropdownButtonWidth = 153f;
 
-        var dropdownLayoutOptions = new[] {
+        var dropdownLayoutOptions = new[]
+        {
             GUILayout.Height(buttonHeight),
             GUILayout.Width(dropdownButtonWidth),
         };

+ 2 - 2
src/MeidoPhotoStudio.Plugin/GUI/Panes/FaceWindowPanes/MaidFaceSliderPane.cs

@@ -156,7 +156,7 @@ public class MaidFaceSliderPane : BasePane
 
             toggle.Value = meido.GetFaceBlendValue(hash) > 0f;
 
-            if (hash == "toothoff")
+            if (hash is "toothoff")
                 toggle.Value = !toggle.Value;
         }
 
@@ -238,7 +238,7 @@ public class MaidFaceSliderPane : BasePane
 
     private void SetFaceValue(string key, bool value)
     {
-        if (key == "toothoff")
+        if (key is "toothoff")
             value = !value;
 
         SetFaceValue(key, value ? 1f : 0f);

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

@@ -51,12 +51,12 @@ public class FaceWindowPane : BaseMainWindowPane
         if (!meidoManager.HasActiveMeido)
             return;
 
-        if (ActiveWindow)
-        {
-            meidoManager.ActiveMeido.StopBlink();
+        if (!ActiveWindow)
+            return;
+
+        meidoManager.ActiveMeido.StopBlink();
 
-            base.UpdatePanes();
-        }
+        base.UpdatePanes();
     }
 
     protected override void ReloadTranslation() =>

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

@@ -141,5 +141,4 @@ public class SettingsWindowPane : BaseMainWindowPane
 
         GUILayout.EndHorizontal();
     }
-
 }

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

@@ -47,12 +47,14 @@ public class MaidSwitcherPane : BasePane
             padding = new RectOffset(4, 4, 0, 0),
         };
 
-        var buttonOptions = new[] {
-            GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(false)
+        var buttonOptions = new[]
+        {
+            GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(false),
         };
 
-        var boxLayoutOptions = new[] {
-            GUILayout.Height(boxSize), GUILayout.Width(boxSize)
+        var boxLayoutOptions = new[]
+        {
+            GUILayout.Height(boxSize), GUILayout.Width(boxSize),
         };
 
         GUI.enabled = meidoManager.HasActiveMeido;
@@ -111,9 +113,8 @@ public class MaidSwitcherPane : BasePane
 
     private void ChangeMaid(int dir)
     {
-        var selected = Utility.Wrap(
-            meidoManager.SelectedMeido + (int)Mathf.Sign(dir), 0, meidoManager.ActiveMeidoList.Count
-        );
+        var selected =
+            Utility.Wrap(meidoManager.SelectedMeido + (int)Mathf.Sign(dir), 0, meidoManager.ActiveMeidoList.Count);
 
         meidoManager.ChangeMaid(selected);
     }

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

@@ -131,8 +131,9 @@ public class HandPresetPane : BasePane
         else
         {
             presetCategoryDropdown.SetDropdownItems(
-                    Constants.CustomHandGroupList.ToArray(), Constants.CustomHandGroupList.IndexOf(args.Category)
-                    );
+                Constants.CustomHandGroupList.ToArray(), Constants.CustomHandGroupList.IndexOf(args.Category)
+            );
+
             presetDropdown.SetDropdownItems(UIPresetList(), CurrentPresetList.IndexOf(args.Path));
         }
     }

+ 8 - 8
src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidDressingPane.cs

@@ -145,7 +145,7 @@ public class MaidDressingPane : BasePane
 
         var maskMode = meido.CurrentMaskMode;
 
-        maskModeGrid.SelectedItemIndex = maskMode == MaskMode.Nude ? (int)Mask.Nude : (int)maskMode;
+        maskModeGrid.SelectedItemIndex = maskMode is MaskMode.Nude ? (int)Mask.Nude : (int)maskMode;
 
         updating = false;
     }
@@ -200,7 +200,7 @@ public class MaidDressingPane : BasePane
         {
             var clothingToggle = clothingToggles[slot];
 
-            if (slot == SlotID.headset)
+            if (slot is SlotID.headset)
                 clothingToggle.Label = detailedClothing
                     ? Translation.Get("clothing", "headset")
                     : Translation.Get("clothing", "headwear");
@@ -223,7 +223,7 @@ public class MaidDressingPane : BasePane
         if (updating)
             return;
 
-        if (slot == SlotID.body)
+        if (slot is SlotID.body)
         {
             meidoManager.ActiveMeido.SetBodyMask(enabled);
 
@@ -232,7 +232,7 @@ public class MaidDressingPane : BasePane
 
         var body = meidoManager.ActiveMeido.Maid.body0;
 
-        if (!detailedClothing && slot == SlotID.headset)
+        if (!detailedClothing && slot is SlotID.headset)
         {
             updating = true;
 
@@ -246,10 +246,10 @@ public class MaidDressingPane : BasePane
         }
         else
         {
-            if (slot == SlotID.wear)
+            if (slot is SlotID.wear)
                 foreach (var wearSlot in WearSlots)
                     body.SetMask(wearSlot, enabled);
-            else if (slot == SlotID.megane)
+            else if (slot is SlotID.megane)
             {
                 body.SetMask(SlotID.megane, enabled);
                 body.SetMask(SlotID.accHead, enabled);
@@ -271,9 +271,9 @@ public class MaidDressingPane : BasePane
 
         updating = true;
 
-        if (curl == Curl.Front && curlingBackToggle.Value)
+        if (curl is Curl.Front && curlingBackToggle.Value)
             curlingBackToggle.Value = false;
-        else if (curl == Curl.Back && curlingFrontToggle.Value)
+        else if (curl is Curl.Back && curlingFrontToggle.Value)
             curlingFrontToggle.Value = false;
 
         updating = false;

+ 1 - 1
src/MeidoPhotoStudio.Plugin/GUI/Panes/PoseWindowPanes/MaidFreeLookPane.cs

@@ -51,7 +51,7 @@ public class MaidFaceLookPane : BasePane
 
         var body = meidoManager.ActiveMeido.Body;
 
-        body.offsetLookTarget = new Vector3(lookYSlider.Value, 1f, lookXSlider.Value);
+        body.offsetLookTarget = new(lookYSlider.Value, 1f, lookXSlider.Value);
     }
 
     public void SetBounds()

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

@@ -65,11 +65,11 @@ public class MaidIKPane : BasePane
         if (updating)
             return;
 
-        if (toggle == IKToggle.IK)
+        if (toggle is IKToggle.IK)
             meidoManager.ActiveMeido.IK = value;
-        else if (toggle == IKToggle.Release)
+        else if (toggle is IKToggle.Release)
             meidoManager.ActiveMeido.Stop = false;
-        else if (toggle == IKToggle.Bone)
+        else if (toggle is IKToggle.Bone)
             meidoManager.ActiveMeido.Bone = value;
     }
 }

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

@@ -78,16 +78,18 @@ public class MaidPoseSelectorPane : BasePane
     {
         const float buttonHeight = 30f;
 
-        var arrowLayoutOptions = new[] {
+        var arrowLayoutOptions = new[]
+        {
             GUILayout.Width(buttonHeight),
-                GUILayout.Height(buttonHeight),
+            GUILayout.Height(buttonHeight),
         };
 
         const float dropdownButtonWidth = 153f;
 
-        var dropdownLayoutOptions = new GUILayoutOption[] {
+        var dropdownLayoutOptions = new GUILayoutOption[]
+        {
             GUILayout.Height(buttonHeight),
-                GUILayout.Width(dropdownButtonWidth),
+            GUILayout.Width(dropdownButtonWidth),
         };
 
         GUI.enabled = meidoManager.HasActiveMeido && !meidoManager.ActiveMeido.Stop;
@@ -128,14 +130,14 @@ public class MaidPoseSelectorPane : BasePane
                 poseGroupDropdown.SetDropdownItems(
                     customPoseMode
                         ? CurrentPoseGroupList.ToArray()
-                        : Translation.GetArray("poseGroupDropdown", CurrentPoseGroupList));
+                        : Translation.GetArray("poseGroupDropdown", CurrentPoseGroupList)
+                );
 
             var newPoseGroupIndex = CurrentPoseGroupList.IndexOf(cachedPose.PoseGroup);
 
             if (newPoseGroupIndex < 0)
                 poseGroupDropdown.SelectedItemIndex = 0;
-            else if (oldCustomPoseMode != customPoseMode
-                || poseGroupDropdown.SelectedItemIndex != newPoseGroupIndex)
+            else if (oldCustomPoseMode != customPoseMode || poseGroupDropdown.SelectedItemIndex != newPoseGroupIndex)
             {
                 poseGroupDropdown.SelectedItemIndex = newPoseGroupIndex;
                 poseDropdown.SetDropdownItems(UIPoseList());
@@ -151,10 +153,7 @@ public class MaidPoseSelectorPane : BasePane
             poseDropdown.SelectedItemIndex = newPoseIndex;
             poseListEnabled = CurrentPoseList.Count > 0;
         }
-        catch
-        {
-            // Do nothing
-        }
+        catch { /* ignored */ }
         finally
         {
             updating = false;
@@ -176,7 +175,7 @@ public class MaidPoseSelectorPane : BasePane
     {
         if (args == PresetChangeEventArgs.Empty)
         {
-            if (poseModeGrid.SelectedItemIndex == 1)
+            if (poseModeGrid.SelectedItemIndex is 1)
             {
                 updating = true;
                 poseGroupDropdown.SetDropdownItems(CurrentPoseGroupList.ToArray(), 0);
@@ -204,7 +203,7 @@ public class MaidPoseSelectorPane : BasePane
         if (updating)
             return;
 
-        customPoseMode = poseModeGrid.SelectedItemIndex == 1;
+        customPoseMode = poseModeGrid.SelectedItemIndex is 1;
 
         var list = customPoseMode
             ? CurrentPoseGroupList.ToArray()

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

@@ -81,7 +81,7 @@ public class MpnAttachPropPane : BasePane
 
     private void InitializeMpnAttach(object sender, MenuFilesEventArgs args)
     {
-        if (args.Type == MenuFilesEventArgs.EventType.MpnAttach)
+        if (args.Type is MenuFilesEventArgs.EventType.MpnAttach)
             SetDropdownList();
     }
 

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

@@ -62,7 +62,7 @@ public class SceneManagerScenePane : BasePane
 
             for (var j = 0; j < columns; j++, currentScene++)
             {
-                if (currentScene == -1)
+                if (currentScene is -1)
                     addSceneButton.Draw(addSceneStyle, sceneLayoutOptions);
                 else if (currentScene < sceneManager.SceneList.Count)
                 {

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

@@ -24,13 +24,11 @@ public abstract class BaseWindow : BasePane
         get => windowRect;
         set
         {
-            value.x = Mathf.Clamp(
-                value.x, -value.width + Utility.GetPix(20), Screen.width - Utility.GetPix(20)
-            );
+            value.x =
+                Mathf.Clamp(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 =
+                Mathf.Clamp(value.y, -value.height + Utility.GetPix(20), Screen.height - Utility.GetPix(20));
 
             windowRect = value;
         }

+ 1 - 1
src/MeidoPhotoStudio.Plugin/GUI/Windows/SceneModalWindow.cs

@@ -116,7 +116,7 @@ public class SceneModalWindow : BaseWindow
 
             var labelSize = labelStyle.CalcSize(new GUIContent(infoString));
 
-            labelBox = new Rect(
+            labelBox = new(
                 labelBox.x + 10, labelBox.y + labelBox.height - (labelSize.y + 10), labelSize.x + 10, labelSize.y + 2
             );
 

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

@@ -100,7 +100,7 @@ public class SceneWindow : BaseWindow
 
             var minWidth = Utility.GetPix(
                 SceneManagerDirectoryPane.listWidth + (int)(SceneManager.sceneDimensions.x
-                    * SceneManagerScenePane.thumbnailScale)
+                * SceneManagerScenePane.thumbnailScale)
             );
 
             windowRect.width = Mathf.Max(minWidth, rectWidth);

+ 54 - 16
src/MeidoPhotoStudio.Plugin/MaidPlacementUtility.cs

@@ -8,9 +8,10 @@ public static class MaidPlacementUtility
     private const float pi = Mathf.PI;
     private const float tau = Mathf.PI * 2f;
 
-    public static readonly string[] placementTypes = {
-        "horizontalRow", "verticalRow", "diagonalRow", "diagonalRowInverse", "wave", "waveInverse",
-        "v", "vInverse", "circleInner", "circleOuter", "fanInner", "fanOuter"
+    public static readonly string[] placementTypes =
+    {
+        "horizontalRow", "verticalRow", "diagonalRow", "diagonalRowInverse", "wave", "waveInverse", "v", "vInverse",
+        "circleInner", "circleOuter", "fanInner", "fanOuter"
     };
 
     public static int AlternatingSequence(int x) =>
@@ -20,19 +21,56 @@ public static class MaidPlacementUtility
     {
         switch (placementType)
         {
-            case "horizontalRow": PlacementRow(list, false); break;
-            case "verticalRow": PlacementRow(list, true); break;
-            case "diagonalRow": PlacementDiagonal(list, false); break;
-            case "diagonalRowInverse": PlacementDiagonal(list, true); break;
-            case "wave": PlacementWave(list, false); break;
-            case "waveInverse": PlacementWave(list, true); break;
-            case "v": PlacementV(list, false); break;
-            case "vInverse": PlacementV(list, true); break;
-            case "circleOuter": PlacementCircle(list, false); break;
-            case "circleInner": PlacementCircle(list, true); break;
-            case "fanInner": PlacementFan(list, false); break;
-            case "fanOuter": PlacementFan(list, true); break;
-            default: return;
+            case "horizontalRow":
+                PlacementRow(list, false);
+
+                break;
+            case "verticalRow":
+                PlacementRow(list, true);
+
+                break;
+            case "diagonalRow":
+                PlacementDiagonal(list, false);
+
+                break;
+            case "diagonalRowInverse":
+                PlacementDiagonal(list, true);
+
+                break;
+            case "wave":
+                PlacementWave(list, false);
+
+                break;
+            case "waveInverse":
+                PlacementWave(list, true);
+
+                break;
+            case "v":
+                PlacementV(list, false);
+
+                break;
+            case "vInverse":
+                PlacementV(list, true);
+
+                break;
+            case "circleOuter":
+                PlacementCircle(list, false);
+
+                break;
+            case "circleInner":
+                PlacementCircle(list, true);
+
+                break;
+            case "fanInner":
+                PlacementFan(list, false);
+
+                break;
+            case "fanOuter":
+                PlacementFan(list, true);
+
+                break;
+            default:
+                return;
         }
     }
 

+ 5 - 3
src/MeidoPhotoStudio.Plugin/Managers/CameraManager.cs

@@ -102,9 +102,9 @@ public class CameraManager : IManager
             return;
 
         mainCamera.Reset(CameraMain.CameraType.Target, true);
-        mainCamera.SetTargetPos(new Vector3(0.5609447f, 1.380762f, -1.382336f));
+        mainCamera.SetTargetPos(new(0.5609447f, 1.380762f, -1.382336f));
         mainCamera.SetDistance(1.6f);
-        mainCamera.SetAroundAngle(new Vector2(245.5691f, 6.273283f));
+        mainCamera.SetAroundAngle(new(245.5691f, 6.273283f));
 
         mainCamera.ResetCalcNearClip();
     }
@@ -160,7 +160,7 @@ public class CameraManager : IManager
     private void ResetCamera()
     {
         mainCamera.Reset(CameraMain.CameraType.Target, true);
-        mainCamera.SetTargetPos(new Vector3(0f, 0.9f, 0f));
+        mainCamera.SetTargetPos(new(0f, 0.9f, 0f));
         mainCamera.SetDistance(3f);
         CameraChange?.Invoke(this, EventArgs.Empty);
     }
@@ -176,7 +176,9 @@ public class CameraInfo
     public static CameraInfo FromCamera(CameraMain mainCamera)
     {
         var info = new CameraInfo();
+
         info.UpdateInfo(mainCamera);
+
         return info;
     }
 

+ 1 - 1
src/MeidoPhotoStudio.Plugin/Managers/EnvironmentManager.cs

@@ -100,7 +100,7 @@ public class EnvironmentManager : IManager
             bgMgr.ChangeBg(defaultBg);
         else
         {
-            var isNight = GameMain.Instance.CharacterMgr.status.GetFlag("時間帯") == 3;
+            var isNight = GameMain.Instance.CharacterMgr.status.GetFlag("時間帯") is 3;
 
             bgMgr.ChangeBg(isNight ? "ShinShitsumu_ChairRot_Night" : "ShinShitsumu_ChairRot");
         }

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

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

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

@@ -190,11 +190,11 @@ public class LightManager : IManager
         var theLight = (DragPointLight)sender;
         var select = lightList.FindIndex(light => light == theLight);
 
-        if (select >= 0)
-        {
-            SelectedLightIndex = select;
-            Select?.Invoke(this, EventArgs.Empty);
-        }
+        if (select < 0)
+            return;
+
+        SelectedLightIndex = select;
+        Select?.Invoke(this, EventArgs.Empty);
     }
 
     private void OnListModified() =>

+ 2 - 1
src/MeidoPhotoStudio.Plugin/Managers/MeidoManager.cs

@@ -202,7 +202,8 @@ public class MeidoManager : IManager
             characterMgr.DeactivateMaid(0);
 
         Meidos = characterMgr.GetStockMaidList()
-            .Select((_, stockNo) => new Meido(stockNo)).ToArray();
+            .Select((_, stockNo) => new Meido(stockNo))
+            .ToArray();
 
         tempEditMaidIndex = -1;
 

+ 8 - 5
src/MeidoPhotoStudio.Plugin/Managers/PropManager.cs

@@ -53,12 +53,12 @@ public class PropManager : IManager
     {
         get
         {
-            if (modFileToFullPath != null)
+            if (modFileToFullPath is not null)
                 return modFileToFullPath;
 
             var modFiles = Menu.GetModFiles();
 
-            modFileToFullPath = new Dictionary<string, string>(modFiles.Length, StringComparer.OrdinalIgnoreCase);
+            modFileToFullPath = new(modFiles.Length, StringComparer.OrdinalIgnoreCase);
 
             foreach (var mod in modFiles)
             {
@@ -103,6 +103,7 @@ public class PropManager : IManager
             if (PropCount == 0)
             {
                 currentPropIndex = 0;
+
                 return;
             }
 
@@ -128,6 +129,7 @@ public class PropManager : IManager
 
         meidoManager.BeginCallMeidos += OnBeginCallMeidos;
         meidoManager.EndCallMeidos += OnEndCallMeidos;
+
         Activate();
     }
 
@@ -153,7 +155,8 @@ public class PropManager : IManager
                 return AddBgProp(propInfo.Filename);
             case PropInfo.PropType.Odogu:
                 return AddGameProp(propInfo.Filename);
-            default: throw new ArgumentOutOfRangeException();
+            default:
+                throw new ArgumentOutOfRangeException();
         }
     }
 
@@ -326,13 +329,13 @@ public class PropManager : IManager
 
     private void OnBeginCallMeidos(object sender, EventArgs args)
     {
-        foreach (var prop in propList.Where(p => p.AttachPointInfo.AttachPoint != AttachPoint.None))
+        foreach (var prop in propList.Where(p => p.AttachPointInfo.AttachPoint is not AttachPoint.None))
             prop.DetachTemporary();
     }
 
     private void OnEndCallMeidos(object sender, EventArgs args)
     {
-        foreach (var prop in propList.Where(p => p.AttachPointInfo.AttachPoint != AttachPoint.None))
+        foreach (var prop in propList.Where(p => p.AttachPointInfo.AttachPoint is not AttachPoint.None))
         {
             var info = prop.AttachPointInfo;
             var meido = meidoManager.GetMeido(info.MaidGuid);

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

@@ -65,13 +65,11 @@ public class SceneManager : IManager
 
     static SceneManager()
     {
-        sortDescending = Configuration.Config.Bind(
-            "SceneManager", "SortDescending", false, "Sort scenes descending (Z-A)"
-        );
+        sortDescending =
+            Configuration.Config.Bind("SceneManager", "SortDescending", false, "Sort scenes descending (Z-A)");
 
-        currentSortMode = Configuration.Config.Bind(
-            "SceneManager", "SortMode", SortMode.Name, "Scene sorting mode"
-        );
+        currentSortMode =
+            Configuration.Config.Bind("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");
@@ -117,6 +115,7 @@ public class SceneManager : IManager
 
         CurrentDirectoryList.RemoveAt(CurrentDirectoryIndex);
         CurrentDirectoryIndex = Mathf.Clamp(CurrentDirectoryIndex, 0, CurrentDirectoryList.Count - 1);
+
         UpdateSceneList();
     }
 
@@ -127,6 +126,7 @@ public class SceneManager : IManager
     {
         KankyoMode = !KankyoMode;
         CurrentDirectoryIndex = 0;
+
         UpdateSceneList();
     }
 
@@ -142,11 +142,12 @@ public class SceneManager : IManager
 
         MeidoPhotoStudio.NotifyRawScreenshot += SaveScene;
 
-        MeidoPhotoStudio.TakeScreenshot(new ScreenshotEventArgs() { InMemory = true });
+        MeidoPhotoStudio.TakeScreenshot(new() { InMemory = true });
 
         void SaveScene(object sender, ScreenshotEventArgs args)
         {
             MeidoPhotoStudio.NotifyRawScreenshot -= SaveScene;
+
             SaveSceneToFile(args.Screenshot, overwrite);
         }
     }
@@ -254,7 +255,7 @@ public class SceneManager : IManager
             Directory.CreateDirectory(CurrentScenesDirectory);
 
         foreach (var filename in Directory.GetFiles(CurrentScenesDirectory))
-            if (Path.GetExtension(filename) == ".png")
+            if (Path.GetExtension(filename) is ".png")
                 SceneList.Add(new(filename));
 
         SortScenes(CurrentSortMode);
@@ -269,7 +270,8 @@ public class SceneManager : IManager
         CurrentDirectoryList.Sort((a, b) =>
             a.Equals(baseDirectoryName, StringComparison.InvariantCultureIgnoreCase)
                 ? -1
-                : WindowsLogicalComparer.StrCmpLogicalW(a, b));
+                : WindowsLogicalComparer.StrCmpLogicalW(a, b)
+            );
     }
 
     private void ClearSceneList()
@@ -287,7 +289,7 @@ public class SceneManager : IManager
 
         var data = meidoPhotoStudio.SaveScene();
 
-        if (data == null)
+        if (data is null)
             return;
 
         tempSceneData = data;
@@ -300,7 +302,7 @@ public class SceneManager : IManager
         if (Busy)
             return;
 
-        if (tempSceneData == null)
+        if (tempSceneData is null)
         {
             if (File.Exists(TempScenePath))
                 tempSceneData = File.ReadAllBytes(TempScenePath);
@@ -317,7 +319,7 @@ public class SceneManager : IManager
 
         var sceneData = meidoPhotoStudio.SaveScene(KankyoMode);
 
-        if (sceneData != null)
+        if (sceneData is not null)
         {
             var scenePrefix = KankyoMode ? "mpskankyo" : "mpsscene";
             var fileName = $"{scenePrefix}{Utility.Timestamp}.png";
@@ -327,7 +329,7 @@ public class SceneManager : IManager
 
             try
             {
-                if (overwrite && CurrentScene?.FileInfo != null)
+                if (overwrite && CurrentScene?.FileInfo is not null)
                     savePath = CurrentScene.FileInfo.FullName;
                 else
                     overwrite = false;

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

@@ -23,19 +23,16 @@ public class DragPointFinger : DragPointMeido
 
         // Base finger names have the form 'FingerN' or 'ToeN' where N is a natural number
         baseFinger = parentName.Length is 7 or 4;
-        ikChain = new Transform[2] {
-            myObject.parent,
-            myObject
-        };
+        ikChain = new Transform[2] { myObject.parent, myObject };
 
         ikCtrlData = IkCtrlData;
     }
 
     protected override void ApplyDragType()
     {
-        if (baseFinger && CurrentDragType == DragType.RotLocalY)
+        if (baseFinger && CurrentDragType is DragType.RotLocalY)
             ApplyProperties(true, true, false);
-        else if (CurrentDragType == DragType.MoveXZ)
+        else if (CurrentDragType is DragType.MoveXZ)
             ApplyProperties(true, true, false);
         else
             ApplyProperties(false, false, false);
@@ -56,6 +53,7 @@ public class DragPointFinger : DragPointMeido
 
         jointRotation[jointUpper] = ikChain[jointUpper].localRotation;
         jointRotation[jointMiddle] = ikChain[jointMiddle].localRotation;
+
         InitializeIK(IK, ikChain[jointUpper], ikChain[jointUpper], ikChain[jointMiddle]);
     }
 
@@ -64,7 +62,7 @@ public class DragPointFinger : DragPointMeido
         if (isPlaying)
             meido.Stop = true;
 
-        if (CurrentDragType == DragType.MoveXZ)
+        if (CurrentDragType is DragType.MoveXZ)
         {
             Porc(IK, ikCtrlData, ikChain[jointUpper], ikChain[jointUpper], ikChain[jointMiddle]);
 
@@ -79,7 +77,7 @@ public class DragPointFinger : DragPointMeido
                 jointRotation[jointMiddle] = ikChain[jointMiddle].localRotation;
             }
         }
-        else if (CurrentDragType == DragType.RotLocalY)
+        else if (CurrentDragType is DragType.RotLocalY)
         {
             var mouseDelta = MouseDelta();
 

+ 21 - 19
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointHead.cs

@@ -25,7 +25,7 @@ public class DragPointHead : DragPointMeido
             ApplyProperties(active, false, false);
         }
         else
-            ApplyProperties(CurrentDragType != DragType.None, false, false);
+            ApplyProperties(CurrentDragType is not DragType.None, false, false);
     }
 
     protected override void UpdateDragType()
@@ -35,21 +35,25 @@ public class DragPointHead : DragPointMeido
 
         if (alt && Input.Control)
             // eyes
-            CurrentDragType = shift ? DragType.MoveY : DragType.MoveXZ;
+            CurrentDragType = shift
+                ? DragType.MoveY
+                : DragType.MoveXZ;
         else if (alt)
             // head
-            CurrentDragType = shift ? DragType.RotLocalY : DragType.RotLocalXZ;
-        else if (Input.GetKey(MpsKey.DragSelect))
-            CurrentDragType = DragType.Select;
+            CurrentDragType = shift
+                ? DragType.RotLocalY
+                : DragType.RotLocalXZ;
         else
-            CurrentDragType = DragType.None;
+            CurrentDragType = Input.GetKey(MpsKey.DragSelect)
+                ? DragType.Select
+                : DragType.None;
     }
 
     protected override void OnMouseDown()
     {
         base.OnMouseDown();
 
-        if (CurrentDragType == DragType.Select)
+        if (CurrentDragType is DragType.Select)
             Select?.Invoke(this, EventArgs.Empty);
 
         headRotation = MyObject.rotation;
@@ -71,22 +75,22 @@ public class DragPointHead : DragPointMeido
 
     protected override void Drag()
     {
-        if (IsIK || CurrentDragType == DragType.Select)
+        if (IsIK || CurrentDragType is DragType.Select)
             return;
 
-        if (!(CurrentDragType == DragType.MoveXZ || CurrentDragType == DragType.MoveY) && isPlaying)
+        if (CurrentDragType is not DragType.MoveXZ and not DragType.MoveY && isPlaying)
             meido.Stop = true;
 
         var mouseDelta = MouseDelta();
 
-        if (CurrentDragType == DragType.RotLocalXZ)
+        if (CurrentDragType is DragType.RotLocalXZ)
         {
             MyObject.rotation = headRotation;
             MyObject.Rotate(camera.transform.forward, -mouseDelta.x / 3f, Space.World);
             MyObject.Rotate(camera.transform.right, mouseDelta.y / 3f, Space.World);
         }
 
-        if (CurrentDragType == DragType.RotLocalY)
+        if (CurrentDragType is DragType.RotLocalY)
         {
             MyObject.rotation = headRotation;
             MyObject.Rotate(Vector3.right * mouseDelta.x / 3f);
@@ -94,14 +98,12 @@ public class DragPointHead : DragPointMeido
 
         if (CurrentDragType is DragType.MoveXZ or DragType.MoveY)
         {
-            var inv = CurrentDragType == DragType.MoveY ? -1 : 1;
-
-            meido.Body.quaDefEyeL.eulerAngles = new(
-                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
-            );
+            var inv = CurrentDragType is DragType.MoveY ? -1 : 1;
+
+            meido.Body.quaDefEyeL.eulerAngles =
+                new(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);
         }
     }
 }

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

@@ -15,11 +15,11 @@ public class DragPointPelvis : DragPointMeido
         else if (IsBone)
             ApplyProperties(false, false, false);
         else
-            ApplyProperties(CurrentDragType != DragType.None, false, false);
+            ApplyProperties(CurrentDragType is not DragType.None, false, false);
     }
 
     protected override void UpdateDragType() =>
-        // TODO: Rethink this
+        // TODO: Rethink this formatting
         CurrentDragType = Input.Alt && !Input.Control
             ? Input.Shift
                 ? DragType.RotLocalY
@@ -31,12 +31,13 @@ public class DragPointPelvis : DragPointMeido
     protected override void OnMouseDown()
     {
         base.OnMouseDown();
+
         pelvisRotation = MyObject.rotation;
     }
 
     protected override void Drag()
     {
-        if (CurrentDragType == DragType.None)
+        if (CurrentDragType is DragType.None)
             return;
 
         if (isPlaying)
@@ -44,14 +45,14 @@ public class DragPointPelvis : DragPointMeido
 
         var mouseDelta = MouseDelta();
 
-        if (CurrentDragType == DragType.RotLocalXZ)
+        if (CurrentDragType is DragType.RotLocalXZ)
         {
             MyObject.rotation = pelvisRotation;
             MyObject.Rotate(camera.transform.forward, mouseDelta.x / 6f, Space.World);
             MyObject.Rotate(camera.transform.right, mouseDelta.y / 4f, Space.World);
         }
 
-        if (CurrentDragType == DragType.RotLocalY)
+        if (CurrentDragType is DragType.RotLocalY)
         {
             MyObject.rotation = pelvisRotation;
             MyObject.Rotate(Vector3.right * (mouseDelta.x / 2.2f));

+ 8 - 8
src/MeidoPhotoStudio.Plugin/Meido/IK/DragPointSpine.cs

@@ -23,7 +23,7 @@ public class DragPointSpine : DragPointMeido
     {
         base.Set(myObject);
 
-        isHip = myObject.name == "Bip01";
+        isHip = myObject.name is "Bip01";
         isThigh = myObject.name.EndsWith("Thigh");
         isHead = myObject.name.EndsWith("Head");
     }
@@ -32,13 +32,13 @@ public class DragPointSpine : DragPointMeido
     {
         var current = CurrentDragType;
 
-        if (IsBone && current != DragType.Ignore)
+        if (IsBone && current is not DragType.Ignore)
         {
-            if (!isHead && current == DragType.RotLocalXZ)
+            if (!isHead && current is DragType.RotLocalXZ)
                 ApplyProperties(false, false, isThigh);
-            else if (!isThigh && current == DragType.MoveY)
+            else if (!isThigh && current is DragType.MoveY)
                 ApplyProperties(isHip, isHip, !isHip);
-            else if (!isThigh && !isHead && current == DragType.RotLocalY)
+            else if (!isThigh && !isHead && current is DragType.RotLocalY)
                 ApplyProperties(!isHip, !isHip, isHip);
             else
                 ApplyProperties(!isThigh, !isThigh, false);
@@ -82,7 +82,7 @@ public class DragPointSpine : DragPointMeido
 
         var mouseDelta = MouseDelta();
 
-        if (CurrentDragType == DragType.None)
+        if (CurrentDragType is DragType.None)
         {
             if (isHead)
                 meido.HeadToCam = false;
@@ -92,7 +92,7 @@ public class DragPointSpine : DragPointMeido
             MyObject.Rotate(camera.transform.right, mouseDelta.y / 3f, Space.World);
         }
 
-        if (CurrentDragType == DragType.RotLocalY)
+        if (CurrentDragType is DragType.RotLocalY)
         {
             if (isHead)
                 meido.HeadToCam = false;
@@ -101,7 +101,7 @@ public class DragPointSpine : DragPointMeido
             MyObject.Rotate(Vector3.right * mouseDelta.x / 4f);
         }
 
-        if (CurrentDragType == DragType.MoveY)
+        if (CurrentDragType is DragType.MoveY)
         {
             var cursorPosition = CursorPosition();
 

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

@@ -28,16 +28,16 @@ public class DragPointTorso : DragPointMeido
 
     protected override void ApplyDragType()
     {
-        if (CurrentDragType == DragType.Ignore)
+        if (CurrentDragType is DragType.Ignore)
             ApplyProperties();
         else if (IsBone)
             ApplyProperties(false, false, false);
         else
-            ApplyProperties(CurrentDragType != DragType.None, false, false);
+            ApplyProperties(CurrentDragType is not DragType.None, false, false);
     }
 
     protected override void UpdateDragType() =>
-        // TODO: Rethink this
+        // TODO: Rethink this formatting
         CurrentDragType = Input.Alt && !Input.Control
             ? Input.Shift
                 ? DragType.RotLocalY
@@ -56,7 +56,7 @@ public class DragPointTorso : DragPointMeido
 
     protected override void Drag()
     {
-        if (CurrentDragType == DragType.None)
+        if (CurrentDragType is DragType.None)
             return;
 
         if (isPlaying)
@@ -64,7 +64,7 @@ public class DragPointTorso : DragPointMeido
 
         var mouseDelta = MouseDelta();
 
-        if (CurrentDragType == DragType.RotLocalXZ)
+        if (CurrentDragType is DragType.RotLocalXZ)
             for (var i = 0; i < spine.Length; i++)
             {
                 spine[i].localRotation = spineRotation[i];
@@ -72,7 +72,7 @@ public class DragPointTorso : DragPointMeido
                 spine[i].Rotate(camera.transform.right, mouseDelta.y * blah[i], Space.World);
             }
 
-        if (CurrentDragType == DragType.RotLocalY)
+        if (CurrentDragType is DragType.RotLocalY)
             for (var i = 0; i < spine.Length; i++)
             {
                 spine[i].localRotation = spineRotation[i];

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

@@ -14,7 +14,8 @@ public abstract class DragPointChain : DragPointMeido
     {
         base.Set(myObject);
 
-        ikChain = new Transform[] {
+        ikChain = new Transform[]
+        {
             myObject.parent,
             myObject.parent,
             myObject

+ 16 - 11
src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointLimb.cs

@@ -28,7 +28,7 @@ public class DragPointLimb : DragPointChain
         var name = myObject.name;
 
         foot = name.EndsWith("Foot") ? -1 : 1;
-        isLower = name.EndsWith("Hand") || foot == -1;
+        isLower = name.EndsWith("Hand") || foot is -1;
         isMiddle = name.EndsWith("Calf") || name.EndsWith("Forearm");
         isUpper = !isMiddle && !isLower;
 
@@ -41,16 +41,16 @@ public class DragPointLimb : DragPointChain
         var current = CurrentDragType;
         var isBone = IsBone;
 
-        if (CurrentDragType == DragType.Ignore)
+        if (CurrentDragType is DragType.Ignore)
             ApplyProperties();
-        else if (current == DragType.RotLocalXZ)
+        else if (current is DragType.RotLocalXZ)
         {
             if (isLower)
                 ApplyProperties(!isBone, false, isBone);
             else
                 ApplyProperties();
         }
-        else if (current == DragType.RotLocalY)
+        else if (current is DragType.RotLocalY)
         {
             if (isLower || isMiddle)
                 ApplyProperties(!isBone, false, false);
@@ -59,14 +59,14 @@ public class DragPointLimb : DragPointChain
             else
                 ApplyProperties();
         }
-        else if (current == DragType.RotY)
+        else if (current is DragType.RotY)
         {
             if (isMiddle)
                 ApplyProperties(false, false, isBone);
             else
                 ApplyProperties();
         }
-        else if (current == DragType.MoveXZ)
+        else if (current is DragType.MoveXZ)
         {
             if (isLower)
                 ApplyProperties(true, isBone, false);
@@ -93,9 +93,14 @@ public class DragPointLimb : DragPointChain
                 CurrentDragType = DragType.MoveXZ;
         }
         else if (alt)
-            CurrentDragType = Input.Shift ? DragType.RotLocalY : DragType.RotLocalXZ;
+            // TODO: Rethink this formatting
+            CurrentDragType = Input.Shift
+                ? DragType.RotLocalY
+                : DragType.RotLocalXZ;
         else
-            CurrentDragType = Input.Shift ? DragType.Ignore : DragType.None;
+            CurrentDragType = Input.Shift
+                ? DragType.Ignore
+                : DragType.None;
     }
 
     protected override void Drag()
@@ -105,7 +110,7 @@ public class DragPointLimb : DragPointChain
 
         var altRotation = CurrentDragType is DragType.MoveXZ or DragType.RotY;
 
-        if (CurrentDragType == DragType.None || altRotation)
+        if (CurrentDragType is DragType.None || altRotation)
         {
             var upperJoint = altRotation ? jointMiddle : jointUpper;
 
@@ -116,7 +121,7 @@ public class DragPointLimb : DragPointChain
 
         var mouseDelta = MouseDelta();
 
-        if (CurrentDragType == DragType.RotLocalY)
+        if (CurrentDragType is DragType.RotLocalY)
         {
             var joint = isMiddle ? jointUpper : jointLower;
 
@@ -124,7 +129,7 @@ public class DragPointLimb : DragPointChain
             ikChain[joint].Rotate(Vector3.right * (-mouseDelta.x / 1.5f));
         }
 
-        if (CurrentDragType == DragType.RotLocalXZ)
+        if (CurrentDragType is DragType.RotLocalXZ)
         {
             ikChain[jointLower].localRotation = jointRotation[jointLower];
             ikChain[jointLower].Rotate(Vector3.up * (foot * mouseDelta.x / 1.5f));

+ 12 - 12
src/MeidoPhotoStudio.Plugin/Meido/IK/IK Chain/DragPointMune.cs

@@ -13,14 +13,14 @@ public class DragPointMune : DragPointChain
     {
         base.Set(myObject);
 
-        isMuneL = myObject.name[5] == 'L'; // Mune_L_Sub
+        isMuneL = myObject.name[5] is 'L'; // Mune_L_Sub
 
         if (isMuneL)
             inv *= -1;
     }
 
     protected override void ApplyDragType() =>
-        ApplyProperties(CurrentDragType != DragType.None, false, false);
+        ApplyProperties(CurrentDragType is not DragType.None, false, false);
 
     protected override void OnMouseDown()
     {
@@ -31,30 +31,30 @@ public class DragPointMune : DragPointChain
 
     protected override void OnDoubleClick()
     {
-        if (CurrentDragType != DragType.None)
+        if (CurrentDragType is not DragType.None)
             meido.SetMune(true, isMuneL);
     }
 
-    protected override void UpdateDragType()
-    {
-        if (Input.Control && Input.Alt)
-            CurrentDragType = Input.Shift ? DragType.RotLocalY : DragType.RotLocalXZ;
-        else
-            CurrentDragType = DragType.None;
-    }
+    protected override void UpdateDragType() =>
+        // TODO: Rethink this formatting
+        CurrentDragType = Input.Control && Input.Alt
+            ? Input.Shift
+                ? DragType.RotLocalY
+                : DragType.RotLocalXZ
+            : DragType.None;
 
     protected override void Drag()
     {
         if (isPlaying)
             meido.Stop = true;
 
-        if (CurrentDragType == DragType.RotLocalXZ)
+        if (CurrentDragType is DragType.RotLocalXZ)
         {
             Porc(IK, ikCtrlData, ikChain[jointUpper], ikChain[jointMiddle], ikChain[jointLower]);
             InitializeRotation();
         }
 
-        if (CurrentDragType == DragType.RotLocalY)
+        if (CurrentDragType is DragType.RotLocalY)
         {
             var mouseDelta = MouseDelta();
 

+ 45 - 34
src/MeidoPhotoStudio.Plugin/Meido/Meido.cs

@@ -18,21 +18,23 @@ public class Meido
 
     public static readonly string defaultFaceBlendSet = "通常";
 
-    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"
-    };
+    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"
+        };
 
-    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"
-    };
+    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"
+        };
 
     private readonly FieldInfo m_eMaskMode = Utility.GetFieldInfo<TBody>("m_eMaskMode");
 
@@ -204,7 +206,7 @@ public class Meido
     {
         StockNo = stockMaidIndex;
         Maid = GameMain.Instance.CharacterMgr.GetStockMaid(stockMaidIndex);
-        IKManager = new MeidoDragPointManager(this);
+        IKManager = new(this);
         IKManager.SelectMaid += (s, args) => OnUpdateMeido(args);
     }
 
@@ -238,6 +240,7 @@ public class Meido
         if (Body.isLoadedBody && Maid.Visible)
         {
             DetachAllMpnAttach();
+
             Body.jbMuneL.enabled = true;
             Body.jbMuneR.enabled = true;
 
@@ -324,6 +327,7 @@ public class Meido
                 Constants.InitializeCustomPoses();
                 SetPose(PoseInfo.DefaultPose);
                 OnUpdateMeido();
+
                 return;
             }
             catch (Exception e)
@@ -331,6 +335,7 @@ public class Meido
                 Utility.LogWarning($"{poseFilename}: Could not apply pose because {e.Message}");
                 SetPose(PoseInfo.DefaultPose);
                 OnUpdateMeido();
+
                 return;
             }
 
@@ -364,9 +369,10 @@ public class Meido
     public void CopyPose(Meido fromMeido)
     {
         Stop = true;
+
         SetFrameBinary(fromMeido.SerializePose(frameBinary: true));
-        SetMune(fromMeido.Body.GetMuneYureL() != 0f, left: true);
-        SetMune(fromMeido.Body.GetMuneYureR() != 0f, left: false);
+        SetMune(fromMeido.Body.GetMuneYureL() is not 0f, left: true);
+        SetMune(fromMeido.Body.GetMuneYureR() is not 0f, left: false);
     }
 
     public void SetMune(bool enabled, bool left = false)
@@ -397,6 +403,7 @@ public class Meido
             if (handElement?.Elements().Any(element => element?.IsEmpty ?? true) ?? true)
             {
                 Utility.LogWarning($"{faceFilename}: Could not apply hand preset because it is invalid.");
+
                 return;
             }
 
@@ -427,10 +434,12 @@ public class Meido
     public byte[] SerializePose(bool frameBinary = false)
     {
         var cache = GetCacheBoneData();
-        var muneL = Body.GetMuneYureL() == 0f;
-        var muneR = Body.GetMuneYureR() == 0f;
+        var muneL = Body.GetMuneYureL() is 0f;
+        var muneR = Body.GetMuneYureR() is 0f;
 
-        return frameBinary ? cache.GetFrameBinary(muneL, muneR) : cache.GetAnmBinary(true, true);
+        return frameBinary
+            ? cache.GetFrameBinary(muneL, muneR)
+            : cache.GetAnmBinary(true, true);
     }
 
     public Dictionary<string, float> SerializeFace()
@@ -478,7 +487,7 @@ public class Meido
                     var line = info.HasLineInfo() ? info.LineNumber : -1;
                     string key;
 
-                    if ((key = (string)element.Attribute("name")) == null)
+                    if ((key = (string)element.Attribute("name")) is null)
                     {
                         Utility.LogWarning($"{blendSetFileName}: Could not read face blend key at line {line}.");
 
@@ -546,7 +555,7 @@ public class Meido
                     continue;
 
                 var blendIndex = (int)morph.hash[hash];
-                var value = faceKey == "nosefook"
+                var value = faceKey is "nosefook"
                     ? Maid.boNoseFook || morph.boNoseFook ? 1f : 0f
                     : morph.dicBlendSet[CurrentFaceBlendSet][blendIndex];
 
@@ -707,7 +716,7 @@ public class Meido
             initialized = true;
         }
 
-        if (BlendSetValueBackup == null)
+        if (BlendSetValueBackup is null)
             BackupBlendSetValues();
 
         if (!HairGravityControl)
@@ -738,10 +747,12 @@ public class Meido
         if (args.maid.status.guid != Maid.status.guid)
             return;
 
-        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
-        };
+        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
+            };
 
         Action action = null;
 
@@ -773,7 +784,7 @@ public class Meido
 
         // Clothing/accessory changes
         // Includes null_mpn too but any button click results in null_mpn bodut I think
-        action ??= () => OnUpdateMeido();
+        action ??= Default;
 
         StartLoad(action);
 
@@ -802,6 +813,9 @@ public class Meido
             InitializeGravityControls();
             OnUpdateMeido();
         }
+
+        void Default() =>
+            OnUpdateMeido();
     }
 
     private void SetPoseMune()
@@ -856,9 +870,7 @@ public class Meido
 
     private DragPointGravity MakeGravityControl(bool skirt = false)
     {
-        var gravityDragpoint = DragPoint.Make<DragPointGravity>(
-            PrimitiveType.Cube, Vector3.one * 0.12f
-        );
+        var gravityDragpoint = DragPoint.Make<DragPointGravity>(PrimitiveType.Cube, Vector3.one * 0.12f);
 
         var control = DragPointGravity.MakeGravityControl(Maid, skirt);
 
@@ -878,9 +890,8 @@ public class Meido
 
     private void OnGravityChange(DragPointGravity dragPoint)
     {
-        var args = new GravityEventArgs(
-            dragPoint == SkirtGravityControl, dragPoint.MyObject.transform.localPosition
-        );
+        var args =
+            new GravityEventArgs(dragPoint == SkirtGravityControl, dragPoint.MyObject.transform.localPosition);
 
         GravityMove?.Invoke(this, args);
     }

+ 42 - 38
src/MeidoPhotoStudio.Plugin/Meido/MeidoDragPointManager.cs

@@ -85,11 +85,11 @@ public class MeidoDragPointManager
         get => cubeActive;
         set
         {
-            if (value != cubeActive)
-            {
-                cubeActive = value;
-                CubeActiveChange?.Invoke(null, EventArgs.Empty);
-            }
+            if (value == cubeActive)
+                return;
+
+            cubeActive = value;
+            CubeActiveChange?.Invoke(null, EventArgs.Empty);
         }
     }
 
@@ -98,11 +98,11 @@ public class MeidoDragPointManager
         get => cubeSmall;
         set
         {
-            if (value != cubeSmall)
-            {
-                cubeSmall = value;
-                CubeSmallChange?.Invoke(null, EventArgs.Empty);
-            }
+            if (value == cubeSmall)
+                return;
+
+            cubeSmall = value;
+            CubeSmallChange?.Invoke(null, EventArgs.Empty);
         }
     }
 
@@ -235,13 +235,13 @@ public class MeidoDragPointManager
                 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,
-        };
+            : 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,
+            };
 
         var localRotationIndex = Array.IndexOf(bones, Bone.CalfR);
 
@@ -249,7 +249,7 @@ public class MeidoDragPointManager
         {
             var bone = bones[i];
 
-            if (bone == Bone.ClavicleL)
+            if (bone is Bone.ClavicleL)
             {
                 /*
                  * Versions of MM possibly serialized ClavicleL improperly.
@@ -287,10 +287,11 @@ public class MeidoDragPointManager
         meido.Stop = true;
 
         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
-        };
+        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
+            };
 
         var singleRotations = single.Select(bone => BoneTransform[bone].eulerAngles).ToList();
         var pairRotations = pair.Select(bone => BoneTransform[bone].eulerAngles).ToList();
@@ -304,9 +305,8 @@ public class MeidoDragPointManager
         var hipR = meido.Maid.body0.GetBone("Hip_R");
         var vecHipR = hipR.eulerAngles;
 
-        hip.rotation = Quaternion.Euler(
-            360f - (vecHip.x + 270f) - 270f, 360f - (vecHip.y + 90f) - 90f, 360f - vecHip.z
-        );
+        hip.rotation =
+            Quaternion.Euler(360f - (vecHip.x + 270f) - 270f, 360f - (vecHip.y + 90f) - 90f, 360f - vecHip.z);
 
         hipL.rotation = FlipRotation(vecHipR);
         hipR.rotation = FlipRotation(vecHipL);
@@ -341,7 +341,7 @@ public class MeidoDragPointManager
     }
 
     public Transform GetAttachPointTransform(AttachPoint point) =>
-        point == AttachPoint.None ? null : BoneTransform[PointToBone[point]];
+        point is AttachPoint.None ? null : BoneTransform[PointToBone[point]];
 
     public byte[] SerializeHand(bool right)
     {
@@ -464,10 +464,10 @@ 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()
-                   );
+                BoneTransform[bone + i].localRotation = new(
+                    binaryReader.ReadSingle() * mirror, binaryReader.ReadSingle() * mirror,
+                    binaryReader.ReadSingle(), binaryReader.ReadSingle()
+                );
     }
 
     private void InitializeDragPoints()
@@ -509,7 +509,8 @@ public class MeidoDragPointManager
                 (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,
+            () => new(
+                BoneTransform[Bone.Head].eulerAngles.x, BoneTransform[Bone.Head].eulerAngles.y,
                 BoneTransform[Bone.Head].eulerAngles.z + 90f
             )
         );
@@ -534,7 +535,8 @@ public class MeidoDragPointManager
 
         var dragTorso = DragPoint.Make<DragPointTorso>(PrimitiveType.Capsule, new Vector3(0.2f, 0.19f, 0.24f));
 
-        dragTorso.Initialize(meido,
+        dragTorso.Initialize(
+            meido,
             () => new(spineTrans1.position.x, spineTrans2.position.y, spineTrans1.position.z - 0.05f),
             () => new(spineTrans1.eulerAngles.x, spineTrans1.eulerAngles.y, spineTrans1.eulerAngles.z + 90f)
         );
@@ -549,7 +551,8 @@ public class MeidoDragPointManager
 
         var dragPelvis = DragPoint.Make<DragPointPelvis>(PrimitiveType.Capsule, new(0.2f, 0.15f, 0.24f));
 
-        dragPelvis.Initialize(meido,
+        dragPelvis.Initialize(
+            meido,
             () => new(
                 pelvisTrans.position.x, (pelvisTrans.position.y + spineTrans.position.y) / 2f,
                 pelvisTrans.position.z
@@ -609,8 +612,10 @@ public class MeidoDragPointManager
         var sub = left ? Bone.MuneSubL : Bone.MuneSubR;
         var muneDragPoint = DragPoint.Make<DragPointMune>(PrimitiveType.Sphere, Vector3.one * 0.12f);
 
-        muneDragPoint.Initialize(meido,
-            () => (BoneTransform[mune].position + BoneTransform[sub].position) / 2f, () => Vector3.zero
+        muneDragPoint.Initialize(
+            meido,
+            () => (BoneTransform[mune].position + BoneTransform[sub].position) / 2f,
+            () => Vector3.zero
         );
 
         muneDragPoint.Set(BoneTransform[sub]);
@@ -630,6 +635,7 @@ public class MeidoDragPointManager
             dragPoints[i].Initialize(meido, () => joint.position, () => Vector3.zero);
             dragPoints[i].Set(joint);
             dragPoints[i].AddGizmo();
+
             lower = lower.parent;
         }
 
@@ -663,7 +669,7 @@ public class MeidoDragPointManager
         foreach (var bone in bones)
         {
             var spine = BoneTransform[bone];
-            var primitive = bone == Bone.Hip ? PrimitiveType.Cube : PrimitiveType.Sphere;
+            var primitive = bone is Bone.Hip ? PrimitiveType.Cube : PrimitiveType.Sphere;
             var dragPoint = DragPoint.Make<DragPointSpine>(primitive, spineDragPointSize);
 
             dragPoint.Initialize(meido, () => spine.position, () => Vector3.zero);
@@ -700,8 +706,6 @@ public class MeidoDragPointManager
             [Bone.Head] = CMT.SearchObjName(transform, "Bip01 Head"),
             [Bone.Neck] = CMT.SearchObjName(transform, "Bip01 Neck"),
             [Bone.HeadNub] = CMT.SearchObjName(transform, "Bip01 HeadNub"),
-            /*[Bone.IKHandL] = CMT.SearchObjName(transform, "_IK_handL"),
-              [Bone.IKHandR] = CMT.SearchObjName(transform, "_IK_handR"),*/
             [Bone.MuneL] = CMT.SearchObjName(transform, "Mune_L"),
             [Bone.MuneSubL] = CMT.SearchObjName(transform, "Mune_L_sub"),
             [Bone.MuneR] = CMT.SearchObjName(transform, "Mune_R"),

+ 47 - 41
src/MeidoPhotoStudio.Plugin/MeidoPhotoStudio.cs

@@ -107,6 +107,7 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         catch (Exception e)
         {
             Utility.LogError($"Failed to save scene because {e.Message}\n{e.StackTrace}");
+
             return null;
         }
     }
@@ -116,6 +117,7 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         if (meidoManager.Busy)
         {
             Utility.LogMessage("Could not apply scene. Meidos are Busy");
+
             return;
         }
 
@@ -125,6 +127,7 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         if (!Utility.BytesEqual(headerReader.ReadBytes(SceneHeader.Length), SceneHeader))
         {
             Utility.LogError("Not a MPS scene!");
+
             return;
         }
 
@@ -134,6 +137,7 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         {
             Utility.LogWarning("Cannot load scene. Scene is too new.");
             Utility.LogWarning($"Your version: {sceneVersion}, Scene version: {metadata.Version}");
+
             return;
         }
 
@@ -187,8 +191,8 @@ 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);
@@ -231,28 +235,28 @@ public class MeidoPhotoStudio : BaseUnityPlugin
 
     private void Update()
     {
-        if (currentScene is Constants.Scene.Daily or Constants.Scene.Edit)
-        {
-            if (Input.GetKeyDown(MpsKey.Activate))
-            {
-                if (active)
-                    Deactivate();
-                else
-                    Activate();
-            }
+        if (currentScene is not Constants.Scene.Daily and not Constants.Scene.Edit)
+            return;
 
+        if (Input.GetKeyDown(MpsKey.Activate))
+        {
             if (active)
-            {
-                if (!Input.Control && !Input.GetKey(MpsKey.CameraLayer) && Input.GetKeyDown(MpsKey.Screenshot))
-                    TakeScreenshot();
-
-                meidoManager.Update();
-                cameraManager.Update();
-                windowManager.Update();
-                effectManager.Update();
-                sceneManager.Update();
-            }
+                Deactivate();
+            else
+                Activate();
         }
+
+        if (!active)
+            return;
+
+        if (!Input.Control && !Input.GetKey(MpsKey.CameraLayer) && Input.GetKeyDown(MpsKey.Screenshot))
+            TakeScreenshot();
+
+        meidoManager.Update();
+        cameraManager.Update();
+        windowManager.Update();
+        effectManager.Update();
+        sceneManager.Update();
     }
 
     private IEnumerator Screenshot(ScreenshotEventArgs args)
@@ -296,12 +300,14 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         }
 
         // Hide other drag points
-        var isCubeActive = new[] {
-            MeidoDragPointManager.CubeActive,
-            PropManager.CubeActive,
-            LightManager.CubeActive,
-            EnvironmentManager.CubeActive
-        };
+        var isCubeActive =
+            new[]
+            {
+                MeidoDragPointManager.CubeActive,
+                PropManager.CubeActive,
+                LightManager.CubeActive,
+                EnvironmentManager.CubeActive
+            };
 
         MeidoDragPointManager.CubeActive = false;
         PropManager.CubeActive = false;
@@ -381,16 +387,16 @@ public class MeidoPhotoStudio : BaseUnityPlugin
 
     private void OnGUI()
     {
-        if (uiActive)
-        {
-            windowManager.DrawWindows();
+        if (!uiActive)
+            return;
 
-            if (DropdownHelper.Visible)
-                DropdownHelper.HandleDropdown();
+        windowManager.DrawWindows();
 
-            if (Modal.Visible)
-                Modal.Draw();
-        }
+        if (DropdownHelper.Visible)
+            DropdownHelper.HandleDropdown();
+
+        if (Modal.Visible)
+            Modal.Draw();
     }
 
     private void Initialize()
@@ -431,9 +437,8 @@ public class MeidoPhotoStudio : BaseUnityPlugin
                 [Constants.Window.Call] = new CallWindowPane(meidoManager),
                 [Constants.Window.Pose] = new PoseWindowPane(meidoManager, maidSwitcherPane),
                 [Constants.Window.Face] = new FaceWindowPane(meidoManager, maidSwitcherPane),
-                [Constants.Window.BG] = new BGWindowPane(
-                    environmentManager, lightManager, effectManager, sceneWindow, cameraManager
-                ),
+                [Constants.Window.BG] =
+                    new BGWindowPane(environmentManager, lightManager, effectManager, sceneWindow, cameraManager),
                 [Constants.Window.BG2] = new BG2WindowPane(meidoManager, propManager),
                 [Constants.Window.Settings] = new SettingsWindowPane()
             },
@@ -464,7 +469,9 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         uiActive = true;
         active = true;
 
-        if (!EditMode)
+        if (EditMode)
+            meidoManager.CallMeidos();
+        else
         {
             // TODO: Rework this to not use null propagation (UNT008)
             var dailyPanel = GameObject.Find("UI Root")?.transform.Find("DailyPanel")?.gameObject;
@@ -472,8 +479,6 @@ public class MeidoPhotoStudio : BaseUnityPlugin
             if (dailyPanel)
                 dailyPanel.SetActive(false);
         }
-        else
-            meidoManager.CallMeidos();
     }
 
     private void Deactivate(bool force = false)
@@ -492,6 +497,7 @@ public class MeidoPhotoStudio : BaseUnityPlugin
         if (force)
         {
             Exit();
+
             return;
         }
 

+ 5 - 5
src/MeidoPhotoStudio.Plugin/MenuFileCache.cs

@@ -22,11 +22,11 @@ public class MenuFileCache
         get => modItems[menu];
         set
         {
-            if (!modItems.ContainsKey(menu))
-            {
-                rebuild = true;
-                modItems[menu] = value;
-            }
+            if (modItems.ContainsKey(menu))
+                return;
+
+            rebuild = true;
+            modItems[menu] = value;
         }
     }
 

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

@@ -57,6 +57,7 @@ public static class MenuFileUtility
         if (fileStream.Length is 0)
         {
             Utility.LogWarning($"Mod menu file '{filename}' is invalid");
+
             return null;
         }
 
@@ -182,6 +183,7 @@ public static class MenuFileUtility
         catch (Exception e)
         {
             Utility.LogError($"Could not read mod menu file '{modMenuFile} because {e.Message}'");
+
             return false;
         }
 
@@ -256,8 +258,8 @@ public static class MenuFileUtility
     {
         menu = Path.GetFileNameWithoutExtension(menu).ToLower();
 
-        return !(menu.EndsWith("_del") || menu.Contains("zurashi") || menu.Contains("mekure")
-            || menu.Contains("porori") || menu.Contains("moza") || menu.Contains("folder"));
+        return !(menu.EndsWith("_del") || menu.Contains("zurashi") || menu.Contains("mekure") || menu.Contains("porori")
+            || menu.Contains("moza") || menu.Contains("folder"));
     }
 
     private static IEnumerator CheckMenuDataBaseJob()

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

@@ -177,9 +177,9 @@ public static class ModelUtility
 
     private static IEnumerable<Renderer> GetRenderers(GameObject gameObject) =>
         gameObject.transform
-        .GetComponentsInChildren<Transform>(true)
-        .Select(transform => transform.GetComponent<Renderer>())
-        .Where(renderer => renderer && renderer.material).ToList();
+            .GetComponentsInChildren<Transform>(true)
+            .Select(transform => transform.GetComponent<Renderer>())
+            .Where(renderer => renderer && renderer.material).ToList();
 
     private static GameObject CreateSeed() =>
         Object.Instantiate(Resources.Load<GameObject>("seed"));
@@ -565,7 +565,7 @@ public static class ModelUtility
                             case "色設定":
                                 material.SetColor(
                                     data[1],
-                                    new Color(
+                                    new(
                                         float.Parse(data[2]) / 255f, float.Parse(data[3]) / 255f,
                                         float.Parse(data[4]) / 255f, float.Parse(data[5]) / 255f
                                     )

+ 6 - 18
src/MeidoPhotoStudio.Plugin/MyGui.cs

@@ -26,25 +26,19 @@ public static class MpsGui
         lineStyleWhite = new(GUI.skin.box)
         {
             margin = new(0, 0, 8, 8),
-            normal = {
-                background = Utility.MakeTex(2, 2, new(1f, 1f, 1f, 0.2f)),
-            },
+            normal = { background = Utility.MakeTex(2, 2, new(1f, 1f, 1f, 0.2f)) },
         };
 
         lineStyleWhite.padding = lineStyleWhite.border = new(0, 0, 1, 1);
 
         lineStyleBlack = new(lineStyleWhite)
         {
-            normal = {
-                background = Utility.MakeTex(2, 2, new(0f, 0f, 0f, 0.3f)),
-            },
+            normal = { background = Utility.MakeTex(2, 2, new(0f, 0f, 0f, 0.3f)) },
         };
 
         textureBoxStyle = new(GUI.skin.box)
         {
-            normal = {
-                background = Utility.MakeTex(2, 2, new(0f, 0f, 0f, 0f)),
-            },
+            normal = { background = Utility.MakeTex(2, 2, new(0f, 0f, 0f, 0f)) },
         };
 
         textureBoxStyle.padding = textureBoxStyle.margin = new(0, 0, 0, 0);
@@ -52,9 +46,7 @@ public static class MpsGui
         headerLabelStyle = new(GUI.skin.label)
         {
             padding = new(7, 0, 0, -5),
-            normal = {
-                textColor = Color.white,
-            },
+            normal = { textColor = Color.white },
             fontSize = 14,
         };
 
@@ -62,17 +54,13 @@ public static class MpsGui
         {
             alignment = TextAnchor.LowerLeft,
             fontSize = 13,
-            normal = {
-                textColor = Color.white,
-            },
+            normal = { textColor = Color.white },
         };
 
         SliderStyle = new(GUI.skin.horizontalSlider);
         SliderStyleNoLabel = new(SliderStyle)
         {
-            margin = {
-                top = 10,
-            },
+            margin = { top = 10 },
         };
 
         SliderTextBoxStyle = new(GUI.skin.textField)

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

@@ -27,16 +27,18 @@ public class EffectManagerSerializer : Serializer<EffectManager>
     {
         _ = reader.ReadVersion();
 
-        var headerToManager = GetEffectManagers(manager).ToDictionary(
+        var headerToManager =
+            GetEffectManagers(manager).ToDictionary(
                 x => (string)x.Key.GetField("header").GetValue(null),
                 y => y.Value
-                );
+            );
 
         string header;
 
         while ((header = reader.ReadString()) != EffectManager.footer)
         {
             var effectManager = headerToManager[header];
+
             Serialization.Get(effectManager.GetType()).Deserialize(effectManager, reader, metadata);
         }
     }

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

@@ -39,9 +39,8 @@ public class EnvironmentManagerSerializer : Serializer<EnvironmentManager>
             ? Constants.MyRoomCustomBGList.ConvertAll(kvp => kvp.Key)
             : Constants.BGList;
 
-        var assetIndex = bgList.FindIndex(
-            asset => asset.Equals(bgAsset, StringComparison.InvariantCultureIgnoreCase)
-        );
+        var assetIndex =
+            bgList.FindIndex(asset => asset.Equals(bgAsset, StringComparison.InvariantCultureIgnoreCase));
 
         var validBg = assetIndex >= 0;
 

+ 2 - 3
src/MeidoPhotoStudio.Plugin/Translation.cs

@@ -82,9 +82,8 @@ public static class Translation
                 {
                     var token = translationProp.Value;
 
-                    Translations[translationProp.Path] = new(
-                        token.ToObject<Dictionary<string, string>>(), StringComparer.InvariantCultureIgnoreCase
-                    );
+                    Translations[translationProp.Path] =
+                        new(token.ToObject<Dictionary<string, string>>(), StringComparer.InvariantCultureIgnoreCase);
                 }
             }
             catch

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

@@ -13,8 +13,8 @@ public static class Utility
 {
     public enum ModKey { Control, Shift, Alt }
 
-    private const BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic
-        | BindingFlags.Static;
+    private const BindingFlags bindingFlags =
+        BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static;
 
     public static readonly BepInEx.Logging.ManualLogSource Logger =
         BepInEx.Logging.Logger.CreateLogSource(MeidoPhotoStudio.pluginName);
@@ -27,9 +27,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
-    );
+    internal static readonly Regex guidRegEx =
+        new(@"^[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;
 
@@ -120,9 +119,7 @@ public static class Utility
 
     public static string ScreenshotFilename()
     {
-        var screenShotDir = Path.Combine(
-            GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "ScreenShot"
-        );
+        var screenShotDir = Path.Combine(GameMain.Instance.SerializeStorageManager.StoreDirectoryPath, "ScreenShot");
 
         if (!Directory.Exists(screenShotDir))
             Directory.CreateDirectory(screenShotDir);
@@ -172,13 +169,13 @@ public static class Utility
 
     public static string GP01FbFaceHash(TMorph face, string hash)
     {
-        if (face.bodyskin.PartsVersion >= 120 && hash is not "eyeclose3" && hash.StartsWith("eyeclose"))
-        {
-            if (hash is "eyeclose")
-                hash += '1';
+        if (face.bodyskin.PartsVersion < 120 || hash is "eyeclose3" || !hash.StartsWith("eyeclose"))
+            return hash;
 
-            hash += TMorph.crcFaceTypesStr[(int)face.GetFaceTypeGP01FB()];
-        }
+        if (hash is "eyeclose")
+            hash += '1';
+
+        hash += TMorph.crcFaceTypesStr[(int)face.GetFaceTypeGP01FB()];
 
         return hash;
     }
@@ -400,9 +397,7 @@ public static class BinaryExtensions
         new(binaryReader.ReadSingle(), binaryReader.ReadSingle(), binaryReader.ReadSingle());
 
     public static Vector4 ReadVector4(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, Quaternion quaternion)
     {