Skip to content

Commit ee34583

Browse files
authored
Merge pull request #12 from AnimatedSwine37/master
Fix being unable to decompile/compile multiple files at once and enable sumbits by default
2 parents 6f31f9d + 6e11de3 commit ee34583

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

AtlusScriptCompilerGUI/Forms/MainForm.Designer.cs

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AtlusScriptCompilerGUI/GUI.cs

+10-4
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,15 @@ public static FileStream WaitForFile(string fullPath, FileMode mode, FileAccess
6060

6161
public static void Compile(string[] fileList)
6262
{
63+
bool firstFile = true;
6364
ArrayList args = new ArrayList();
6465
for (int i = 0; i < fileList.Count(); i++)
6566
{
6667
string ext = Path.GetExtension(fileList[i]).ToUpper();
6768
if (ext == ".MSG" || ext == ".FLOW")
6869
{
69-
args.Add(GetArgument(fileList[i], ext, "-Compile "));
70+
args.Add(GetArgument(fileList[i], ext, "-Compile ", firstFile));
71+
firstFile = false;
7072
}
7173
}
7274

@@ -75,19 +77,21 @@ public static void Compile(string[] fileList)
7577

7678
public static void Decompile(string[] fileList)
7779
{
80+
bool firstFile = true;
7881
ArrayList args = new ArrayList();
7982
for (int i = 0; i < fileList.Count(); i++)
8083
{
8184
string ext = Path.GetExtension(fileList[i]).ToUpper();
8285
if (ext == ".BMD" || ext == ".BF")
8386
{
84-
args.Add(GetArgument(fileList[i], ext, "-Decompile "));
87+
args.Add(GetArgument(fileList[i], ext, "-Decompile ", firstFile));
88+
firstFile = false;
8589
}
8690
}
8791
RunCMD(args);
8892
}
8993

90-
private static string GetArgument(string droppedFilePath, string extension, string compileArg)
94+
private static string GetArgument(string droppedFilePath, string extension, string compileArg, bool firstFile)
9195
{
9296
string encodingArg = "";
9397
string libraryArg = "";
@@ -177,7 +181,9 @@ private static string GetArgument(string droppedFilePath, string extension, stri
177181
}
178182

179183
StringBuilder args = new StringBuilder();
180-
args.Append("/C AtlusScriptCompiler.exe ");
184+
if (firstFile)
185+
args.Append("/C ");
186+
args.Append("AtlusScriptCompiler.exe ");
181187
args.Append($"\"{droppedFilePath}\" ");
182188
if (Disassemble) //Omits all args if you are disassembling
183189
args.Append($" -Disassemble");

AtlusScriptCompilerGUI_Dark/Forms/DarkForm.Designer.cs

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)