Skip to content
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5cd437b
feat:你知道吗
xrlzu Nov 23, 2025
e7c2a56
简化一下
xrlzu Nov 23, 2025
6c32d8c
更新 hints.txt
xrlzu Nov 23, 2025
0e1472b
Pangu
xrlzu Nov 23, 2025
3e3181d
加回启动时的你知道吗
xrlzu Nov 23, 2025
1bee20b
修改一些奇怪的内容
xrlzu Nov 23, 2025
119b670
改个字
xrlzu Nov 23, 2025
6781ab9
Resolve conversation
xrlzu Nov 24, 2025
cbbb0ea
移除和修改一些可能不太对的内容
xrlzu Nov 24, 2025
c4e816f
添加一些内容
xrlzu Nov 24, 2025
ea46eb3
添加一些内容
xrlzu Nov 24, 2025
7041d97
Merge branch 'dev' into nzdm
xrlzu Nov 24, 2025
25e570f
移除和修改一些可能不太对的内容,并添加一些新内容
xrlzu Nov 24, 2025
dc6b174
移除大部分内容
xrlzu Nov 24, 2025
c70c83d
添加转义,防止报错
xrlzu Nov 24, 2025
3e3375c
添加有关于生物的内容
xrlzu Nov 25, 2025
a3529b8
Pangu
xrlzu Nov 25, 2025
544fbdc
Merge branch 'dev' into nzdm
xrlzu Nov 25, 2025
996da88
限制启动页面的文本长度为3行
xrlzu Nov 25, 2025
06ca6b6
添加有关于结构的内容
xrlzu Nov 25, 2025
9e00d5b
添加有关于结构的内容
xrlzu Nov 26, 2025
e6f7b07
chore: 排版风格优化
MoYuan-CN Nov 28, 2025
5f17561
Merge branch 'dev' into nzdm
MoYuan-CN Nov 28, 2025
0cd5c7a
Merge branch 'dev' into nzdm
xrlzu Nov 29, 2025
88f4167
确保启动页面的你知道吗中不会出现过长内容
xrlzu Nov 30, 2025
a77a868
Merge branch 'PCL-Community:dev' into nzdm
xrlzu Nov 30, 2025
b1822fe
Merge branch 'PCL-Community:dev' into nzdm
xrlzu Nov 30, 2025
d3ebf61
Merge branch 'PCL-Community:dev' into nzdm
xrlzu Dec 4, 2025
8c01ea2
Merge branch 'dev' into nzdm
xrlzu Dec 5, 2025
cc408a0
fix
xrlzu Dec 6, 2025
2f92d76
rollback
xrlzu Dec 6, 2025
965e5b1
Merge branch 'nzdm' of https://github.com/PCL-Community/PCL2-CE-xrlzu…
xrlzu Dec 6, 2025
ecb5633
byd缩进
xrlzu Dec 6, 2025
5ba3a8c
byd缩进2
xrlzu Dec 6, 2025
fe41730
漏了一行
xrlzu Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,25 @@
<TextBlock FontSize="12.5" Margin="0,0,0,5" Text="69.28 %" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" Name="LabLaunchingProgress" />
<TextBlock FontSize="12.5" Margin="0,0,0,5" Text="下载速度" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" Opacity="0" Name="LabLaunchingDownloadLeft" Visibility="Collapsed" />
<TextBlock FontSize="12.5" Margin="0,0,0,5" Text="5.2 M/s" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Left" Name="LabLaunchingDownload" Opacity="0" Visibility="Collapsed" />
<Grid x:Name="PanLaunchingHint" HorizontalAlignment="Center" Grid.Row="2" Grid.ColumnSpan="5" Grid.RowSpan="2" Width="260" Visibility="Collapsed" Margin="0,16,0,2" Opacity="0">
<Border Margin="0,8,0,0" BorderThickness="1" CornerRadius="3" BorderBrush="{StaticResource ColorBrushGray1}" Opacity="0.5">
<Border.Clip>
<CombinedGeometry GeometryCombineMode="Exclude">
<CombinedGeometry.Geometry1>
<RectangleGeometry Rect="0,0,1000,1000" />
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
<RectangleGeometry Rect="94,0,72,10" />
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Border.Clip>
</Border>
<TextBlock FontSize="12.5" Text="你知道吗" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="{StaticResource ColorBrushGray1}" Opacity="0.5" />
<TextBlock x:Name="LabLaunchingHint" FontSize="12.5" Text="这是一段测试用的小提示文本,它应该足够长以让它有两行。" Margin="11,21,11,10" TextWrapping="Wrap" HorizontalAlignment="Center" MaxHeight="54" TextTrimming="CharacterEllipsis" />
</Grid>
</Grid>
</StackPanel>
<local:MyButton Grid.Row="4" x:Name="BtnCancel" Height="35" Margin="20,0,20,20" VerticalAlignment="Bottom" Text="取消" />
</Grid>
</local:MyPageLeft>

