@@ -21,6 +21,11 @@ typedef SongCreationData = {
2121 var voicesBytes : Bytes ;
2222 @:optional var playerVocals : Bytes ;
2323 @:optional var oppVocals : Bytes ;
24+
25+ var instExt : String ;
26+ var voicesExt : String ;
27+ @:optional var playerExt : String ;
28+ @:optional var oppExt : String ;
2429}
2530
2631class SongCreationScreen extends UISubstateWindow {
@@ -300,7 +305,7 @@ class SongCreationScreen extends UISubstateWindow {
300305 saveButton .selectable = #if TEST_BUILD true #else project ? true : (importInstExplorer .file != null ) #end;
301306 } else if (curPage == 2 ) {
302307 importIdTextBox .selectable = ! project ;
303- importChartFile .fileType = project ? [ " fnfc" ] : [ " json" ];
308+ importChartFile .fileType = [ project ? " fnfc" : " json" ];
304309 importMetaFile .selectable = name == translate (" vslice" );
305310 saveButton .selectable = importChartFile .file != null && (! importMetaFile .selectable || importMetaFile .file != null ) && (! importIdTextBox .selectable || importIdTextBox .label .text .trim ().length > 0 );
306311 } else
@@ -378,12 +383,13 @@ class SongCreationScreen extends UISubstateWindow {
378383 }
379384 saveFromVSlice (files );
380385 case 1 /* "V-Slice"*/ :
386+ final ogg = Flags .SOUND_EXT [0 ];
381387 var songId = importIdTextBox .label .text ;
382388 var files : Map <String , Any > = [];
383389 files .set (' ${songId }-metadata.json' , importMetaFile .file );
384390 files .set (' ${songId }-chart.json' , importChartFile .file );
385- files .set (' Inst. ${ Flags . SOUND_EXT } ' , importInstExplorer .file );
386- files .set (' Voices. ${ Flags . SOUND_EXT } ' , importVoicesExplorer .file );
391+ files .set (' Inst. $ogg ' , importInstExplorer .file );
392+ files .set (' Voices. $ogg ' , importVoicesExplorer .file );
387393 saveFromVSlice (files , songId );
388394 default /* "Psych/Legacy FNF"*/ :
389395 var songId = importIdTextBox .label .text ;
@@ -410,6 +416,8 @@ class SongCreationScreen extends UISubstateWindow {
410416 meta : meta ,
411417 instBytes : importInstExplorer .file ,
412418 voicesBytes : importVoicesExplorer .file ,
419+ instExt : importInstExplorer .fileExt ,
420+ voicesExt : importVoicesExplorer .fileExt
413421 }, (songFolder : String ) -> {
414422 #if sys
415423 CoolUtil .safeSaveFile (' $songFolder / ${getChartSavePath (meta , " normal" )}' , Json .stringify (base , Flags .JSON_PRETTY_PRINT ));
@@ -441,18 +449,21 @@ class SongCreationScreen extends UISubstateWindow {
441449 if (onSave != null ) onSave ({
442450 meta : meta ,
443451 instBytes : instExplorer .file ,
444- voicesBytes : voicesExplorer .file
452+ voicesBytes : voicesExplorer .file ,
453+ instExt : instExplorer .fileExt ,
454+ voicesExt : voicesExplorer .fileExt
445455 }, null );
446456 }
447457 }
448458
449459 function saveFromVSlice (files : Map <String , Any >, ? name : String ) {
460+ final ogg = Flags .SOUND_EXT [0 ]; // vslice doesnt know about anything that isnt ogg. this should just be a constant
450461 var songId = name == null && files .exists (" manifest.json" ) ? Json .parse (files .get (" manifest.json" )).songId : name ;
451462 var vslicemeta : SwagMetadata = Json .parse (files .get (' ${songId }-metadata.json' ));
452463 var vslicechart : NewSwagSong = Json .parse (files .get (' ${songId }-chart.json' ));
453464 var playData = vslicemeta .playData ;
454465
455- var meta : ChartMetaData = formatMeta ({name : songId , needsVoices : files .get (' Voices. ${ Flags . SOUND_EXT [ 0 ]} ' ) != null });
466+ var meta : ChartMetaData = formatMeta ({name : songId , needsVoices : files .get (' Voices. $ogg ' ) != null });
456467 var diffCharts : Array <ChartDataWithInfo > = [], events : Array <ChartEvent > = null ;
457468 VSliceParser .parse (vslicemeta , vslicechart , meta , diffCharts , songId );
458469
@@ -461,10 +472,14 @@ class SongCreationScreen extends UISubstateWindow {
461472
462473 if (onSave != null ) onSave ({
463474 meta : meta ,
464- instBytes : files .get (' Inst. ${Flags .SOUND_EXT [0 ]}' ),
465- voicesBytes : files .get (' Voices. ${Flags .SOUND_EXT [0 ]}' ), // it may exist
466- playerVocals : files .get (' Voices- ${playData .characters .playerVocals != null ? playData .characters .playerVocals [0 ] : playData .characters .player }. ${Flags .SOUND_EXT [0 ]}' ),
467- oppVocals : files .get (' Voices- ${playData .characters .opponentVocals != null ? playData .characters .opponentVocals [0 ] : playData .characters .opponent }. ${Flags .SOUND_EXT [0 ]}' ),
475+ instBytes : files .get (' Inst. $ogg ' ),
476+ voicesBytes : files .get (' Voices. $ogg ' ), // it may exist
477+ playerVocals : files .get (' Voices- ${playData .characters .playerVocals != null ? playData .characters .playerVocals [0 ] : playData .characters .player }. $ogg ' ),
478+ oppVocals : files .get (' Voices- ${playData .characters .opponentVocals != null ? playData .characters .opponentVocals [0 ] : playData .characters .opponent }. $ogg ' ),
479+ instExt : ogg ,
480+ voicesExt : ogg ,
481+ playerExt : ogg ,
482+ oppExt : ogg
468483 }, (songFolder : String ) -> {
469484 #if sys
470485 for (diff in diffCharts ) CoolUtil .safeSaveFile (' $songFolder / ${getChartSavePath (meta , diff .diffName )}' , Json .stringify (diff .chart , Flags .JSON_PRETTY_PRINT ));
0 commit comments