-
-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
98 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompFavorites.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<local:MyPageRight | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:PCL" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" x:Class="PageDownloadCompFavorites" | ||
PanScroll="{Binding ElementName=PanBack}"> | ||
<local:MyScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" x:Name="PanBack"> | ||
<StackPanel Orientation="Vertical" Margin="25"> | ||
<StackPanel x:Name="PanContent"> | ||
<local:MySearchBox HintText="搜索收藏夹内容" x:Name="PanSearchBox" Margin="0,0,0,15"/> | ||
|
||
<local:MyCard x:Name="CardProjectsMod" Title="Mod" UseAnimation="False" Margin="0,0,0,15"> | ||
<StackPanel x:Name="PanProjectsMod" Margin="12" /> | ||
</local:MyCard> | ||
<local:MyCard x:Name="CardProjectsModpack" Title="整合包" UseAnimation="False" Margin="0,0,0,15"> | ||
<StackPanel x:Name="PanProjectsModpack" Margin="12" /> | ||
</local:MyCard> | ||
|
||
<local:MyCard HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" x:Name="PanLoad" UseAnimation="False" Margin="40,50"> | ||
<local:MyLoading Text="正在加载收藏夹列表" Margin="20,20,20,17" x:Name="Load" HorizontalAlignment="Center" VerticalAlignment="Center" /> | ||
</local:MyCard> | ||
</StackPanel> | ||
</StackPanel> | ||
</local:MyScrollViewer> | ||
</local:MyPageRight> |
51 changes: 51 additions & 0 deletions
51
Plain Craft Launcher 2/Pages/PageDownload/PageDownloadCompFavorites.xaml.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Public Class PageDownloadCompFavorites | ||
|
||
Public Const PageSize = 40 | ||
|
||
'加载器信息 | ||
Public Shared Loader As New LoaderTask(Of String, Integer)("CompProject Mod", AddressOf CompFavoritesGet, AddressOf LoaderInput) | ||
Public Shared Storage As New CompProjectStorage | ||
|
||
Private Sub PageDownloadMod_Inited(sender As Object, e As EventArgs) Handles Me.Initialized | ||
PageLoaderInit(Load, PanLoad, PanContent, Nothing, Loader, AddressOf Load_OnFinish, AddressOf LoaderInput) | ||
End Sub | ||
Private Shared Function LoaderInput() As String | ||
Return ReadReg("CustomCompFavorites") | ||
End Function | ||
Private Shared Function CompFavoritesGet(Task As LoaderTask(Of String, Integer)) | ||
|
||
End Function | ||
|
||
'结果 UI 化 | ||
Private Sub Load_OnFinish() | ||
Try | ||
|
||
Catch ex As Exception | ||
Log(ex, "可视化收藏夹列表出错", LogLevel.Feedback) | ||
End Try | ||
End Sub | ||
|
||
'自动重试 | ||
Private Sub Load_State(sender As Object, state As MyLoading.MyLoadingState, oldState As MyLoading.MyLoadingState) Handles Load.StateChanged | ||
Select Case Loader.State | ||
Case LoadState.Failed | ||
Dim ErrorMessage As String = "" | ||
If Loader.Error IsNot Nothing Then ErrorMessage = Loader.Error.Message | ||
If ErrorMessage.Contains("不是有效的 json 文件") Then | ||
Log("[Download] 下载的 Mod 列表 json 文件损坏,已自动重试", LogLevel.Debug) | ||
PageLoaderRestart() | ||
End If | ||
End Select | ||
End Sub | ||
|
||
|
||
#Region "搜索" | ||
|
||
'搜索按钮 | ||
Private Sub StartNewSearch() Handles PanSearchBox.TextInput | ||
Loader.Start() | ||
End Sub | ||
|
||
#End Region | ||
|
||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters