Browse Source

More cleanup

I really really hope nothing is broken.
habeebweeb 4 years ago
parent
commit
0d10582a36
58 changed files with 319 additions and 491 deletions
  1. 18 27
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Constants.cs
  2. 6 7
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/DragPoint/DragPointLight.cs
  3. 2 3
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/DragPoint/DragPointOther.cs
  4. 6 13
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Controls/DropDown.cs
  5. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Controls/KeyRebindButton.cs
  6. 5 5
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/AttachPropPane.cs
  7. 6 6
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/ModPropsPane.cs
  8. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/PropManagerPane.cs
  9. 5 9
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/PropsPane.cs
  10. 3 3
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/DragPointPane.cs
  11. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs
  12. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/DepthOfFieldPane.cs
  13. 2 2
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/EffectsPane.cs
  14. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/FogPane.cs
  15. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/VignettePane.cs
  16. 4 4
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/LightsPane.cs
  17. 2 8
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BasePane.cs
  18. 1 2
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/CallWindowPanes/MaidSelectorPane.cs
  19. 12 17
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/FaceWindowPanes/MaidFaceBlendPane.cs
  20. 3 3
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/FaceWindowPanes/MaidFaceSliderPane.cs
  21. 4 6
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/FaceWindowPanes/SaveFacePane.cs
  22. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BG2WindowPane.cs
  23. 3 4
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/CallWindowPane.cs
  24. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/FaceWindowPane.cs
  25. 4 4
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/PoseWindowPane.cs
  26. 13 13
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/SettingsWindowPane.cs
  27. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/OtherPanes/MaidSwitcherPane.cs
  28. 1 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/OtherPanes/TabsPane.cs
  29. 5 8
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/CopyPosePane.cs
  30. 0 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/GravityControlPane.cs
  31. 3 3
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/MaidDressingPane.cs
  32. 6 13
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/MaidPoseSelectorPane.cs
  33. 5 7
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/SaveHandPane.cs
  34. 5 7
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/SavePosePane.cs
  35. 2 2
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/MainWindow.cs
  36. 3 3
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/MessageWindow.cs
  37. 3 4
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/SceneModalWindow.cs
  38. 2 0
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/LexicographicStringComparer.cs
  39. 4 16
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManager.cs
  40. 4 13
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/InputManager.cs
  41. 9 33
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/LightManager.cs
  42. 11 20
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/MeidoManager.cs
  43. 1 2
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/MessageWindowManager.cs
  44. 17 27
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/PropManager.cs
  45. 5 12
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/SceneManager.cs
  46. 4 16
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/WindowManager.cs
  47. 15 18
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointChain.cs
  48. 9 11
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointFinger.cs
  49. 2 2
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointHead.cs
  50. 3 8
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointPelvis.cs
  51. 8 8
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointSpine.cs
  52. 6 11
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointTorso.cs
  53. 21 28
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/Meido.cs
  54. 5 8
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/MeidoDragPointManager.cs
  55. 4 5
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MeidoPhotoStudio.cs
  56. 3 9
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MenuFileCache.cs
  57. 43 48
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MenuFileUtility.cs
  58. 2 2
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MiscGUI.cs

+ 18 - 27
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Constants.cs

@@ -308,9 +308,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             // Load Poses
             string poseListJson = File.ReadAllText(Path.Combine(configPath, "Database\\mm_pose_list.json"));
-            List<SerializePoseList> poseLists = JsonConvert.DeserializeObject<List<SerializePoseList>>(poseListJson);
-
-            foreach (SerializePoseList poseList in poseLists)
+            foreach (SerializePoseList poseList in JsonConvert.DeserializeObject<List<SerializePoseList>>(poseListJson))
             {
                 PoseDict[poseList.UIName] = poseList.PoseList;
                 PoseGroupList.Add(poseList.UIName);
@@ -453,10 +451,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             // Load BGs
             PhotoBGData.Create();
-            List<PhotoBGData> photList = PhotoBGData.data;
 
             // COM3D2 BGs
-            foreach (PhotoBGData bgData in photList)
+            foreach (PhotoBGData bgData in PhotoBGData.data)
             {
                 if (!string.IsNullOrEmpty(bgData.create_prefab_name))
                 {
@@ -540,8 +537,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 doguHashSet.UnionWith(doguList);
             }
 
-            string[] com3d2BgList = GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
-            foreach (string path in com3d2BgList)
+            foreach (string path in GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile))
             {
                 if (Path.GetExtension(path) == ".asset_bg" && !path.Contains("myroomcustomize"))
                 {
@@ -560,8 +556,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             DoguList.AddRange(JsonConvert.DeserializeObject<IEnumerable<string>>(doguExtendJson));
 
-            string[] cm3d2BgList = GameUty.FileSystemOld.GetList("bg", AFileSystemBase.ListType.AllFile);
-            foreach (string path in cm3d2BgList)
+            foreach (string path in GameUty.FileSystemOld.GetList("bg", AFileSystemBase.ListType.AllFile))
             {
                 if (Path.GetExtension(path) == ".asset_bg")
                 {
@@ -840,13 +835,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public static List<ModItem> GetModPropList(string category)
         {
-            if (!PropManager.ModItemsOnly)
+            if (!PropManager.ModItemsOnly && !MenuFilesReady)
             {
-                if (!MenuFilesReady)
-                {
-                    Utility.LogMessage("Menu files are not ready yet");
-                    return null;
-                }
+                Utility.LogMessage("Menu files are not ready yet");
+                return null;
             }
 
             if (!MenuFilesInitialized) InitializeModProps();
@@ -876,23 +868,21 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                             Utility.LogWarning($"Could not find icon '{iconFile}' for menu '{item.MenuFile}");
                             return true;
                         }
-                        else
+
+                        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}");
+                                return true;
                             }
                         }
                         item.Icon = icon;
@@ -913,7 +903,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                     AFileBase file = fs.FileOpen(nei);
                     CsvParser csvParser = new CsvParser();
                     if (csvParser.Open(file)) return csvParser;
-                    else file?.Dispose();
+
+                    file?.Dispose();
                 }
             }
             catch { }

+ 6 - 7
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/DragPoint/DragPointLight.cs

@@ -1,4 +1,3 @@
-using System;
 using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
@@ -16,10 +15,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             LightRotX, LightRotY, Intensity, ShadowStrength, SpotAngle, Range, Red, Green, Blue
         }
 
-        public bool IsActiveLight { get; set; } = false;
-        public string Name { get; private set; } = String.Empty;
-        public bool IsMain { get; set; } = false;
-        public MPSLightType SelectedLightType { get; private set; } = MPSLightType.Normal;
+        public bool IsActiveLight { get; set; }
+        public string Name { get; private set; } = string.Empty;
+        public bool IsMain { get; set; }
+        public MPSLightType SelectedLightType { get; private set; }
         public LightProperty CurrentLightProperty => LightProperties[(int)SelectedLightType];
         private readonly LightProperty[] LightProperties = new LightProperty[]
         {
@@ -27,7 +26,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             new LightProperty(),
             new LightProperty()
         };
-        private bool isDisabled = false;
+        private bool isDisabled;
         public bool IsDisabled
         {
             get => isDisabled;
@@ -37,7 +36,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 light.gameObject.SetActive(!isDisabled);
             }
         }
