@@ -232,7 +232,7 @@ private static async Task<GameRes> ColorMCAsync(Stream st, IOverGameGui? gui, IA
232232
233233 foreach ( var e in zFile . Entries )
234234 {
235- if ( ! FuntionUtils . IsFile ( e ) )
235+ if ( ! FunctionUtils . IsFile ( e ) )
236236 {
237237 index ++ ;
238238 continue ;
@@ -267,7 +267,7 @@ private static async Task<GameRes> MMCAsync(string? name, string? group, string
267267 Dictionary < string , string > ? mmc1 = null ;
268268 foreach ( var e in zFile . Entries )
269269 {
270- if ( ! FuntionUtils . IsFile ( e ) )
270+ if ( ! FunctionUtils . IsFile ( e ) )
271271 {
272272 continue ;
273273 }
@@ -329,7 +329,7 @@ private static async Task<GameRes> MMCAsync(string? name, string? group, string
329329
330330 foreach ( var e in zFile . Entries )
331331 {
332- if ( ! FuntionUtils . IsFile ( e ) )
332+ if ( ! FunctionUtils . IsFile ( e ) )
333333 {
334334 index ++ ;
335335 continue ;
@@ -423,7 +423,7 @@ private static async Task<GameRes> HMCLAsync(string? name, string? group, string
423423
424424 foreach ( var e in zFile . Entries )
425425 {
426- if ( ! FuntionUtils . IsFile ( e ) )
426+ if ( ! FunctionUtils . IsFile ( e ) )
427427 {
428428 index ++ ;
429429 continue ;
@@ -482,7 +482,7 @@ private static async Task<GameRes> UnzipAsync(string? name, string? group, strin
482482
483483 foreach ( var e in zFile . Entries )
484484 {
485- if ( ! FuntionUtils . IsFile ( e ) )
485+ if ( ! FunctionUtils . IsFile ( e ) )
486486 {
487487 index ++ ;
488488 continue ;
@@ -557,7 +557,7 @@ public static async Task<GameRes> InstallZip(string? name, string? group, string
557557 //如果是http则下载
558558 if ( file . StartsWith ( "http" ) )
559559 {
560- var file1 = Path . Combine ( DownloadManager . DownloadDir , FuntionUtils . NewUUID ( ) ) ;
560+ var file1 = Path . Combine ( DownloadManager . DownloadDir , FunctionUtils . NewUUID ( ) ) ;
561561 var res = await DownloadManager . StartAsync ( [ new FileItemObj ( )
562562 {
563563 Url = file ,
@@ -644,13 +644,22 @@ public static async Task<GameRes> InstallModrinth(string? group,
644644 /// 下载并安装curseforge整合包
645645 /// </summary>
646646 /// <returns>导入结果</returns>
647- public static async Task < GameRes > InstallCurseForge ( string ? group , CurseForgeModObj . CurseForgeDataObj data ,
647+ public static Task < GameRes > InstallCurseForge ( string ? group , CurseForgeModObj . CurseForgeDataObj data ,
648648 string ? icon , IOverGameGui ? gui , IAddGui ? packgui , CancellationToken token = default )
649649 {
650- packgui ? . SetState ( AddState . DownloadPack ) ;
651-
652650 var item = data . MakeDownloadObj ( DownloadManager . DownloadDir ) ;
653651
652+ return InstallCurseForge ( group , item , data . ModId . ToString ( ) , data . Id . ToString ( ) , icon , gui , packgui , token ) ;
653+ }
654+
655+ /// <summary>
656+ /// 下载并安装curseforge整合包
657+ /// </summary>
658+ /// <returns>导入结果</returns>
659+ public static async Task < GameRes > InstallCurseForge ( string ? group , FileItemObj item , string modid , string fileid ,
660+ string ? icon , IOverGameGui ? gui , IAddGui ? packgui , CancellationToken token = default )
661+ {
662+ packgui ? . SetState ( AddState . DownloadPack ) ;
654663 packgui ? . SetSubText ( item . Name ) ;
655664 var res1 = await DownloadManager . StartAsync ( [ item ] , packgui , token ) ;
656665 packgui ? . SetSubText ( null ) ;
@@ -662,8 +671,8 @@ public static async Task<GameRes> InstallCurseForge(string? group, CurseForgeMod
662671 var res2 = await InstallZip ( null , group , item . Local , PackType . CurseForge , gui , packgui , token ) ;
663672 if ( res2 . State && ! token . IsCancellationRequested )
664673 {
665- res2 . Game ! . PID = data . ModId . ToString ( ) ;
666- res2 . Game . FID = data . Id . ToString ( ) ;
674+ res2 . Game ! . PID = modid ;
675+ res2 . Game . FID = fileid ;
667676 res2 . Game . Save ( ) ;
668677
669678 if ( icon != null )
0 commit comments