@@ -28,9 +28,13 @@ params string[] folderRelativePaths
2828 /// 获得所有应该加载的文件绝对路径, Mod优先, 遵循 replace_path 指令
2929 /// </summary>
3030 /// <param name="folderRelativePath"></param>
31+ /// <param name="filter"></param>
3132 /// <returns></returns>
3233 /// <exception cref="DirectoryNotFoundException"></exception>
33- public IReadOnlyCollection < string > GetAllFilePriorModByRelativePathForFolder ( string folderRelativePath )
34+ public IReadOnlyCollection < string > GetAllFilePriorModByRelativePathForFolder (
35+ string folderRelativePath ,
36+ string filter = "*.*"
37+ )
3438 {
3539 Log . Info ( "正在获取文件夹 {Path} 下的文件" , folderRelativePath ) ;
3640 var modFolder = Path . Combine ( _settingService . ModRootFolderPath , folderRelativePath ) ;
@@ -43,7 +47,7 @@ public IReadOnlyCollection<string> GetAllFilePriorModByRelativePathForFolder(str
4347
4448 if ( ! Directory . Exists ( modFolder ) )
4549 {
46- return Directory . GetFiles ( gameFolder ) ;
50+ return Directory . GetFiles ( gameFolder , filter ) ;
4751 }
4852
4953 if ( _descriptor . ReplacePaths . Contains ( folderRelativePath ) )
@@ -53,11 +57,11 @@ public IReadOnlyCollection<string> GetAllFilePriorModByRelativePathForFolder(str
5357 gameFolder . ToFilePath ( ) ,
5458 modFolder . ToFilePath ( )
5559 ) ;
56- return Directory . GetFiles ( modFolder ) ;
60+ return Directory . GetFiles ( modFolder , filter ) ;
5761 }
5862
59- var gameFilesPath = Directory . GetFiles ( gameFolder ) ;
60- var modFilesPath = Directory . GetFiles ( modFolder ) ;
63+ var gameFilesPath = Directory . GetFiles ( gameFolder , filter ) ;
64+ var modFilesPath = Directory . GetFiles ( modFolder , filter ) ;
6165 return RemoveFileOfEqualName ( gameFilesPath , modFilesPath ) ;
6266 }
6367
0 commit comments