-        private bool isColourMode = false;
+        private bool isColourMode;
         public bool IsColourMode
         {
             get => IsMain && isColourMode && SelectedLightType == MPSLightType.Normal;

+ 2 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/DragPoint/DragPointOther.cs

@@ -1,4 +1,3 @@
-using System;
 using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.Rendering;
@@ -7,8 +6,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 {
     internal class DragPointBody : DragPointGeneral
     {
-        public bool IsCube = false;
-        private bool isIK = false;
+        public bool IsCube;
+        private bool isIK;
         public bool IsIK
         {
             get => isIK;

+ 6 - 13
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Controls/DropDown.cs

@@ -112,10 +112,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 clickedYou = false;
             }
 
-            if (showDropdown)
-            {
-                if (Event.current.type == EventType.Repaint) InitializeDropdown(dropdownStyle);
-            }
+            if (showDropdown && Event.current.type == EventType.Repaint) InitializeDropdown(dropdownStyle);
         }
 
         public override void Draw(params GUILayoutOption[] layoutOptions)
@@ -190,10 +187,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private static Vector2 scrollPos;
         private static int currentDropdownID;
         private static int selectedItemIndex;
-        private static bool initialized = false;
+        private static bool initialized;
         public static bool Visible { get; set; }
         public static bool DropdownOpen { get; private set; }
-        private static bool onScrollBar = false;
+        private static bool onScrollBar;
         public static Rect dropdownWindow;
         private static Rect dropdownScrollRect;
         private static Rect dropdownRect;
@@ -217,8 +214,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             Vector2 calculatedSize = style.CalcSize(content);
             for (int i = 1; i < list.Length; i++)
             {
-                string word = list[i];
-                content.text = word;
+                content.text = list[i];
                 Vector2 calcSize = style.CalcSize(content);
                 if (calcSize.x > calculatedSize.x) calculatedSize = calcSize;
             }
@@ -267,12 +263,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public static void HandleDropdown()
         {
             dropdownWindow = GUI.Window(Constants.dropdownWindowID, dropdownWindow, GUIFunc, "", windowStyle);
-            if (Input.mouseScrollDelta.y != 0f)
+            if (Input.mouseScrollDelta.y != 0f && Visible && dropdownWindow.Contains(Event.current.mousePosition))
             {
-                if (Visible && dropdownWindow.Contains(Event.current.mousePosition))
-                {
-                    Input.ResetInputAxes();
-                }
+                Input.ResetInputAxes();
             }
         }
 

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Controls/KeyRebindButton.cs

@@ -6,7 +6,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     internal class KeyRebindButton : BaseControl
     {
         private readonly Button button;
-        private bool listening = false;
+        private bool listening;
         private KeyCode keyCode;
         public KeyCode KeyCode
         {

+ 5 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/AttachPropPane.cs

@@ -35,11 +35,11 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Button previousMaidButton;
         private readonly Button nextMaidButton;
         private readonly Dropdown meidoDropdown;
-        private bool meidoDropdownActive = false;
-        private bool doguDropdownActive = false;
+        private bool meidoDropdownActive;
+        private bool doguDropdownActive;
         private bool PaneActive => meidoDropdownActive && doguDropdownActive;
         private string header;
-        private int selectedMaid = 0;
+        private int selectedMaid;
 
         public AttachPropPane(MeidoManager meidoManager, PropManager propManager)
         {
@@ -96,8 +96,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 GUILayout.Width(dropdownButtonWidth)
             };
 
-            MiscGUI.Header(header);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(header);
+            MpsGui.WhiteLine();
 
             GUI.enabled = PaneActive;
 

+ 6 - 6
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/ModPropsPane.cs

@@ -12,14 +12,14 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Toggle modFilterToggle;
         private readonly Toggle baseFilterToggle;
         private Vector2 propListScrollPos;
-        private string SelectedCategory => MenuCategories[this.propCategoryDropdown.SelectedItemIndex];
+        private string SelectedCategory => MenuCategories[propCategoryDropdown.SelectedItemIndex];
         private List<ModItem> modPropList;
         private string currentCategory;
-        private bool modItemsReady = false;
-        private bool shouldDraw = false;
-        private int categoryIndex = 0;
-        private bool modFilter = false;
-        private bool baseFilter = false;
+        private bool modItemsReady;
+        private bool shouldDraw;
+        private int categoryIndex;
+        private bool modFilter;
+        private bool baseFilter;
         private int currentListCount;
         private readonly bool isModsOnly = PropManager.ModItemsOnly;
         private enum FilterType

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/PropManagerPane.cs

@@ -97,7 +97,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 GUILayout.Width(dropdownButtonWidth)
             };
 
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
 
             GUI.enabled = propManager.DoguCount > 0;
 

+ 5 - 9
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindow2Panes/PropsPane.cs

@@ -8,7 +8,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     {
         private readonly PropManager propManager;
         private string currentCategory;
-        private string SelectedCategory => Constants.DoguCategories[this.doguCategoryDropdown.SelectedItemIndex];
+        private string SelectedCategory => Constants.DoguCategories[doguCategoryDropdown.SelectedItemIndex];
         private readonly Dropdown doguCategoryDropdown;
         private readonly Dropdown doguDropdown;
         private readonly Button addDoguButton;
@@ -16,7 +16,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Button prevDoguButton;
         private readonly Button nextDoguCategoryButton;
         private readonly Button prevDoguCategoryButton;
-        private static bool handItemsReady = false;
+        private static bool handItemsReady;
         private bool itemSelectorEnabled = true;
 
         public PropsPane(PropManager propManager)
@@ -63,10 +63,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
                 translationArray = new[] { Translation.Get("systemMessage", "initializing") };
             }
-            else
-            {
-                translationArray = GetTranslations(category);
-            }
+            else translationArray = GetTranslations(category);
+
             doguDropdown.SetDropdownItems(translationArray);
         }
 
@@ -143,9 +141,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 itemList = itemList.Select(item =>
                 {
                     string handItemAsOdogu = Utility.HandItemToOdogu(item);
-
-                    if (Translation.Has("propNames", handItemAsOdogu)) return handItemAsOdogu;
-                    else return item;
+                    return Translation.Has("propNames", handItemAsOdogu) ? handItemAsOdogu : item;
                 });
             }
 

+ 3 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/DragPointPane.cs

@@ -12,7 +12,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private enum Setting
         {
             Prop, Maid, Background, Size
-        };
+        }
 
         public DragPointPane()
         {
@@ -39,8 +39,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
-            MiscGUI.Header(header);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(header);
+            MpsGui.WhiteLine();
 
             GUILayout.BeginHorizontal();
             propsCubeToggle.Draw();

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/BloomPane.cs

@@ -78,7 +78,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void DrawPane()
         {
-            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+            GUILayoutOption sliderWidth = MpsGui.HalfSlider;
 
             GUILayout.BeginHorizontal();
             intensitySlider.Draw(sliderWidth);

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/DepthOfFieldPane.cs

@@ -47,7 +47,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             focalLengthSlider.Draw();
 
-            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+            GUILayoutOption sliderWidth = MpsGui.HalfSlider;
 
             GUILayout.BeginHorizontal();
             focalSizeSlider.Draw(sliderWidth);

+ 2 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/EffectsPane.cs

@@ -44,8 +44,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public override void Draw()
         {
-            MiscGUI.Header("Effects");
-            MiscGUI.WhiteLine();
+            MpsGui.Header("Effects");
+            MpsGui.WhiteLine();
             effectToggles.Draw();
             currentEffectPane.Draw();
         }

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/FogPane.cs

@@ -92,7 +92,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void DrawPane()
         {
-            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+            GUILayoutOption sliderWidth = MpsGui.HalfSlider;
 
             GUILayout.BeginHorizontal();
             distanceSlider.Draw(sliderWidth);

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/EffectsPanes/VignettePane.cs

@@ -56,7 +56,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void DrawPane()
         {
-            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+            GUILayoutOption sliderWidth = MpsGui.HalfSlider;
 
             GUILayout.BeginHorizontal();
             intensitySlider.Draw(sliderWidth);

+ 4 - 4
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BackgroundWindowPanes/LightsPane.cs

@@ -19,7 +19,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly SelectionGrid lightTypeGrid;
         private readonly Toggle colorToggle;
         private readonly Toggle disableToggle;
-        private MPSLightType currentLightType = MPSLightType.Normal;
+        private MPSLightType currentLightType;
         private string lightHeader;
         private static readonly Dictionary<LightProp, SliderProp> LightSliderProp =
             new Dictionary<LightProp, SliderProp>()
@@ -233,8 +233,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             bool isMain = lightManager.SelectedLightIndex == 0;
 
-            MiscGUI.Header(lightHeader);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(lightHeader);
+            MpsGui.WhiteLine();
 
             GUILayout.BeginHorizontal();
             lightDropdown.Draw(GUILayout.Width(84));
@@ -282,7 +282,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 LightSlider[LightProp.SpotAngle].Draw();
             }
 
-            GUILayoutOption sliderWidth = MiscGUI.HalfSlider;
+            GUILayoutOption sliderWidth = MpsGui.HalfSlider;
             GUILayout.BeginHorizontal();
             LightSlider[LightProp.Red].Draw(sliderWidth);
             LightSlider[LightProp.Green].Draw(sliderWidth);

+ 2 - 8
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/BasePane.cs

@@ -17,15 +17,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             Controls = new List<BaseControl>();
         }
 
-        ~BasePane()
-        {
-            Translation.ReloadTranslationEvent -= OnReloadTranslation;
-        }
+        ~BasePane() => Translation.ReloadTranslationEvent -= OnReloadTranslation;
 
-        private void OnReloadTranslation(object sender, EventArgs args)
-        {
-            ReloadTranslation();
-        }
+        private void OnReloadTranslation(object sender, EventArgs args) => ReloadTranslation();
 
         public void SetParent(BaseWindow window) => parent = window;
 

+ 1 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/CallWindowPanes/MaidSelectorPane.cs

@@ -1,4 +1,3 @@
-using System.Collections.Generic;
 using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
@@ -9,7 +8,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private Vector2 maidListScrollPos;
         private readonly Button clearMaidsButton;
         private readonly Button callMaidsButton;
-        public MaidSelectorPane(MeidoManager meidoManager) : base()
+        public MaidSelectorPane(MeidoManager meidoManager)
         {
             this.meidoManager = meidoManager;
             clearMaidsButton = new Button(Translation.Get("maidCallWindow", "clearButton"));

+ 12 - 17
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/FaceWindowPanes/MaidFaceBlendPane.cs

@@ -16,16 +16,12 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Button facePrevButton;
         private readonly Button faceNextButton;
         private static readonly string[] tabTranslations = { "baseTab", "customTab" };
-        private bool facePresetMode = false;
-        private bool faceListEnabled = false;
-        private Dictionary<string, List<string>> CurrentFaceDict
-        {
-            get => facePresetMode ? Constants.CustomFaceDict : Constants.FaceDict;
-        }
-        private List<string> CurrentFaceGroupList
-        {
-            get => facePresetMode ? Constants.CustomFaceGroupList : Constants.FaceGroupList;
-        }
+        private bool facePresetMode;
+        private bool faceListEnabled;
+        private Dictionary<string, List<string>> CurrentFaceDict => facePresetMode
+            ? Constants.CustomFaceDict : Constants.FaceDict;
+        private List<string> CurrentFaceGroupList => facePresetMode
+            ? Constants.CustomFaceGroupList : Constants.FaceGroupList;
         private string SelectedFaceGroup => CurrentFaceGroupList[faceBlendCategoryDropdown.SelectedItemIndex];
         private List<string> CurrentFaceList => CurrentFaceDict[SelectedFaceGroup];
         private int SelectedFaceIndex => faceBlendDropdown.SelectedItemIndex;
@@ -109,7 +105,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             faceBlendSourceGrid.Draw();
 
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
 
             GUILayout.BeginHorizontal();
             prevCategoryButton.Draw(arrowLayoutOptions);
@@ -128,13 +124,12 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         private string[] UIFaceList()
         {
-            if (CurrentFaceList.Count == 0) return new[] { "No Face Presets" };
-            else
-            {
-                return CurrentFaceList.Select(face => facePresetMode
-                    ? Path.GetFileNameWithoutExtension(face) : Translation.Get("faceBlendPresetsDropdown", face)
+            return CurrentFaceList.Count == 0
+                ? (new[] { "No Face Presets" })
+                : CurrentFaceList.Select(face => facePresetMode
+                    ? Path.GetFileNameWithoutExtension(face)
+                    : Translation.Get("faceBlendPresetsDropdown", face)
                 ).ToArray();
-            }
         }
 
         private void SaveFaceEnd(object sender, CustomPoseEventArgs args)

+ 3 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/FaceWindowPanes/MaidFaceSliderPane.cs

@@ -60,7 +60,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         };
         private readonly MeidoManager meidoManager;
         private readonly Dictionary<string, BaseControl> faceControls;
-        private bool hasTangOpen = false;
+        private bool hasTangOpen;
 
         public MaidFaceSliderPane(MeidoManager meidoManager)
         {
@@ -142,7 +142,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             DrawSliders("mouthhe", "mouthuphalf");
             DrawSliders("tangout", "tangup");
             if (hasTangOpen) DrawSliders("tangopen");
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
             DrawToggles("hoho2", "shock", "nosefook");
             DrawToggles("namida", "yodare", "toothoff");
             DrawToggles("tear1", "tear2", "tear3");
@@ -155,7 +155,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GUILayout.BeginHorizontal();
             foreach (string key in keys)
             {
-                ((Slider)faceControls[key]).Draw(MiscGUI.HalfSlider);
+                ((Slider)faceControls[key]).Draw(MpsGui.HalfSlider);
             }
             GUILayout.EndHorizontal();
         }

+ 4 - 6
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/FaceWindowPanes/SaveFacePane.cs

@@ -13,10 +13,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public SaveFacePane(MeidoManager meidoManager)
         {
-            Constants.CustomFaceChange += (s, a) =>
-            {
-                categoryComboBox.SetDropdownItems(Constants.CustomFaceGroupList.ToArray());
-            };
+            Constants.CustomFaceChange += (s, a)
+                => categoryComboBox.SetDropdownItems(Constants.CustomFaceGroupList.ToArray());
 
             this.meidoManager = meidoManager;
 
@@ -41,10 +39,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             GUI.enabled = meidoManager.HasActiveMeido;
 
-            MiscGUI.Header(categoryHeader);
+            MpsGui.Header(categoryHeader);
             categoryComboBox.Draw(GUILayout.Width(165f));
 
-            MiscGUI.Header(nameHeader);
+            MpsGui.Header(nameHeader);
             GUILayout.BeginHorizontal();
             faceNameTextField.Draw(GUILayout.Width(160f));
             saveFaceButton.Draw(GUILayout.ExpandWidth(false));

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/BG2WindowPane.cs

@@ -38,7 +38,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             tabsPane.Draw();
             propTabs.Draw();
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
             currentPropsPane.Draw();
             if (propTabs.SelectedItemIndex == 0)
             {

+ 3 - 4
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/CallWindowPane.cs

@@ -18,10 +18,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             Controls.Add(placementDropdown);
 
             placementOKButton = new Button(Translation.Get("maidCallWindow", "okButton"));
-            placementOKButton.ControlEvent += (o, a) =>
-            {
-                this.meidoManager.PlaceMeidos(MaidPlacementUtility.placementTypes[placementDropdown.SelectedItemIndex]);
-            };
+            placementOKButton.ControlEvent += (o, a) => this.meidoManager.PlaceMeidos(
+                MaidPlacementUtility.placementTypes[placementDropdown.SelectedItemIndex]
+            );
             Controls.Add(placementOKButton);
 
             maidSelectorPane = AddPane(new MaidSelectorPane(this.meidoManager));

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

@@ -10,7 +10,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly MaidSwitcherPane maidSwitcherPane;
         private readonly SaveFacePane saveFacePane;
         private readonly Toggle saveFaceToggle;
-        private bool saveFaceMode = false;
+        private bool saveFaceMode;
 
         public FaceWindowPane(MeidoManager meidoManager, MaidSwitcherPane maidSwitcherPane)
         {

+ 4 - 4
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/PoseWindowPane.cs

@@ -98,17 +98,17 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             maidDressingPane.Draw();
 
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
 
             maidIKPane.Draw();
 
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
 
             gravityControlPane.Draw();
 
             GUI.enabled = meidoManager.HasActiveMeido;
-            MiscGUI.Header(handPresetHeader);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(handPresetHeader);
+            MpsGui.WhiteLine();
             saveHandToggle.Draw();
             GUI.enabled = true;
 

+ 13 - 13
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/MainWindowPanes/SettingsWindowPane.cs

@@ -64,42 +64,42 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             scrollPos = GUILayout.BeginScrollView(scrollPos);
 
-            MiscGUI.Header(headers["controls"]);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(headers["controls"]);
+            MpsGui.WhiteLine();
 
-            MiscGUI.Header(headers["controlsGeneral"]);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(headers["controlsGeneral"]);
+            MpsGui.WhiteLine();
             for (MpsKey key = MpsKey.Activate; key <= MpsKey.ToggleMessage; key++)
             {
                 DrawSetting(key);
             }
 
-            MiscGUI.Header(headers["controlsMaids"]);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(headers["controlsMaids"]);
+            MpsGui.WhiteLine();
             DrawSetting(MpsKey.MeidoUndressing);
 
-            MiscGUI.Header(headers["controlsCamera"]);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(headers["controlsCamera"]);
+            MpsGui.WhiteLine();
             for (MpsKey key = MpsKey.CameraLayer; key <= MpsKey.CameraLoad; key++)
             {
                 DrawSetting(key);
             }
 
-            MiscGUI.Header(headers["controlsDragPoint"]);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(headers["controlsDragPoint"]);
+            MpsGui.WhiteLine();
             for (MpsKey key = MpsKey.DragSelect; key <= MpsKey.DragFinger; key++)
             {
                 DrawSetting(key);
             }
 
-            MiscGUI.Header(headers["controlsScene"]);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(headers["controlsScene"]);
+            MpsGui.WhiteLine();
             for (MpsKey key = MpsKey.SaveScene; key <= MpsKey.OpenSceneManager; key++)
             {
                 DrawSetting(key);
             }
 
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
             reloadTranslationButton.Draw();
             GUILayout.EndScrollView();
         }

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/OtherPanes/MaidSwitcherPane.cs

@@ -33,7 +33,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             PreviousButton.Draw(buttonStyle, GUILayout.Height(40), GUILayout.ExpandWidth(false));
 
             if (meidoManager.HasActiveMeido)
-                MiscGUI.DrawTexture(meidoManager.ActiveMeido.Portrait, GUILayout.Width(70), GUILayout.Height(70));
+                MpsGui.DrawTexture(meidoManager.ActiveMeido.Portrait, GUILayout.Width(70), GUILayout.Height(70));
             else
                 GUILayout.Box("", boxStyle, GUILayout.Height(70), GUILayout.Width(70));
 

+ 1 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/OtherPanes/TabsPane.cs

@@ -39,7 +39,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public override void Draw()
         {
             Tabs.Draw(GUILayout.ExpandWidth(false));
-            MiscGUI.BlackLine();
+            MpsGui.BlackLine();
         }
     }
 }

+ 5 - 8
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/CopyPosePane.cs

@@ -11,12 +11,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Dropdown meidoDropdown;
         private int[] copyMeidoSlot;
         private bool PlentyOfMaids => meidoManager.ActiveMeidoList.Count >= 2;
-        private Meido FromMeido
-        {
-            get => meidoManager.HasActiveMeido
-                ? meidoManager.ActiveMeidoList[copyMeidoSlot[meidoDropdown.SelectedItemIndex]]
-                : null;
-        }
+        private Meido FromMeido => meidoManager.HasActiveMeido
+            ? meidoManager.ActiveMeidoList[copyMeidoSlot[meidoDropdown.SelectedItemIndex]]
+            : null;
         private string copyIKHeader;
 
         public CopyPosePane(MeidoManager meidoManager)
@@ -45,8 +42,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             GUI.enabled = PlentyOfMaids;
 
-            MiscGUI.Header(copyIKHeader);
-            MiscGUI.WhiteLine();
+            MpsGui.Header(copyIKHeader);
+            MpsGui.WhiteLine();
 
             GUILayout.BeginHorizontal();
             meidoDropdown.Draw(GUILayout.Width(160f));

+ 0 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/GravityControlPane.cs

@@ -1,4 +1,3 @@
-using System.Collections.Generic;
 using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin

+ 3 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/MaidDressingPane.cs

@@ -37,7 +37,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Toggle curlingFrontToggle;
         private readonly Toggle curlingBackToggle;
         private readonly Toggle pantsuShiftToggle;
-        private bool detailedClothing = false;
+        private bool detailedClothing;
 
         public MaidDressingPane(MeidoManager meidoManager)
         {
@@ -227,7 +227,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             GUI.enabled = Enabled;
             detailedClothingToggle.Draw();
-            MiscGUI.BlackLine();
+            MpsGui.BlackLine();
 
             DrawSlotGroup(SlotID.wear, SlotID.skirt);
             DrawSlotGroup(SlotID.bra, SlotID.panz);
@@ -237,7 +237,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             if (detailedClothing)
             {
-                MiscGUI.BlackLine();
+                MpsGui.BlackLine();
                 DrawSlotGroup(SlotID.accShippo, SlotID.accHat);
                 DrawSlotGroup(SlotID.accKami_1_, SlotID.accKami_2_, SlotID.accKami_3_);
                 DrawSlotGroup(SlotID.accKamiSubL, SlotID.accKamiSubR);

+ 6 - 13
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/MaidPoseSelectorPane.cs

@@ -1,4 +1,3 @@
-using System;
 using System.IO;
 using System.Collections.Generic;
 using System.Linq;
@@ -18,13 +17,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Dropdown poseDropdown;
         private readonly SelectionGrid poseModeGrid;
         private Dictionary<string, List<string>> CurrentPoseDict
-        {
-            get => customPoseMode ? Constants.CustomPoseDict : Constants.PoseDict;
-        }
+            => customPoseMode ? Constants.CustomPoseDict : Constants.PoseDict;
         private List<string> CurrentPoseGroupList
-        {
-            get => customPoseMode ? Constants.CustomPoseGroupList : Constants.PoseGroupList;
-        }
+            => customPoseMode ? Constants.CustomPoseGroupList : Constants.PoseGroupList;
         private string SelectedPoseGroup => CurrentPoseGroupList[poseGroupDropdown.SelectedItemIndex];
         private List<string> CurrentPoseList => CurrentPoseDict[SelectedPoseGroup];
         private int SelectedPoseIndex => poseDropdown.SelectedItemIndex;
@@ -95,7 +90,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GUI.enabled = meidoManager.HasActiveMeido && !meidoManager.ActiveMeido.Stop;
 
             poseModeGrid.Draw();
-            MiscGUI.WhiteLine();
+            MpsGui.WhiteLine();
 
             GUILayout.BeginHorizontal();
             poseGroupLeftButton.Draw(arrowLayoutOptions);
@@ -193,13 +188,11 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         private string[] UIPoseList()
         {
-            if (CurrentPoseList.Count == 0) return new[] { "No Poses" };
-            else
-            {
-                return CurrentPoseList
+            return CurrentPoseList.Count == 0
+                ? new[] { "No Poses" }
+                : CurrentPoseList
                     .Select((pose, i) => $"{i + 1}:{(customPoseMode ? Path.GetFileNameWithoutExtension(pose) : pose)}")
                     .ToArray();
-            }
         }
     }
 }

+ 5 - 7
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/SaveHandPane.cs

@@ -14,10 +14,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public SaveHandPane(MeidoManager meidoManager)
         {
-            Constants.CustomHandChange += (s, a) =>
-            {
-                categoryComboBox.SetDropdownItems(Constants.CustomHandGroupList.ToArray());
-            };
+            Constants.CustomHandChange += (s, a)
+                => categoryComboBox.SetDropdownItems(Constants.CustomHandGroupList.ToArray());
 
             this.meidoManager = meidoManager;
 
@@ -48,10 +46,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             GUI.enabled = meidoManager.HasActiveMeido;
 
-            MiscGUI.Header(categoryHeader);
+            MpsGui.Header(categoryHeader);
             categoryComboBox.Draw(GUILayout.Width(165f));
 
-            MiscGUI.Header(nameHeader);
+            MpsGui.Header(nameHeader);
             handNameTextField.Draw(GUILayout.Width(165f));
 
             GUILayout.BeginHorizontal();
@@ -66,7 +64,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             byte[] handBinary = meidoManager.ActiveMeido.IKManager.SerializeHand(right);
             Constants.AddHand(handBinary, right, handNameTextField.Value, categoryComboBox.Value);
-            this.handNameTextField.Value = string.Empty;
+            handNameTextField.Value = string.Empty;
         }
     }
 }

+ 5 - 7
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Panes/PoseWindowPanes/SavePosePane.cs

@@ -14,10 +14,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public SavePosePane(MeidoManager meidoManager)
         {
-            Constants.CustomPoseChange += (s, a) =>
-            {
-                categoryComboBox.SetDropdownItems(Constants.CustomPoseGroupList.ToArray());
-            };
+            Constants.CustomPoseChange += (s, a)
+                => categoryComboBox.SetDropdownItems(Constants.CustomPoseGroupList.ToArray());
 
             this.meidoManager = meidoManager;
 
@@ -43,10 +41,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             GUI.enabled = meidoManager.HasActiveMeido;
 
-            MiscGUI.Header(categoryHeader);
+            MpsGui.Header(categoryHeader);
             categoryComboBox.Draw(GUILayout.Width(160f));
 
-            MiscGUI.Header(nameHeader);
+            MpsGui.Header(nameHeader);
             GUILayout.BeginHorizontal();
             poseNameTextField.Draw(GUILayout.Width(160f));
             savePoseButton.Draw(GUILayout.ExpandWidth(false));
@@ -59,7 +57,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             byte[] anmBinary = meidoManager.ActiveMeido.SerializePose();
             Constants.AddPose(anmBinary, poseNameTextField.Value, categoryComboBox.Value);
-            this.poseNameTextField.Value = String.Empty;
+            poseNameTextField.Value = string.Empty;
         }
     }
 }

