Browse Source

Reformat part 6 target-typed new

habeebweeb 2 years ago
parent
commit
5e2f9e5c3c

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

@@ -176,7 +176,7 @@ public static class Constants
         CustomFaceDict[category].Add(fullPath);
         CustomFaceDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
 
-        CustomFaceChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
+        CustomFaceChange?.Invoke(null, new(fullPath, category));
     }
 
     public static void AddPose(byte[] anmBinary, string filename, string directory)
@@ -232,7 +232,7 @@ public static class Constants
         CustomPoseDict[category].Add(fullPath);
         CustomPoseDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
 
-        CustomPoseChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
+        CustomPoseChange?.Invoke(null, new(fullPath, category));
     }
 
     public static void AddHand(byte[] handBinary, bool right, string filename, string directory)
@@ -298,7 +298,7 @@ public static class Constants
         CustomHandDict[category].Add(fullPath);
         CustomHandDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
 
-        CustomHandChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
+        CustomHandChange?.Invoke(null, new(fullPath, category));
     }
 
     public static void InitializeSceneDirectories()
@@ -946,7 +946,7 @@ public static class Constants
                 if (menuDataBase.GetBoDelOnly() || menuFileName.EndsWith("_del.menu"))
                     continue;
 
-                MpnAttachPropList.Add(new MpnAttachProp(itemMpn, menuFileName));
+                MpnAttachPropList.Add(new(itemMpn, menuFileName));
             }
         }
 

+ 1 - 1
src/MeidoPhotoStudio.Plugin/DragPoint/DragPoint.cs

@@ -256,7 +256,7 @@ public abstract class DragPoint : MonoBehaviour
     {
         var mousePosition = Utility.MousePosition;
 
-        return camera.ScreenToWorldPoint(new Vector3(mousePosition.x, mousePosition.y, screenPoint.z)) + startOffset
+        return camera.ScreenToWorldPoint(new(mousePosition.x, mousePosition.y, screenPoint.z)) + startOffset
             - newOffset;
     }
 

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

@@ -164,7 +164,7 @@ public class Dropdown : BaseControl
 
         buttonRect = GUILayoutUtility.GetLastRect();
 
-        var rectPos = GUIUtility.GUIToScreenPoint(new Vector2(buttonRect.x, buttonRect.y));
+        var rectPos = GUIUtility.GUIToScreenPoint(new(buttonRect.x, buttonRect.y));
 
         buttonRect.x = rectPos.x;
         buttonRect.y = rectPos.y;
@@ -225,7 +225,7 @@ public static class DropdownHelper
 
         style ??= DefaultDropdownStyle;
 
-        return style.CalcSize(new GUIContent(item));
+        return style.CalcSize(new(item));
     }
 
     public static Vector2 CalculateElementSize(string[] list, GUIStyle style = null)

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

@@ -4,7 +4,7 @@ namespace MeidoPhotoStudio.Plugin;
 
 public class SceneModalWindow : BaseWindow
 {
-    private static readonly Texture2D infoHighlight = Utility.MakeTex(2, 2, new Color(0f, 0f, 0f, 0.8f));
+    private static readonly Texture2D infoHighlight = Utility.MakeTex(2, 2, new(0f, 0f, 0f, 0.8f));
 
     private readonly SceneManager sceneManager;
     private readonly Button okButton;

+ 3 - 3
src/MeidoPhotoStudio.Plugin/Managers/EffectManagers/BloomEffectManager.cs

@@ -55,7 +55,7 @@ public class BloomEffectManager : IEffectManager
         {
             var colour = Bloom.bloomThreshholdColor;
 
-            BloomThresholdColour = new Color(value, colour.g, colour.b);
+            BloomThresholdColour = new(value, colour.g, colour.b);
         }
     }
 
@@ -66,7 +66,7 @@ public class BloomEffectManager : IEffectManager
         {
             var colour = Bloom.bloomThreshholdColor;
 
-            BloomThresholdColour = new Color(colour.r, value, colour.b);
+            BloomThresholdColour = new(colour.r, value, colour.b);
         }
     }
 
@@ -77,7 +77,7 @@ public class BloomEffectManager : IEffectManager
         {
             var colour = Bloom.bloomThreshholdColor;
 
-            BloomThresholdColour = new Color(colour.r, colour.g, value);
+            BloomThresholdColour = new(colour.r, colour.g, value);
         }
     }
 

+ 3 - 3
src/MeidoPhotoStudio.Plugin/Managers/EffectManagers/FogEffectManager.cs

@@ -52,7 +52,7 @@ public class FogEffectManager : IEffectManager
         {
             var fogColour = FogColour;
 
-            FogColour = new Color(value, fogColour.g, fogColour.b);
+            FogColour = new(value, fogColour.g, fogColour.b);
         }
     }
 
