@@ -489,10 +489,15 @@ await this.SaveTextureAsPngAsync(
489
489
490
490
foreach ( int i in lightLevels ) {
491
491
parameters [ "lightlevel" ] = i < 0 ? "" : i . ToString ( ) ;
492
- await this . SaveTextureAsPngAsync (
493
- ResourceCache . Instance . ImportBitmap ( bm , pal , i < 0 ? null : cmp , i , false , true ) ,
494
- this . FillOutputTemplate ( this . Settings . ConvertedImageFilenameFormat , parameters , outputParameters )
495
- ) ;
492
+
493
+ foreach ( ( DfBitmap . Page page , int index ) in bm . Pages . Select ( ( x , i ) => ( x , i ) ) ) {
494
+ parameters [ "index" ] = index . ToString ( ) ;
495
+
496
+ await this . SaveTextureAsPngAsync (
497
+ ResourceCache . Instance . ImportBitmap ( page , pal , i < 0 ? null : cmp , i , false , true ) ,
498
+ this . FillOutputTemplate ( this . Settings . ConvertedBmFilenameFormat , parameters , outputParameters )
499
+ ) ;
500
+ }
496
501
}
497
502
}
498
503
}
@@ -940,6 +945,19 @@ await this.SaveTextureAsPngAsync(
940
945
}
941
946
942
947
public async void DumpAsync ( ) {
948
+ if ( string . IsNullOrWhiteSpace ( this . Settings . BaseOutputFolder ) || File . Exists ( this . Settings . BaseOutputFolder ) ) {
949
+ await DfMessageBox . Instance . ShowAsync ( "Base Output Folder is set to an invalid location. Please specify a folder." ) ;
950
+ return ;
951
+ }
952
+ if ( ! Directory . Exists ( this . Settings . BaseOutputFolder ) ) {
953
+ try {
954
+ Directory . CreateDirectory ( this . Settings . BaseOutputFolder ) ;
955
+ } catch ( Exception ) {
956
+ await DfMessageBox . Instance . ShowAsync ( "Could not create base output folder. Please verify the location you specified is accurate." ) ;
957
+ return ;
958
+ }
959
+ }
960
+
943
961
await PauseMenu . Instance . BeginLoadingAsync ( ) ;
944
962
945
963
DataContractJsonSerializer serializer = new ( typeof ( ResourceDumperSettings ) , new DataContractJsonSerializerSettings ( ) {
@@ -1255,6 +1273,7 @@ public class ResourceDumperSettings {
1255
1273
public string BaseOutputFormat { get ; set ; } = @"{output}\{inputpath}\{file}" ;
1256
1274
public bool PreferThreeCharacterExtensions { get ; set ; } = false ;
1257
1275
public string ConvertedImageFilenameFormat { get ; set ; } = @"{inputname}.{inputext}-{palette}{lightlevel}.{outputext}" ;
1276
+ public string ConvertedBmFilenameFormat { get ; set ; } = @"{inputname}.{inputext}-{palette}{lightlevel}-{index}.{outputext}" ;
1258
1277
public string ConvertedAnimFilenameFormat { get ; set ; } = @"{inputname}.{inputext}-{palette}\{index}.{outputext}" ;
1259
1278
public string ConvertedWaxFilenameFormat { get ; set ; } = @"{inputname}.{inputext}-{palette}{lightlevel}\{wax}.{sequence}.{frame}.{outputext}" ;
1260
1279
public string ConvertedPalPlttFilenameFormat { get ; set ; } = @"{inputname}.{inputext}.{format}{lightlevel}.{outputext}" ;
0 commit comments