+ 2 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/MainWindow.cs

@@ -23,7 +23,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 windowRect = value;
             }
         }
-        private Constants.Window selectedWindow = Constants.Window.Call;
+        private Constants.Window selectedWindow;
 
         public BaseMainWindowPane this[Constants.Window id]
         {
@@ -32,7 +32,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
 
         // TODO: Find a better way of doing this
-        public MainWindow(MeidoManager meidoManager, PropManager propManager, LightManager lightManager) : base()
+        public MainWindow(MeidoManager meidoManager, PropManager propManager, LightManager lightManager)
         {
             this.meidoManager = meidoManager;
             this.meidoManager.UpdateMeido += UpdateMeido;

+ 3 - 3
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/MessageWindow.cs

@@ -20,9 +20,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             }
         }
         private int fontSize = 25;
-        private bool showingMessage = false;
+        private bool showingMessage;
 
-        public MessageWindow(MessageWindowManager messageWindowManager) : base()
+        public MessageWindow(MessageWindowManager messageWindowManager)
         {
             WindowRect = WindowRect;
             windowRect.x = MiddlePosition.x;
@@ -69,7 +69,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public override void Update()
         {
             base.Update();
-            if (InputManager.GetKeyDown(MpsKey.ToggleMessage)) this.ToggleVisibility();
+            if (InputManager.GetKeyDown(MpsKey.ToggleMessage)) ToggleVisibility();
         }
 
         public override void Draw()

+ 3 - 4
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/GUI/Windows/SceneModalWindow.cs

@@ -1,4 +1,3 @@
-using System;
 using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
@@ -44,8 +43,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private string infoKankyo;
         private string infoMaidSingular;
         private string infoMaidPlural;
-        private bool directoryMode = false;
-        private bool deleteScene = false;
+        private bool directoryMode;
+        private bool deleteScene;
 
         public SceneModalWindow(SceneManager sceneManager)
         {
@@ -107,7 +106,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 GUILayout.BeginHorizontal();
                 GUILayout.FlexibleSpace();
 
-                MiscGUI.DrawTexture(thumb, GUILayout.Width(width), GUILayout.Height(height));
+                MpsGui.DrawTexture(thumb, GUILayout.Width(width), GUILayout.Height(height));
 
                 GUIStyle labelStyle = new GUIStyle(GUI.skin.label)
                 {

+ 2 - 0
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/LexicographicStringComparer.cs

@@ -91,7 +91,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             return 0;
         }
 
+        /// <summary>
         /// <see cref="IComparer{T}.Compare(T, T)"/>
+        /// </summary>
         public int Compare(string x, string y)
             => Comparison(x, y);
 

+ 4 - 16
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/EffectManager.cs

@@ -20,10 +20,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
 
         public T Get<T>() where T : IEffectManager
-        {
-            if (EffectManagers.ContainsKey(typeof(T))) return (T)EffectManagers[typeof(T)];
-            else return default;
-        }
+            => EffectManagers.ContainsKey(typeof(T)) ? (T)EffectManagers[typeof(T)] : default;
 
         private T AddManager<T>() where T : IEffectManager, new()
         {
@@ -35,10 +32,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public void Serialize(System.IO.BinaryWriter binaryWriter)
         {
             binaryWriter.Write(header);
-            foreach (IEffectManager effectManager in EffectManagers.Values)
-            {
-                effectManager.Serialize(binaryWriter);
-            }
+            foreach (IEffectManager effectManager in EffectManagers.Values) effectManager.Serialize(binaryWriter);
             binaryWriter.Write(footer);
         }
 
@@ -67,18 +61,12 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public void Activate()
         {
-            foreach (IEffectManager effectManager in EffectManagers.Values)
-            {
-                effectManager.Activate();
-            }
+            foreach (IEffectManager effectManager in EffectManagers.Values) effectManager.Activate();
         }
 
         public void Deactivate()
         {
-            foreach (IEffectManager effectManager in EffectManagers.Values)
-            {
-                effectManager.Deactivate();
-            }
+            foreach (IEffectManager effectManager in EffectManagers.Values) effectManager.Deactivate();
         }
 
         public void Update()

+ 4 - 13
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/InputManager.cs

@@ -47,15 +47,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
 
         public static KeyCode Clamp(KeyCode value, KeyCode min, KeyCode max)
-        {
-            return value < min ? min : value > max ? max : value;
-        }
+            => value < min ? min : value > max ? max : value;
 
         public static KeyCode GetActionKey(MpsKey action)
-        {
-            ActionKeys.TryGetValue(action, out KeyCode keyCode);
-            return keyCode;
-        }
+            => ActionKeys.TryGetValue(action, out KeyCode keyCode) ? keyCode : default;
 
         public static void StartListening()
         {
@@ -79,14 +74,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
 
         public static bool GetKey(MpsKey action)
-        {
-            return !Listening && ActionKeys.ContainsKey(action) && Input.GetKey(ActionKeys[action]);
-        }
+            => !Listening && ActionKeys.ContainsKey(action) && Input.GetKey(ActionKeys[action]);
 
         public static bool GetKeyDown(MpsKey action)
-        {
-            return !Listening && ActionKeys.ContainsKey(action) && Input.GetKeyDown(ActionKeys[action]);
-        }
+            => !Listening && ActionKeys.ContainsKey(action) && Input.GetKeyDown(ActionKeys[action]);
 
         public static void Deactivate()
         {

+ 9 - 33
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/LightManager.cs

@@ -23,7 +23,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
         private static event EventHandler CubeActiveChange;
         private readonly List<DragPointLight> lightList = new List<DragPointLight>();
-        private int selectedLightIndex = 0;
+        private int selectedLightIndex;
         public int SelectedLightIndex
         {
             get => selectedLightIndex;
@@ -129,17 +129,11 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             OnListModified();
         }
 
-        public void SetColourModeActive(bool isColourMode)
-        {
-            lightList[0].IsColourMode = isColourMode;
-        }
+        public void SetColourModeActive(bool isColourMode) => lightList[0].IsColourMode = isColourMode;
 
         public void ClearLights()
         {
-            for (int i = lightList.Count - 1; i > 0; i--)
-            {
-                DeleteLight(i);
-            }
+            for (int i = lightList.Count - 1; i > 0; i--) DeleteLight(i);
             selectedLightIndex = 0;
         }
 
@@ -153,10 +147,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GameObject.Destroy(light.gameObject);
         }
 
-        private string LightName(string name)
-        {
-            return Translation.Get("lightType", name);
-        }
+        private string LightName(string name) => Translation.Get("lightType", name);
 
         private void OnDelete(object sender, EventArgs args)
         {
@@ -172,22 +163,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             }
         }
 
-        private void OnRotate(object sender, EventArgs args)
-        {
-            OnTransformEvent((DragPointLight)sender, Rotate);
-        }
+        private void OnRotate(object sender, EventArgs args) => OnTransformEvent((DragPointLight)sender, Rotate);
 
-        private void OnScale(object sender, EventArgs args)
-        {
-            OnTransformEvent((DragPointLight)sender, Scale);
-        }
+        private void OnScale(object sender, EventArgs args) => OnTransformEvent((DragPointLight)sender, Scale);
 
         private void OnTransformEvent(DragPointLight light, EventHandler handler)
         {
-            if (light.IsActiveLight)
-            {
-                handler?.Invoke(this, EventArgs.Empty);
-            }
+            if (light.IsActiveLight) handler?.Invoke(this, EventArgs.Empty);
         }
 
         private void OnSelect(object sender, EventArgs args)
@@ -201,17 +183,11 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             }
         }
 
-        private void OnListModified()
-        {
-            ListModified?.Invoke(this, EventArgs.Empty);
-        }
+        private void OnListModified() => ListModified?.Invoke(this, EventArgs.Empty);
 
         private void OnCubeActive(object sender, EventArgs args)
         {
-            foreach (DragPointLight dragPoint in lightList)
-            {
-                dragPoint.gameObject.SetActive(CubeActive);
-            }
+            foreach (DragPointLight dragPoint in lightList) dragPoint.gameObject.SetActive(CubeActive);
         }
     }
 }