@@ -63,7 +63,7 @@ public class FogEffectManager : IEffectManager
         {
             var fogColour = FogColour;
 
-            FogColour = new Color(fogColour.r, value, fogColour.b);
+            FogColour = new(fogColour.r, value, fogColour.b);
         }
     }
 
@@ -74,7 +74,7 @@ public class FogEffectManager : IEffectManager
         {
             var fogColour = FogColour;
 
-            FogColour = new Color(fogColour.r, fogColour.g, value);
+            FogColour = new(fogColour.r, fogColour.g, value);
         }
     }
 

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

@@ -142,7 +142,7 @@ public static class InputManager
                 if (!Input.GetKeyDown(key))
                     continue;
 
-                KeyChange?.Invoke(this, new KeyChangeEventArgs(key));
+                KeyChange?.Invoke(this, new(key));
 
                 break;
             }

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

@@ -76,7 +76,7 @@ public class LightManager : IManager
         var mainLight = GameMain.Instance.MainLight.GetComponent<Light>();
 
         mainLight.type = LightType.Directional;
-        DragPointLight.SetLightProperties(mainLight, new LightProperty());
+        DragPointLight.SetLightProperties(mainLight, new());
         CubeActiveChange -= OnCubeActive;
     }
 

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

@@ -192,7 +192,7 @@ public class MeidoManager : IManager
         Activate();
 
     public void ChangeMaid(int index) =>
-        OnUpdateMeido(null, new MeidoUpdateEventArgs(index));
+        OnUpdateMeido(null, new(index));
 
     public void Activate()
     {
@@ -367,7 +367,7 @@ public class MeidoManager : IManager
         foreach (var activeMeido in ActiveMeidoList)
             activeMeido.SetMaskMode((Meido.Mask)undress);
 
-        UpdateMeido?.Invoke(ActiveMeido, new MeidoUpdateEventArgs(SelectedMeido));
+        UpdateMeido?.Invoke(ActiveMeido, new(SelectedMeido));
     }
 
     private void OnUpdateMeido(object sender, MeidoUpdateEventArgs args)

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

@@ -150,7 +150,7 @@ public class PropManager : IManager
 
                 return AddModProp(modItem);
             case PropInfo.PropType.MyRoom:
-                return AddMyRoomProp(new MyRoomItem { ID = propInfo.MyRoomID, PrefabName = propInfo.Filename });
+                return AddMyRoomProp(new() { ID = propInfo.MyRoomID, PrefabName = propInfo.Filename });
             case PropInfo.PropType.Bg:
                 return AddBgProp(propInfo.Filename);
             case PropInfo.PropType.Odogu:

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

@@ -106,7 +106,7 @@ public class DragPointSpine : DragPointMeido
         {
             var cursorPosition = CursorPosition();
 
-            MyObject.position = new Vector3(MyObject.position.x, cursorPosition.y, MyObject.position.z);
+            MyObject.position = new(MyObject.position.x, cursorPosition.y, MyObject.position.z);
         }
     }
 }

+ 1 - 1
src/MeidoPhotoStudio.Plugin/MyGui.cs

@@ -6,7 +6,7 @@ public static class MpsGui
 {
     public static readonly GUILayoutOption HalfSlider = GUILayout.Width(98);
     public static readonly Texture2D white = Utility.MakeTex(2, 2, Color.white);
-    public static readonly Texture2D transparentBlack = Utility.MakeTex(2, 2, new Color(0f, 0f, 0f, 0.8f));
+    public static readonly Texture2D transparentBlack = Utility.MakeTex(2, 2, new(0f, 0f, 0f, 0.8f));
     public static readonly GUIStyle SliderLabelStyle;
     public static readonly GUIStyle SliderStyle;
     public static readonly GUIStyle SliderStyleNoLabel;

+ 1 - 1
src/MeidoPhotoStudio.Plugin/Patchers/AllProcPropSeqStartPatcher.cs

@@ -11,7 +11,7 @@ public static class AllProcPropSeqStartPatcher
     [HarmonyPatch(typeof(Maid), nameof(Maid.AllProcPropSeqStart))]
     [HarmonyPostfix]
     private static void NotifyProcStart(Maid __instance) =>
-        SequenceStart?.Invoke(null, new ProcStartEventArgs(__instance));
+        SequenceStart?.Invoke(null, new(__instance));
 }
 
 public class ProcStartEventArgs : EventArgs

+ 1 - 1
src/MeidoPhotoStudio.Plugin/Serialization/SimpleSerializers/DragPointPropDTOSerializer.cs

@@ -53,7 +53,7 @@ public class DragPointPropDTO
 
     public DragPointPropDTO(DragPointProp dragPoint)
     {
-        TransformDTO = new TransformDTO(dragPoint.MyObject.transform);
+        TransformDTO = new(dragPoint.MyObject.transform);
         ShadowCasting = dragPoint.ShadowCasting;
         AttachPointInfo = dragPoint.AttachPointInfo;
         PropInfo = dragPoint.Info;