Bläddra i källkod

Keep preset root directories at top

The same with scene manager root directories except order does not
matter so the consequences aren't as severe.

Just keeping the listings consistent.
habeebweeb 4 år sedan
förälder
incheckning
49274e3403
1 ändrade filer med 6 tillägg och 9 borttagningar
  1. 6 9
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Constants.cs

+ 6 - 9
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Constants.cs

@@ -173,14 +173,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
             {
                 CustomFaceGroupList.Add(category);
                 CustomFaceGroupList.Add(category);
                 CustomFaceDict[category] = new List<string>();
                 CustomFaceDict[category] = new List<string>();
+                CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
             }
             }
             else category = faceGroup;
             else category = faceGroup;
 
 
             CustomFaceDict[category].Add(fullPath);
             CustomFaceDict[category].Add(fullPath);
             CustomFaceDict[category].Sort(LexicographicStringComparer.Comparison);
             CustomFaceDict[category].Sort(LexicographicStringComparer.Comparison);
 
 
-            CustomFaceGroupList.Sort(LexicographicStringComparer.Comparison);
-
             CustomFaceChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
             CustomFaceChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
         }
         }
 
 
@@ -224,14 +223,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
             {
                 CustomPoseGroupList.Add(category);
                 CustomPoseGroupList.Add(category);
                 CustomPoseDict[category] = new List<string>();
                 CustomPoseDict[category] = new List<string>();
+                CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, customPoseDirectory));
             }
             }
             else category = poseGroup;
             else category = poseGroup;
 
 
             CustomPoseDict[category].Add(fullPath);
             CustomPoseDict[category].Add(fullPath);
             CustomPoseDict[category].Sort(LexicographicStringComparer.Comparison);
             CustomPoseDict[category].Sort(LexicographicStringComparer.Comparison);
 
 
-            CustomPoseGroupList.Sort(LexicographicStringComparer.Comparison);
-
             CustomPoseChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
             CustomPoseChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
         }
         }
 
 
@@ -284,14 +282,13 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             {
             {
                 CustomHandGroupList.Add(category);
                 CustomHandGroupList.Add(category);
                 CustomHandDict[category] = new List<string>();
                 CustomHandDict[category] = new List<string>();
+                CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, customHandDirectory));
             }
             }
             else category = handGroup;
             else category = handGroup;
 
 
             CustomHandDict[category].Add(fullPath);
             CustomHandDict[category].Add(fullPath);
             CustomHandDict[category].Sort(LexicographicStringComparer.Comparison);
             CustomHandDict[category].Sort(LexicographicStringComparer.Comparison);
 
 
-            CustomHandGroupList.Sort(LexicographicStringComparer.Comparison);
-
             CustomHandChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
             CustomHandChange?.Invoke(null, new PresetChangeEventArgs(fullPath, category));
         }
         }
 
 
@@ -433,7 +430,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GetPoses(customPosePath);
             GetPoses(customPosePath);
             foreach (string directory in Directory.GetDirectories(customPosePath)) GetPoses(directory);
             foreach (string directory in Directory.GetDirectories(customPosePath)) GetPoses(directory);
 
 
-            CustomPoseGroupList.Sort(LexicographicStringComparer.Comparison);
+            CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, customPoseDirectory));
 
 
             CustomPoseChange?.Invoke(null, PresetChangeEventArgs.Empty);
             CustomPoseChange?.Invoke(null, PresetChangeEventArgs.Empty);
         }
         }
@@ -462,7 +459,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GetPresets(customHandPath);
             GetPresets(customHandPath);
             foreach (string directory in Directory.GetDirectories(customHandPath)) GetPresets(directory);
             foreach (string directory in Directory.GetDirectories(customHandPath)) GetPresets(directory);
 
 
-            CustomHandGroupList.Sort(LexicographicStringComparer.Comparison);
+            CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, customHandDirectory));
 
 
             CustomHandChange?.Invoke(null, PresetChangeEventArgs.Empty);
             CustomHandChange?.Invoke(null, PresetChangeEventArgs.Empty);
         }
         }
@@ -505,7 +502,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
             GetFacePresets(customFacePath);
             GetFacePresets(customFacePath);
             foreach (string directory in Directory.GetDirectories(customFacePath)) GetFacePresets(directory);
             foreach (string directory in Directory.GetDirectories(customFacePath)) GetFacePresets(directory);
 
 
-            CustomFaceGroupList.Sort(LexicographicStringComparer.Comparison);
+            CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
 
 
             CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
             CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
         }
         }