File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
xivModdingFramework/Helpers Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -797,16 +797,27 @@ public static byte[] GetImageSharpPixels(Image<Rgba32> img)
797
797
}
798
798
}
799
799
800
- public static string GetUniqueSubfolder ( string basePath , string prefix = "" )
800
+ public static string GetUniqueSubfolder ( string basePath , string prefix = "" , bool omitZero = false )
801
801
{
802
802
lock ( _SubfolderLock )
803
803
{
804
804
var id = 0 ;
805
805
var path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
806
+ if ( omitZero )
807
+ {
808
+ path = Path . GetFullPath ( Path . Combine ( basePath , prefix ) ) ;
809
+ }
806
810
while ( Directory . Exists ( path ) )
807
811
{
808
812
id ++ ;
809
- path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
813
+ if ( omitZero )
814
+ {
815
+ path = Path . GetFullPath ( Path . Combine ( basePath , prefix + " (" + id . ToString ( ) + ")" ) ) ;
816
+ }
817
+ else
818
+ {
819
+ path = Path . GetFullPath ( Path . Combine ( basePath , prefix + id . ToString ( ) ) ) ;
820
+ }
810
821
}
811
822
Directory . CreateDirectory ( path ) ;
812
823
return path ;
You can’t perform that action at this time.
0 commit comments