+ 11 - 20
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/MeidoManager.cs

@@ -9,7 +9,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     {
         public const string header = "MEIDO";
         private static readonly CharacterMgr characterMgr = GameMain.Instance.CharacterMgr;
-        private int undress = 0;
+        private int undress;
         private int numberOfMeidos;
         public Meido[] Meidos { get; private set; }
         public List<int> SelectMeidoList { get; } = new List<int>();
@@ -19,14 +19,14 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public event EventHandler<MeidoUpdateEventArgs> UpdateMeido;
         public event EventHandler EndCallMeidos;
         public event EventHandler BeginCallMeidos;
-        private int selectedMeido = 0;
+        private int selectedMeido;
         public int SelectedMeido
         {
             get => selectedMeido;
             private set => selectedMeido = Utility.Bound(value, 0, ActiveMeidoList.Count - 1);
         }
         public bool Busy => ActiveMeidoList.Any(meido => meido.Busy);
-        private bool globalGravity = false;
+        private bool globalGravity;
         public bool GlobalGravity
         {
             get => globalGravity;
@@ -49,10 +49,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         static MeidoManager() => InputManager.Register(MpsKey.MeidoUndressing, KeyCode.H, "All maid undressing");
 
-        public void ChangeMaid(int index)
-        {
-            OnUpdateMeido(null, new MeidoUpdateEventArgs(index));
-        }
+        public void ChangeMaid(int index) => OnUpdateMeido(null, new MeidoUpdateEventArgs(index));
 
         public void Activate()
         {
@@ -105,7 +102,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
                 if (i >= ActiveMeidoList.Count)
                 {
-                    Int64 skip = binaryReader.ReadInt64(); // meido buffer length
+                    long skip = binaryReader.ReadInt64(); // meido buffer length
                     binaryReader.BaseStream.Seek(skip, System.IO.SeekOrigin.Current);
                     continue;
                 }
@@ -140,10 +137,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 return;
             }
 
-            GameMain.Instance.MainCamera.FadeOut(0.01f, f_bSkipable: false, f_dg: () =>
-            {
-                GameMain.Instance.StartCoroutine(LoadMeidos());
-            });
+            GameMain.Instance.MainCamera.FadeOut(
+                0.01f, f_bSkipable: false, f_dg: () => GameMain.Instance.StartCoroutine(LoadMeidos())
+            );
         }
 
         private System.Collections.IEnumerator LoadMeidos()
@@ -155,10 +151,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 meido.BeginLoad();
             }
 
