现在自动加载.001在打开.bin script时

This commit is contained in:
Chenx221 2024-10-15 13:25:15 +08:00
parent 72f9b2190f
commit b3a6c529f8
2 changed files with 7 additions and 4 deletions

View File

@ -5,9 +5,9 @@
static void Main(string[] args)
{
ScriptManager smr = new();
smr.LoadScriptFile(args[0]);
if(args.Length == 2)
smr.LoadScriptMess(args[1]);
smr.LoadScriptFile(args[0]); //加载.bin文件
//if(args.Length == 2) //不再需要,因为会根据需求自动加载配套.001文件
// smr.LoadScriptMess(args[1]);
return;

View File

@ -118,6 +118,9 @@ namespace EscudeTools
sf.TextCount = ReadUInt32(br);
sf.TextSize = ReadUInt32(br);
sf.MessCount = ReadUInt32(br);
if(sf.MessCount > 0)
if(sm.Data.Length == 0) // 怎么判断加没加载呢?这个写的我自己都不是很确定
LoadScriptMess(Path.ChangeExtension(path, ".001"));
if (fs.Length < sf.CodeSize + sf.TextSize + 16 + sf.TextCount * 4)
return false;
@ -244,7 +247,7 @@ namespace EscudeTools
return BitConverter.ToUInt32(bytes, 0);
}
public bool LoadScriptMess(string path)
private bool LoadScriptMess(string path)
{
if (!File.Exists(path))
return false;