Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
Fix SummerPockets export bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wetor committed Dec 25, 2020
1 parent 326b365 commit 9edf87c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 5 deletions.
4 changes: 2 additions & 2 deletions LucaSystemTools/LucaSystemTools/OPCODE/SP.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GOSUB
IFY (StringSJIS, Position)
IFN (StringSJIS, Position)
RETURN
JUMP (StringSJIS, Position)
JUMP (StringSJIS, UInt32)
FARCALL (UInt16,StringSJIS)
FARRETURN
JUMPPOINT
Expand Down Expand Up @@ -51,7 +51,7 @@ STOP
IMAGELOAD (UInt16, UInt16, !UInt16)
IMAGEUPADTE
ARC
MOVE (UInt16, UInt16, UInt16, UInt16)
MOVE (UInt16, UInt16, UInt16, !UInt16)
MOVE2
ROT
PEND
Expand Down
2 changes: 1 addition & 1 deletion LucaSystemTools/LucaSystemTools/Script/CodeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public override string ToString()
{
retn += num.ToString() + ", ";
}
if (count > 0)
if (retn.Length > 1)
{
retn = retn.Remove(retn.Length - 2);
}
Expand Down
4 changes: 4 additions & 0 deletions LucaSystemTools/LucaSystemTools/ScriptReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ private CodeLine ReadCodeLine()
{
infoCount--;
}
else if (code.opcode == "LOG" && infoCount == 7)
{
infoCount = 3;
}
info.data = new UInt16[infoCount];
for (int i = 0; i < infoCount; i++)
{
Expand Down
46 changes: 44 additions & 2 deletions LucaSystemTools/LucaSystemTools/Utils/CommandLineUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using McMaster.Extensions.CommandLineUtils;
using ProtFont;
using ProtImage;
Expand Down Expand Up @@ -152,11 +153,52 @@ public void OnExecute()

if (ParserMode.ToLower() == "import" || ParserMode.ToLower() == "i")
{
selclass.FileImport(FileName, OutFileName);
if (File.Exists(FileName))
{
// 是文件
selclass.FileImport(FileName, OutFileName);
}
else if(Directory.Exists(FileName))
{
// 是文件夹
string outFolder = OutFileName;
if (!Directory.Exists(OutFileName))
{
Console.WriteLine("输出目录不是文件夹,默认输出目录已更改");
outFolder = Path.GetDirectoryName(OutFileName);
}
var files = Directory.GetFiles(FileName, "*");
foreach (var file in files)
{
selclass.FileImport(file, Path.Combine(outFolder, Path.GetFileNameWithoutExtension(file)));
}
}

}
else if (ParserMode.ToLower() == "export" || ParserMode.ToLower() == "e")
{
selclass.FileExport(FileName, OutFileName);


if (File.Exists(FileName))
{
// 是文件
selclass.FileExport(FileName, OutFileName);
}
else if (Directory.Exists(FileName))
{
// 是文件夹
string outFolder = OutFileName;
if (!Directory.Exists(OutFileName))
{
Console.WriteLine("输出目录不是文件夹,默认输出目录已更改");
outFolder = Path.GetDirectoryName(OutFileName);
}
var files = Directory.GetFiles(FileName, "*");
foreach (var file in files)
{
selclass.FileExport(file, Path.Combine(outFolder, Path.GetFileNameWithoutExtension(file)));
}
}
}
else
{
Expand Down

0 comments on commit 9edf87c

Please sign in to comment.