-            for (int i = 0; i < ActiveMeidoList.Count; i++)
-            {
-                ActiveMeidoList[i].Load(i);
-            }
+            for (int i = 0; i < ActiveMeidoList.Count; i++) ActiveMeidoList[i].Load(i);
 
             while (Busy) yield return null;
 
@@ -169,14 +162,12 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public Meido GetMeido(string guid)
         {
-            if (string.IsNullOrEmpty(guid)) return null;
-            else return ActiveMeidoList.Find(meido => meido.Maid.status.guid == guid);
+            return string.IsNullOrEmpty(guid) ? null : ActiveMeidoList.Find(meido => meido.Maid.status.guid == guid);
         }
 
         public Meido GetMeido(int activeIndex)
         {
-            if (activeIndex >= 0 && activeIndex < ActiveMeidoList.Count) return ActiveMeidoList[activeIndex];
-            else return null;
+            return activeIndex >= 0 && activeIndex < ActiveMeidoList.Count ? ActiveMeidoList[activeIndex] : null;
         }
 
         public void PlaceMeidos(string placementType)

+ 1 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/MessageWindowManager.cs

@@ -1,4 +1,3 @@
-using System.Reflection;
 using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
@@ -83,7 +82,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 MessageWindowMgr.MessageWindowUnderButton.BackLog,
                 MessageWindowMgr.MessageWindowUnderButton.Config
             };
-            foreach (var msgButton in msgButtons)
+            foreach (MessageWindowMgr.MessageWindowUnderButton msgButton in msgButtons)
             {
                 transform.Find(msgButton.ToString()).gameObject.SetActive(!active);
             }

