Skip to content

Commit 44cd209

Browse files
committed
feat(模组管理): 添加新排序方式
1 parent d2bb2b7 commit 44cd209

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Plain Craft Launcher 2/Pages/PageVersion/PageVersionMod.xaml.vb

+11
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ Install:
507507
ModName
508508
TagNums
509509
CreateTime
510+
ModFileSize
510511
End Enum
511512

512513
Private Function GetSortName(Method As SortMethod) As String
@@ -515,6 +516,8 @@ Install:
515516
Case SortMethod.ModName : Return "模组名称"
516517
Case SortMethod.TagNums : Return "标签数量"
517518
Case SortMethod.CreateTime : Return "加入时间"
519+
Case SortMethod.ModFileSize : Return "模组文件大小"
520+
Case Else : Return "模组名称"
518521
End Select
519522
Return ""
520523
End Function
@@ -583,6 +586,14 @@ Install:
583586
Return Function(a As McMod, b As McMod) As Integer
584587
Return If((New FileInfo(a.Path)).CreationTime > (New FileInfo(b.Path)).CreationTime, 1, -1)
585588
End Function
589+
Case SortMethod.ModFileSize
590+
Return Function(a As McMod, b As McMod) As Integer
591+
Return (New FileInfo(a.Path)).Length - (New FileInfo(b.Path)).Length
592+
End Function
593+
Case Else
594+
Return Function(a As McMod, b As McMod) As Integer
595+
Return -StrComp(a.Name, b.Name)
596+
End Function
586597
End Select
587598
End Function
588599
#End Region

0 commit comments

Comments
 (0)