33 changes: 23 additions & 10 deletions Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchLeft.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ Public Class PageLaunchLeft

#Region "切换大页面"

''' <summary>
''' 获取你知道吗。
''' </summary>
Private Function GetRandomHint() As String
Return PageLaunchRight.GetRandomHint(True)
End Function
''' <summary>
''' 切换至启动中页面。
''' </summary>
Expand Down Expand Up @@ -139,22 +145,25 @@ Public Class PageLaunchLeft
LabLaunchingDownloadLeft.Visibility = Visibility.Collapsed
ProgressLaunchingFinished.Width = New GridLength(0, GridUnitType.Star)
ProgressLaunchingUnfinished.Width = New GridLength(1, GridUnitType.Star)
PanLaunchingHint.Opacity = 0
PanLaunchingHint.Visibility = Visibility.Collapsed
PanLaunchingInfo.Width = Double.NaN '重置宽度改变动画
McLaunchProcess = Nothing
McLaunchWatcher = Nothing
LabLaunchingHint.Text = GetRandomHint()
'初始化其他页面
PanInput.IsHitTestVisible = False
PanLaunching.IsHitTestVisible = False
LoadLaunching.State.LoadingState = MyLoading.MyLoadingState.Run
PanLaunching.Visibility = Visibility.Visible
AniStart({
AaOpacity(PanInput, 0, 50), '略作延迟,这样如果预检测失败,不会出现奇怪的弹一下的动画
AaOpacity(PanInput, -PanInput.Opacity, 110, , New AniEaseInFluent, True),
AaScaleTransform(PanInput, 1.2 - CType(PanInput.RenderTransform, ScaleTransform).ScaleX, 160),
AaOpacity(PanLaunching, 1 - PanLaunching.Opacity, 150, 100),
AaScaleTransform(PanLaunching, 1 - CType(PanLaunching.RenderTransform, ScaleTransform).ScaleX, 500, 100, New AniEaseOutBack(AniEasePower.Weak)),
AaCode(Sub() PanLaunching.IsHitTestVisible = True, 150)
}, "Launch State Page")
AaOpacity(PanInput, 0, 50), '略作延迟,这样如果预检测失败,不会出现奇怪的弹一下的动画
AaOpacity(PanInput, -PanInput.Opacity, 110, , New AniEaseInFluent, True),
AaScaleTransform(PanInput, 1.2 - CType(PanInput.RenderTransform, ScaleTransform).ScaleX, 160),
AaOpacity(PanLaunching, 1 - PanLaunching.Opacity, 150, 100),
AaScaleTransform(PanLaunching, 1 - CType(PanLaunching.RenderTransform, ScaleTransform).ScaleX, 500, 100, New AniEaseOutBack(AniEasePower.Weak)),
AaCode(Sub() PanLaunching.IsHitTestVisible = True, 150)
}, "Launch State Page")
End Sub
''' <summary>
''' 切换至登录页面。
Expand Down Expand Up @@ -598,10 +607,14 @@ ExitRefresh:
If IsProgressStateChanged Then
LabLaunchingProgress.Visibility = Visibility.Visible
LabLaunchingProgressLeft.Visibility = Visibility.Visible
If IsLaunched Then
PanLaunchingHint.Visibility = Visibility.Visible
End If
AnimList.AddRange({
AaOpacity(LabLaunchingProgress, If(Not IsLaunched, 1, 0) - LabLaunchingProgress.Opacity, 100),
AaOpacity(LabLaunchingProgressLeft, If(Not IsLaunched, 0.5, 0) - LabLaunchingProgressLeft.Opacity, 100)
})
AaOpacity(LabLaunchingProgress, If(Not IsLaunched, 1, 0) - LabLaunchingProgress.Opacity, 100),
AaOpacity(LabLaunchingProgressLeft, If(Not IsLaunched, 0.5, 0) - LabLaunchingProgressLeft.Opacity, 100),
AaOpacity(PanLaunchingHint, If(IsLaunched, 1, 0) - PanLaunchingHint.Opacity, 100)
})
End If
AniStart(AnimList, "Launching Progress")
Catch ex As Exception
Expand Down
61 changes: 57 additions & 4 deletions Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.vb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Public Class PageLaunchRight
Imports System.Security

Public Class PageLaunchRight
Implements IRefreshable