+ 17 - 27
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/PropManager.cs

@@ -48,21 +48,15 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public int DoguCount => doguList.Count;
         public event EventHandler DoguListChange;
         public event EventHandler DoguSelectChange;
-        public string[] PropNameList
-        {
-            get
-            {
-                return doguList.Count == 0
-                    ? new[] { Translation.Get("systemMessage", "noProps") }
-                    : doguList.Select(dogu => dogu.Name).ToArray();
-            }
-        }
-        public int CurrentDoguIndex { get; private set; } = 0;
+        public string[] PropNameList => doguList.Count == 0
+            ? new[] { Translation.Get("systemMessage", "noProps") }
+            : doguList.Select(dogu => dogu.Name).ToArray();
+        public int CurrentDoguIndex { get; private set; }
         public DragPointDogu CurrentDogu => DoguCount == 0 ? null : doguList[CurrentDoguIndex];
 
         static PropManager()
         {
-            modItemsOnly = Configuration.Config.Bind<bool>(
+            modItemsOnly = Configuration.Config.Bind(
                 "Prop", "ModItemsOnly",
                 false,
                 "Disable waiting for and loading base game clothing"
@@ -194,7 +188,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public bool SpawnModItemProp(ModItem modItem)
         {
-            GameObject dogu = MenuFileUtility.LoadModel(modItem);
+            GameObject dogu = LoadModel(modItem);
             string name = modItem.MenuFile;
             if (modItem.IsOfficialMod) name = Path.GetFileName(name);
             if (dogu != null) AttachDragPoint(dogu, modItem.ToString(), name, new Vector3(0f, 0f, 0.5f));
@@ -243,7 +237,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             if (assetName.EndsWith(".menu"))
             {
-                dogu = MenuFileUtility.LoadModel(assetName);
+                dogu = LoadModel(assetName);
                 string handItem = Utility.HandItemToOdogu(assetName);
                 if (Translation.Has("propNames", handItem)) doguName = Translation.Get("propNames", handItem);
             }
@@ -353,7 +347,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 //         }
                 //     }
                 // }
-                #endregion
+                #endregion particle system experiment
             }
 
             if (dogu != null)
@@ -361,10 +355,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 AttachDragPoint(dogu, assetName, doguName, doguPosition);
                 return true;
             }
-            else
-            {
-                Utility.LogInfo($"Could not spawn object '{assetName}'");
-            }
+
+            Utility.LogInfo($"Could not spawn object '{assetName}'");
+
             return false;
         }
 
@@ -430,8 +423,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             if (doguIndex >= 0 && doguIndex < DoguCount)
             {
-                this.CurrentDoguIndex = doguIndex;
-                this.DoguSelectChange?.Invoke(this, EventArgs.Empty);
+                CurrentDoguIndex = doguIndex;
+                DoguSelectChange?.Invoke(this, EventArgs.Empty);
             }
         }
 
@@ -473,7 +466,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             dragDogu.attachPointInfo = new AttachPointInfo(
                 attachPoint: meido == null ? AttachPoint.None : attachPoint,
-                maidGuid: meido == null ? String.Empty : meido.Maid.status.guid,
+                maidGuid: meido == null ? string.Empty : meido.Maid.status.guid,
                 maidIndex: meido == null ? -1 : meido.Slot
             );
 
@@ -528,8 +521,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
                 AttachPointInfo info = dragDogu.attachPointInfo;
                 Meido meido = useGuid
-                    ? this.meidoManager.GetMeido(info.MaidGuid)
-                    : this.meidoManager.GetMeido(info.MaidIndex);
+                    ? meidoManager.GetMeido(info.MaidGuid)
+                    : meidoManager.GetMeido(info.MaidIndex);
                 bool worldPositionStays = forceStay || meido == null;
                 AttachProp(dragDogu, dragDogu.attachPointInfo.AttachPoint, meido, worldPositionStays);
             }
@@ -571,9 +564,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             }
         }
 
-        private void OnDoguListChange()
-        {
-            this.DoguListChange?.Invoke(this, EventArgs.Empty);
-        }
+        private void OnDoguListChange() => DoguListChange?.Invoke(this, EventArgs.Empty);
     }
 }

+ 5 - 12
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/SceneManager.cs

@@ -15,7 +15,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public static readonly Vector2 sceneDimensions = new Vector2(480, 270);
         private readonly MeidoPhotoStudio meidoPhotoStudio;
         private int SortDirection => SortDescending ? -1 : 1;
-        public bool KankyoMode { get; set; } = false;
+        public bool KankyoMode { get; set; }
         private static readonly ConfigEntry<bool> sortDescending;
         public bool SortDescending
         {
@@ -26,14 +26,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public int CurrentDirectoryIndex { get; private set; } = -1;
         public string CurrentDirectoryName => CurrentDirectoryList[CurrentDirectoryIndex];
         public List<string> CurrentDirectoryList
-        {
-            get => KankyoMode ? Constants.KankyoDirectoryList : Constants.SceneDirectoryList;
-        }
+            => KankyoMode ? Constants.KankyoDirectoryList : Constants.SceneDirectoryList;
         public string CurrentBasePath => KankyoMode ? Constants.kankyoPath : Constants.scenesPath;
         public string CurrentScenesDirectory
-        {
-            get => CurrentDirectoryIndex == 0 ? CurrentBasePath : Path.Combine(CurrentBasePath, CurrentDirectoryName);
-        }
+            => CurrentDirectoryIndex == 0 ? CurrentBasePath : Path.Combine(CurrentBasePath, CurrentDirectoryName);
         private static readonly ConfigEntry<SortMode> currentSortMode;
         public SortMode CurrentSortMode
         {
@@ -174,7 +170,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
                 case SortMode.DateModified: comparator = SortByDateModified; break;
                 case SortMode.DateCreated: comparator = SortByDateCreated; break;
-                case SortMode.Name: comparator = SortByName; break;
                 default: comparator = SortByName; break;
             }
             SceneList.Sort(comparator);
@@ -232,10 +227,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private void UpdateDirectoryList()
         {
             string baseDirectoryName = KankyoMode ? Constants.kankyoDirectory : Constants.sceneDirectory;
-            CurrentDirectoryList.Sort((a, b) =>
-            {
-                return a.Equals(baseDirectoryName, StringComparison.InvariantCultureIgnoreCase) ? -1 : a.CompareTo(b);
-            });
+            CurrentDirectoryList.Sort((a, b)
+                => a.Equals(baseDirectoryName, StringComparison.InvariantCultureIgnoreCase) ? -1 : a.CompareTo(b));
         }
 
         private void ClearSceneList()

+ 4 - 16
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Managers/WindowManager.cs

@@ -26,34 +26,22 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public void DrawWindows()
         {
-            foreach (BaseWindow window in Windows.Values)
-            {
-                DrawWindow(window);
-            }
+            foreach (BaseWindow window in Windows.Values) DrawWindow(window);
         }
 
         public void Update()
         {
-            foreach (BaseWindow window in Windows.Values)
-            {
-                window.Update();
-            }
+            foreach (BaseWindow window in Windows.Values) window.Update();
         }
 
         public void Activate()
         {
-            foreach (BaseWindow window in Windows.Values)
-            {
-                window.Activate();
-            }
+            foreach (BaseWindow window in Windows.Values) window.Activate();
         }
 
         public void Deactivate()
         {
-            foreach (BaseWindow window in Windows.Values)
-            {
-                window.Deactivate();
-            }
+            foreach (BaseWindow window in Windows.Values) window.Deactivate();
         }
     }
 }

+ 15 - 18
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointChain.cs

@@ -9,33 +9,30 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Quaternion[] jointRotation = new Quaternion[3];
         private Transform[] ikChain;
         private int foot = 1;
-        private bool isLower = false;
-        private bool isMiddle = false;
-        private bool isUpper = false;
-        private bool isMune = false;
+        private bool isLower;
+        private bool isMiddle;
+        private bool isUpper;
+        private bool isMune;
 
-        public override void Set(Transform lower)
+        public override void Set(Transform myObject)
         {
-            base.Set(lower);
-            isMune = lower.name.StartsWith("Mune");
-            foot = lower.name.EndsWith("Foot") ? -1 : 1;
-            isLower = lower.name.EndsWith("Hand") || foot == -1;
-            isMiddle = lower.name.EndsWith("Calf") || lower.name.EndsWith("Forearm");
+            base.Set(myObject);
+            isMune = myObject.name.StartsWith("Mune");
+            foot = myObject.name.EndsWith("Foot") ? -1 : 1;
+            isLower = myObject.name.EndsWith("Hand") || foot == -1;
+            isMiddle = myObject.name.EndsWith("Calf") || myObject.name.EndsWith("Forearm");
             isUpper = !(isMiddle || isLower) && !isMune;
             ikChain = new Transform[] {
-                lower.parent,
-                lower.parent,
-                lower
+                myObject.parent,
+                myObject.parent,
+                myObject
             };
             if (isLower) ikChain[0] = ikChain[0].parent;
         }
 
         private void InitializeRotation()
         {
-            for (int i = 0; i < jointRotation.Length; i++)
-            {
-                jointRotation[i] = ikChain[i].localRotation;
-            }
+            for (int i = 0; i < jointRotation.Length; i++) jointRotation[i] = ikChain[i].localRotation;
         }
 
         protected override void ApplyDragType()
