修复按目录读取包括点符号的目录时读取错误

This commit is contained in:
ZouJin 2023-10-20 15:23:14 +08:00
parent 5addd3e301
commit 2c7501998e
14 changed files with 8 additions and 2 deletions

View File

@ -42,7 +42,12 @@ namespace VPet_Simulator.Core
/// <param name="info">信息</param> /// <param name="info">信息</param>
public GraphInfo(FileSystemInfo path, ILine info) public GraphInfo(FileSystemInfo path, ILine info)
{ {
var pn = Sub.Split(path.FullName.Substring(0, path.FullName.Length - path.Extension.Length).ToLower(), info[(gstr)"startuppath"].ToLower()).Last(); string pn;
if (path is DirectoryInfo)
pn = Sub.Split(path.FullName.ToLower(), info[(gstr)"startuppath"].ToLower()).Last();
else
pn = Sub.Split(path.FullName.Substring(0, path.FullName.Length - path.Extension.Length).ToLower(), info[(gstr)"startuppath"].ToLower()).Last();
var path_name = pn.Replace('\\', '_').Split('_').ToList(); var path_name = pn.Replace('\\', '_').Split('_').ToList();
path_name.RemoveAll(string.IsNullOrWhiteSpace); path_name.RemoveAll(string.IsNullOrWhiteSpace);
if (!Enum.TryParse(info[(gstr)"mode"], true, out GameSave.ModeType modetype)) if (!Enum.TryParse(info[(gstr)"mode"], true, out GameSave.ModeType modetype))
@ -109,7 +114,8 @@ namespace VPet_Simulator.Core
else if (path_name.Remove("c") || path_name.Remove("end")) else if (path_name.Remove("c") || path_name.Remove("end"))
{ {
animatType = AnimatType.C_End; animatType = AnimatType.C_End;
}else if (path_name.Remove("single")) }
else if (path_name.Remove("single"))
{ {
animatType = AnimatType.Single; animatType = AnimatType.Single;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB