@@ -60,13 +60,15 @@ public static FileStream WaitForFile(string fullPath, FileMode mode, FileAccess
60
60
61
61
public static void Compile ( string [ ] fileList )
62
62
{
63
+ bool firstFile = true ;
63
64
ArrayList args = new ArrayList ( ) ;
64
65
for ( int i = 0 ; i < fileList . Count ( ) ; i ++ )
65
66
{
66
67
string ext = Path . GetExtension ( fileList [ i ] ) . ToUpper ( ) ;
67
68
if ( ext == ".MSG" || ext == ".FLOW" )
68
69
{
69
- args . Add ( GetArgument ( fileList [ i ] , ext , "-Compile " ) ) ;
70
+ args . Add ( GetArgument ( fileList [ i ] , ext , "-Compile " , firstFile ) ) ;
71
+ firstFile = false ;
70
72
}
71
73
}
72
74
@@ -75,19 +77,21 @@ public static void Compile(string[] fileList)
75
77
76
78
public static void Decompile ( string [ ] fileList )
77
79
{
80
+ bool firstFile = true ;
78
81
ArrayList args = new ArrayList ( ) ;
79
82
for ( int i = 0 ; i < fileList . Count ( ) ; i ++ )
80
83
{
81
84
string ext = Path . GetExtension ( fileList [ i ] ) . ToUpper ( ) ;
82
85
if ( ext == ".BMD" || ext == ".BF" )
83
86
{
84
- args . Add ( GetArgument ( fileList [ i ] , ext , "-Decompile " ) ) ;
87
+ args . Add ( GetArgument ( fileList [ i ] , ext , "-Decompile " , firstFile ) ) ;
88
+ firstFile = false ;
85
89
}
86
90
}
87
91
RunCMD ( args ) ;
88
92
}
89
93
90
- private static string GetArgument ( string droppedFilePath , string extension , string compileArg )
94
+ private static string GetArgument ( string droppedFilePath , string extension , string compileArg , bool firstFile )
91
95
{
92
96
string encodingArg = "" ;
93
97
string libraryArg = "" ;
@@ -177,7 +181,9 @@ private static string GetArgument(string droppedFilePath, string extension, stri
177
181
}
178
182
179
183
StringBuilder args = new StringBuilder ( ) ;
180
- args . Append ( "/C AtlusScriptCompiler.exe " ) ;
184
+ if ( firstFile )
185
+ args . Append ( "/C " ) ;
186
+ args . Append ( "AtlusScriptCompiler.exe " ) ;
181
187
args . Append ( $ "\" { droppedFilePath } \" ") ;
182
188
if ( Disassemble ) //Omits all args if you are disassembling
183
189
args . Append ( $ " -Disassemble") ;
0 commit comments