@@ -127,7 +124,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             if (CurrentDragType == DragType.RotLocalY)
             {
-                int joint = this.isMiddle ? jointUpper : jointLower;
+                int joint = isMiddle ? jointUpper : jointLower;
                 ikChain[joint].localRotation = jointRotation[joint];
                 ikChain[joint].Rotate(Vector3.right * (-mouseDelta.x / 1.5f));
             }

+ 9 - 11
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointFinger.cs

@@ -11,15 +11,15 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private bool baseFinger;
         private static readonly Color dragpointColour = new Color(0.1f, 0.4f, 0.95f, defaultAlpha);
 
-        public override void Set(Transform finger)
+        public override void Set(Transform myObject)
         {
-            base.Set(finger);
-            string parentName = finger.parent.name.Split(' ')[2];
+            base.Set(myObject);
+            string parentName = myObject.parent.name.Split(' ')[2];
             // Base finger names have the form 'FingerN' or 'ToeN' where N is a natural number
             baseFinger = (parentName.Length == 7) || (parentName.Length == 4);
             ikChain = new Transform[2] {
-                finger.parent,
-                finger
+                myObject.parent,
+                myObject
             };
         }
 
@@ -40,13 +40,11 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void UpdateDragType()
         {
-            if (Input.GetKey(MpsKey.DragFinger))
-            {
-                CurrentDragType = Input.Shift
+            CurrentDragType = Input.GetKey(MpsKey.DragFinger)
+                ? Input.Shift
                     ? DragType.RotLocalY
-                    : DragType.MoveXZ;
-            }
-            else CurrentDragType = DragType.None;
+                    : DragType.MoveXZ
+                : DragType.None;
         }
 
         protected override void OnMouseDown()

+ 2 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointHead.cs

@@ -76,9 +76,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         {
             if (IsIK) return;
 
-            if (!(CurrentDragType == DragType.MoveXZ || CurrentDragType == DragType.MoveY))
+            if (!(CurrentDragType == DragType.MoveXZ || CurrentDragType == DragType.MoveY) && isPlaying)
             {
-                if (isPlaying) meido.Stop = true;
+                meido.Stop = true;
             }
 
             Vector3 mouseDelta = MouseDelta();

+ 3 - 8
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointPelvis.cs

@@ -16,14 +16,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void UpdateDragType()
         {
-            if (Input.Alt && !Input.Control)
-            {
-                CurrentDragType = Input.Shift ? DragType.RotLocalY : DragType.RotLocalXZ;
-            }
-            else
-            {
-                CurrentDragType = OtherDragType() ? DragType.Ignore : DragType.None;
-            }
+            CurrentDragType = Input.Alt && !Input.Control
+                ? Input.Shift ? DragType.RotLocalY : DragType.RotLocalXZ
+                : OtherDragType() ? DragType.Ignore : DragType.None;
         }
 
         protected override void OnMouseDown()

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

@@ -6,9 +6,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     internal class DragPointSpine : DragPointMeido
     {
         private Quaternion spineRotation;
-        private bool isHip = false;
-        private bool isThigh = false;
-        private bool isHead = false;
+        private bool isHip;
+        private bool isThigh;
+        private bool isHead;
 
         public override void AddGizmo(float scale = 0.25f, CustomGizmo.GizmoMode mode = CustomGizmo.GizmoMode.Local)
         {
@@ -16,12 +16,12 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             if (isHead) Gizmo.GizmoDrag += (s, a) => meido.HeadToCam = false;
         }
 
-        public override void Set(Transform spine)
+        public override void Set(Transform myObject)
         {
-            base.Set(spine);
-            isHip = spine.name == "Bip01";
-            isThigh = spine.name.EndsWith("Thigh");
-            isHead = spine.name.EndsWith("Head");
+            base.Set(myObject);
+            isHip = myObject.name == "Bip01";
+            isThigh = myObject.name.EndsWith("Thigh");
+            isHead = myObject.name.EndsWith("Head");
         }
 
         protected override void ApplyDragType()

+ 6 - 11
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/IK/DragPointTorso.cs

@@ -10,10 +10,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private readonly Quaternion[] spineRotation = new Quaternion[4];
         private readonly Transform[] spine = new Transform[4];
 
-        public override void Set(Transform spine1a)
+        public override void Set(Transform myObject)
         {
-            base.Set(spine1a);
-            Transform spine = spine1a;
+            base.Set(myObject);
+            Transform spine = myObject;
             for (int i = 0; i < this.spine.Length; i++)
             {
                 this.spine[i] = spine;
@@ -30,14 +30,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         protected override void UpdateDragType()
         {
-            if (Input.Alt && !Input.Control)
-            {
-                CurrentDragType = Input.Shift ? DragType.RotLocalY : DragType.RotLocalXZ;
-            }
-            else
-            {
-                CurrentDragType = OtherDragType() ? DragType.Ignore : DragType.None;
-            }
+            CurrentDragType = Input.Alt && !Input.Control
+                ? Input.Shift ? DragType.RotLocalY : DragType.RotLocalXZ
+                : OtherDragType() ? DragType.Ignore : DragType.None;
         }
 
         protected override void OnMouseDown()

+ 21 - 28
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/Meido.cs

@@ -98,25 +98,19 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
         public bool Stop
         {
-            get
-            {
-                if (!Body.isLoadedBody) return true;
-                else return !Maid.GetAnimation().isPlaying;
-            }
+            get => !Body.isLoadedBody || !Maid.GetAnimation().isPlaying;
             set
             {
                 if (!Body.isLoadedBody || value == Stop) return;
+                if (value) Maid.GetAnimation().Stop();
                 else
                 {
-                    if (value) Maid.GetAnimation().Stop();
-                    else
-                    {
-                        Body.boEyeToCam = true;
-                        Body.boHeadToCam = true;
-                        SetPose(CachedPose.Pose);
-                    }
-                    OnUpdateMeido();
+                    Body.boEyeToCam = true;
+                    Body.boHeadToCam = true;
+                    SetPose(CachedPose.Pose);
                 }
+
+                OnUpdateMeido();
             }
         }
         public bool IK
@@ -125,7 +119,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             set
             {
                 if (value == IKManager.Active) return;
-                else IKManager.Active = value;
+
+                IKManager.Active = value;
             }
         }
         public bool Bone
@@ -134,7 +129,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             set
             {
                 if (value == Bone) return;
-                else IKManager.IsBone = value;
+
+                IKManager.IsBone = value;
                 OnUpdateMeido();
             }
         }
@@ -364,10 +360,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 foreach (XElement element in faceDataElement.Elements())
                 {
                     string key;
-                    if ((key = (string)element.Attribute("name")) != null)
-                    {
-                        if (!hashKeys.Contains(key)) continue;
-                    }
+                    if ((key = (string)element.Attribute("name")) != null && !hashKeys.Contains(key)) continue;
 
                     if (float.TryParse(element.Value, out float value))
                     {
@@ -615,7 +608,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         private void OnUpdateMeido(MeidoUpdateEventArgs args = null)
         {
-            this.UpdateMeido?.Invoke(this, args ?? MeidoUpdateEventArgs.Empty);
+            UpdateMeido?.Invoke(this, args ?? MeidoUpdateEventArgs.Empty);
         }
 
         private void OnGravityEvent(object sender, EventArgs args) => OnGravityChange((DragPointGravity)sender);
@@ -625,7 +618,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GravityEventArgs args = new GravityEventArgs(
                 dragPoint == skirtGravityDragPoint, dragPoint.MyObject.transform.localPosition
             );
-            this.GravityMove?.Invoke(this, args);
+            GravityMove?.Invoke(this, args);
         }
 
         public void Serialize(BinaryWriter binaryWriter)
@@ -756,8 +749,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 // Head angle cannot be resolved with just the offsetLookTarget
                 if (!mmScene)
                 {
-                    Utility.SetFieldValue<TBody, Vector3>(Body, "HeadEulerAngleG", Vector3.zero);
-                    Utility.SetFieldValue<TBody, Vector3>(Body, "HeadEulerAngle", binaryReader.ReadVector3());
+                    Utility.SetFieldValue(Body, "HeadEulerAngleG", Vector3.zero);
+                    Utility.SetFieldValue(Body, "HeadEulerAngle", binaryReader.ReadVector3());
                 }
             }
             // Head/eye to camera
@@ -840,8 +833,8 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
         public GravityEventArgs(bool isSkirt, Vector3 localPosition)
         {
-            this.LocalPosition = localPosition;
-            this.IsSkirt = isSkirt;
+            LocalPosition = localPosition;
+            IsSkirt = isSkirt;
         }
     }
 
@@ -852,9 +845,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public bool CustomPose { get; }
         public PoseInfo(string poseGroup, string pose, bool customPose = false)
         {
-            this.PoseGroup = poseGroup;
-            this.Pose = pose;
-            this.CustomPose = customPose;
+            PoseGroup = poseGroup;
+            Pose = pose;
+            CustomPose = customPose;
         }
 
         public void Serialize(BinaryWriter binaryWriter)

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

@@ -77,7 +77,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 }
             }
         }
