Skip to content

Commit

Permalink
chore: 优化结构
Browse files Browse the repository at this point in the history
  • Loading branch information
tangge233 committed Oct 14, 2024
1 parent 1b62bec commit 08b25a7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Plain Craft Launcher 2/Modules/Minecraft/ModComp.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1546,15 +1546,15 @@ Retry:
''' 将指定的内容直接覆盖
''' </summary>
''' <param name="items"></param>
Public Shared Sub ReplaceAll(items As List(Of CompProject))
Public Shared Sub Replace(items As List(Of CompProject))
Dim RawList As JArray = New JArray()
For Each item As CompProject In items
RawList.Add(item.Id)
Next
Setup.Set("CustomCompFavorites", RawList.ToString())
FavoritesList = Nothing
End Sub
Public Shared Sub ReplaceAll(items As List(Of String))
Public Shared Sub Replace(items As List(Of String))
Dim RawList As JArray = New JArray()
For Each item As String In items
RawList.Add(item)
Expand Down Expand Up @@ -1613,9 +1613,8 @@ Retry:
Return True
End Function
Public Shared Function Del(item As String) As Boolean
Dim SearchRes = GetAll().Where(Function(e) e = item).ToList()
If Not SearchRes.Any() Then Return False
GetAll().Remove(SearchRes.First())
If Not Has(item) Then Return False
FavoritesList.Remove(item)
Save()
Return True
End Function
Expand Down

0 comments on commit 08b25a7

Please sign in to comment.