Private Sub Init() Handles Me.Loaded
Expand Down Expand Up @@ -63,9 +65,19 @@ Download:
End If
Case 3
Select Case Setup.Get("UiCustomPreset")
Case 0, 1
Log("[Page] 主页预设:预设 " & Setup.Get("UiCustomPreset") & " 是已被移除的主页预设")
MyMsgBox("你知道吗 和 回声洞 因为只有空壳因此已被移除,请前往设置选择其他预设主页", "提示")
Case 0
Log("[Page] 主页预设:你知道吗")
Dim hintText As String = PageLaunchRight.GetRandomHint(False)
Content = $"
<local:MyCard Title=""你知道吗?"" Margin=""0,0,0,15"">
<TextBlock Margin=""25,38,23,15"" FontSize=""13.5"" IsHitTestVisible=""False"" Text=""{hintText}"" TextWrapping=""Wrap"" Foreground=""{{DynamicResource ColorBrush1}}"" />
<local:MyIconButton Height=""22"" Width=""22"" Margin=""9"" VerticalAlignment=""Top"" HorizontalAlignment=""Right""
EventType=""刷新主页"" EventData=""/""
Logo=""M875.52 148.48C783.36 56.32 655.36 0 512 0 291.84 0 107.52 138.24 30.72 332.8l122.88 46.08C204.8 230.4 348.16 128 512 128c107.52 0 199.68 40.96 271.36 112.64L640 384h384V0L875.52 148.48zM512 896c-107.52 0-199.68-40.96-271.36-112.64L384 640H0v384l148.48-148.48C240.64 967.68 368.64 1024 512 1024c220.16 0 404.48-138.24 481.28-332.8L870.4 645.12C819.2 793.6 675.84 896 512 896z"" />
</local:MyCard>"
Case 1
Log("[Page] 主页预设:预设 回声洞 是已被移除的主页预设")
MyMsgBox("回声洞 因为只有空壳因此已被移除,请前往设置选择其他预设主页", "提示")
Return
Case 2
Log("[Page] 主页预设:Minecraft 新闻")
Expand Down Expand Up @@ -125,6 +137,47 @@ Download:
End Sub
Private RefreshLock As New Object

Public Shared Function GetRandomHint(Optional enableLengthLimit As Boolean = False) As String
'优先尝试外部文件
Dim externalPath As String = ExePath & "PCL\hints.txt"
If File.Exists(externalPath) Then
Try
Dim lines = File.ReadAllLines(externalPath).Where(Function(l) Not String.IsNullOrWhiteSpace(l)).Select(Function(l) l.Trim()).ToArray()
If lines.Length > 0 Then
Dim validHints As String() = lines
If enableLengthLimit Then
validHints = lines.Where(Function(l) l.Length < 50).ToArray()
If validHints.Length = 0 Then
validHints = lines
Log("[Page] 外部 hints.txt 中没有字数小于50的提示,已取消字数限制", LogLevel.Debug)
End If
End If

Dim hint = validHints(New Random().Next(validHints.Length))
hint = hint.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("""", "&quot;")
Return hint
End If
Log("[Page] 外部 hints.txt 文件为空", LogLevel.Debug)
Return "PCL CE 是由 PCL-Community 开发的 PCL 社区衍生版本"
Catch ex As Exception
Log(ex, "[Page] 读取外部 hints.txt 失败", LogLevel.Hint)
End Try
End If
'回退到嵌入式资源
Try
Using reader As New System.IO.StreamReader(Application.GetResourceStream(New Uri("pack://application:,,,/Plain Craft Launcher 2;component/Resources/hints.txt", UriKind.Absolute)).Stream)
Dim lines = reader.ReadToEnd().Split({vbCr, vbLf}, StringSplitOptions.RemoveEmptyEntries).Where(Function(l) Not String.IsNullOrWhiteSpace(l)).Select(Function(l) l.Trim()).ToArray()
Dim validHints = If(enableLengthLimit, lines.Where(Function(l) l.Length < 50).ToArray(), lines)
Dim hint = validHints(New Random().Next(validHints.Length))
hint = hint.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("""", "&quot;")
Return hint
End Using
Catch ex As Exception
Log(ex, "[Page] 嵌入式资源 hints.txt 读取失败", LogLevel.Hint)
Return "PCL CE 是由 PCL-Community 开发的 PCL 社区衍生版本"
End Try
End Function

'联网获取主页文件
Private OnlineLoader As New LoaderTask(Of String, Integer)("下载主页", AddressOf OnlineLoaderSub) With {.ReloadTimeout = 10 * 60 * 1000}
Private Sub OnlineLoaderSub(Task As LoaderTask(Of String, Integer))
Expand Down
2 changes: 1 addition & 1 deletion Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@
</Grid.ColumnDefinitions>
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="主页预设" Margin="0,0,25,0" />
<local:MyComboBox x:Name="ComboCustomPreset" Grid.ColumnSpan="2" Tag="UiCustomPreset" Grid.Column="1">
<local:MyComboBoxItem Content="你知道吗?(已移除)" Visibility="Collapsed"/>
<local:MyComboBoxItem Content="你知道吗?"/>
<local:MyComboBoxItem Content="回声洞 (已移除)" Visibility="Collapsed"/>
<local:MyComboBoxItem Content="Minecraft 新闻(作者:最亮的信标)" />
<local:MyComboBoxItem Content="简单主页(作者:MFn233)" />
Expand Down
Loading
Loading