-        private static bool cubeSmall = false;
+        private static bool cubeSmall;
         public static bool CubeSmall
         {
             get => cubeSmall;
@@ -97,9 +97,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private Dictionary<Bone, Transform> BoneTransform = new Dictionary<Bone, Transform>();
         private DragPointBody dragBody;
         private DragPointBody dragCube;
-        private bool initialized = false;
+        private bool initialized;
         public event EventHandler<MeidoUpdateEventArgs> SelectMaid;
-        private bool isBone = false;
+        private bool isBone;
         public bool IsBone
         {
             get => isBone;
@@ -178,10 +178,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         }
 
         public Transform GetAttachPointTransform(AttachPoint point)
-        {
-            if (point == AttachPoint.None) return null;
-            return BoneTransform[PointToBone[point]];
-        }
+            => point == AttachPoint.None ? null : BoneTransform[PointToBone[point]];
 
         public void Flip()
         {
@@ -681,7 +678,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         public AttachPoint AttachPoint { get; }
         public string MaidGuid { get; }
         public int MaidIndex { get; }
-        public static AttachPointInfo Empty => new AttachPointInfo(AttachPoint.None, String.Empty, -1);
+        public static AttachPointInfo Empty => new AttachPointInfo(AttachPoint.None, string.Empty, -1);
 
         public AttachPointInfo(AttachPoint attachPoint, string maidGuid, int maidIndex)
         {

+ 4 - 5
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MeidoPhotoStudio.cs

@@ -30,9 +30,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private PropManager propManager;
         private EffectManager effectManager;
         private Constants.Scene currentScene;
-        private bool initialized = false;
-        private bool active = false;
-        private bool uiActive = false;
+        private bool initialized;
+        private bool active;
+        private bool uiActive;
 
         static MeidoPhotoStudio()
         {
@@ -142,7 +142,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
             if (sceneBinary == null) return;
 
-
             string header = string.Empty;
             string previousHeader = string.Empty;
 
@@ -474,6 +473,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
     {
         public string Path { get; set; } = string.Empty;
         public int SuperSize { get; set; } = -1;
-        public bool HideMaids { get; set; } = false;
+        public bool HideMaids { get; set; }
     }
 }

+ 3 - 9
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MenuFileCache.cs

@@ -14,7 +14,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private const int cacheVersion = 765;
         public static readonly string cachePath = Path.Combine(Constants.configPath, "cache.dat");
         private readonly Dictionary<string, ModItem> modItems;
-        private bool rebuild = false;
+        private bool rebuild;
         public ModItem this[string menu]
         {
             get => modItems[menu];
@@ -34,10 +34,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             if (File.Exists(cachePath)) Deserialize();
         }
 
-        public bool Has(string menuFileName)
-        {
-            return modItems.ContainsKey(menuFileName);
-        }
+        public bool Has(string menuFileName) => modItems.ContainsKey(menuFileName);
 
         private void Deserialize()
         {
@@ -62,10 +59,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             using (BinaryWriter binaryWriter = new BinaryWriter(File.OpenWrite(cachePath)))
             {
                 binaryWriter.Write(cacheVersion);
-                foreach (ModItem item in modItems.Values)
-                {
-                    item.Serialize(binaryWriter);
-                }
+                foreach (ModItem item in modItems.Values) item.Serialize(binaryWriter);
             }
         }
     }

+ 43 - 48
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MenuFileUtility.cs

@@ -24,7 +24,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             None, ItemChange, TexChange
         }
         public static event EventHandler MenuFilesReadyChange;
-        public static bool MenuFilesReady { get; private set; } = false;
+        public static bool MenuFilesReady { get; private set; }
 
         static MenuFileUtility()
         {
@@ -38,7 +38,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             while (!GameMain.Instance.MenuDataBase.JobFinished()) yield return null;
             MenuFilesReady = true;
             MenuFilesReadyChange?.Invoke(null, EventArgs.Empty);
-            yield break;
         }
 
         private static bool ProcScriptBin(byte[] menuBuf, ModelInfo modelInfo)
@@ -418,7 +417,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                     int[] array10 = new int[num20];
                     for (int num21 = 0; num21 < num20; num21++)
                     {
-                        array10[num21] = (int)binaryReader.ReadUInt16();
+                        array10[num21] = binaryReader.ReadUInt16();
                     }
                     mesh2.SetTriangles(array10, num19);
                 }
@@ -451,11 +450,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                         Utility.LogWarning($"Could not open mod menu file '{modItem.MenuFile}'");
                         return null;
                     }
-                    else
-                    {
-                        modMenuBuffer = new byte[fileStream.Length];
-                        fileStream.Read(modMenuBuffer, 0, (int)fileStream.Length);
-                    }
+                    modMenuBuffer = new byte[fileStream.Length];
+
+                    fileStream.Read(modMenuBuffer, 0, (int)fileStream.Length);
                 }
             }
 
@@ -512,11 +509,10 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
 
                 return gameObject;
             }
-            else
-            {
-                Utility.LogMessage($"Could not parse menu file '{modItem.MenuFile}'");
-                return null;
-            }
+
+            Utility.LogMessage($"Could not parse menu file '{modItem.MenuFile}'");
+
+            return null;
         }
 
         public static bool ParseNativeMenuFile(int menuIndex, ModItem modItem)
@@ -663,44 +659,43 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
                 try
                 {
                     if (binaryReader.ReadString() != "CM3D2_MOD") return false;
-                    else
+
+                    binaryReader.ReadInt32();
+                    string iconName = binaryReader.ReadString();
+                    string baseItemPath = binaryReader.ReadString().Replace(":", " ");
+                    modItem.BaseMenuFile = Path.GetFileName(baseItemPath);
+                    modItem.Name = binaryReader.ReadString();
+                    modItem.Category = binaryReader.ReadString();
+                    if (!accMpn.Contains(modItem.Category)) return false;
+                    binaryReader.ReadString();
+                    string mpnValue = binaryReader.ReadString();
+                    MPN mpn = MPN.null_mpn;
+                    try
+                    {
+                        mpn = (MPN)Enum.Parse(typeof(MPN), mpnValue, true);
+                    }
+                    catch
+                    {
+                        return false;
+                    }
+                    if (mpn != MPN.null_mpn)
                     {
-                        binaryReader.ReadInt32();
-                        string iconName = binaryReader.ReadString();
-                        string baseItemPath = binaryReader.ReadString().Replace(":", " ");
-                        modItem.BaseMenuFile = Path.GetFileName(baseItemPath);
-                        modItem.Name = binaryReader.ReadString();
-                        modItem.Category = binaryReader.ReadString();
-                        if (!accMpn.Contains(modItem.Category)) return false;
-                        binaryReader.ReadString();
-                        string mpnValue = binaryReader.ReadString();
-                        MPN mpn = MPN.null_mpn;
-                        try
-                        {
-                            mpn = (MPN)Enum.Parse(typeof(MPN), mpnValue, true);
-                        }
-                        catch
-                        {
-                            return false;
-                        }
-                        if (mpn != MPN.null_mpn)
-                        {
-                            binaryReader.ReadString();
-                        }
                         binaryReader.ReadString();
-                        int size = binaryReader.ReadInt32();
-                        for (int i = 0; i < size; i++)
+                    }
+                    binaryReader.ReadString();
+                    int size = binaryReader.ReadInt32();
+
+                    for (int i = 0; i < size; i++)
+                    {
+                        string key = binaryReader.ReadString();
+                        int count = binaryReader.ReadInt32();
+                        byte[] data = binaryReader.ReadBytes(count);
+                        if (string.Equals(key, iconName, StringComparison.InvariantCultureIgnoreCase))
                         {
-                            string key = binaryReader.ReadString();
-                            int count = binaryReader.ReadInt32();
-                            byte[] data = binaryReader.ReadBytes(count);
-                            if (string.Equals(key, iconName, StringComparison.InvariantCultureIgnoreCase))
-                            {
-                                Texture2D tex = new Texture2D(1, 1, TextureFormat.RGBA32, false);
-                                tex.LoadImage(data);
-                                modItem.Icon = tex;
-                                break;
-                            }
+                            Texture2D tex = new Texture2D(1, 1, TextureFormat.RGBA32, false);
+                            tex.LoadImage(data);
+                            modItem.Icon = tex;
+                            break;
                         }
                     }
                 }

+ 2 - 2
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/MiscGUI.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace COM3D2.MeidoPhotoStudio.Plugin
 {
-    internal static class MiscGUI
+    internal static class MpsGui
     {
         public static readonly GUILayoutOption HalfSlider = GUILayout.Width(98);
         public static readonly Texture2D white = Utility.MakeTex(2, 2, Color.white);
@@ -11,7 +11,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private static readonly GUIStyle lineStyleBlack;
         private static readonly GUIStyle textureBoxStyle;
 
-        static MiscGUI()
+        static MpsGui()
         {
             lineStyleWhite = new GUIStyle(GUI.skin.box);
             lineStyleWhite.padding = lineStyleWhite.border = new RectOffset(0, 0, 1, 1);