Skip to content

Commit

Permalink
增加随机主页预设
Browse files Browse the repository at this point in the history
  • Loading branch information
myunco committed Jan 17, 2025
1 parent 604bcd0 commit 0c456bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Plain Craft Launcher 2/Pages/PageLaunch/PageLaunchRight.xaml.vb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ Download:
Exit Sub
End If
Case 3
Select Case Setup.Get("UiCustomPreset")
Static RandomFlag As Boolean
Static PresetIndex As Integer
Dim Preset = Setup.Get("UiCustomPreset")
If Preset <> 12 Then '非随机预设
PresetIndex = Preset
ElseIf RandomFlag = False Then '确保每次启动只生成一次随机数
Log("[Page] 主页预设:随机预设")
PresetIndex = New Random().Next(0, 12) '生成0-11的随机数
RandomFlag = True
End If
Select Case PresetIndex
Case 0
Log("[Page] 主页预设:你知道吗")
Content = "
Expand Down
1 change: 1 addition & 0 deletions Plain Craft Launcher 2/Pages/PageSetup/PageSetupUI.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
<local:MyComboBoxItem Content="PCL 新功能说明书(作者:WForst-Breeze)" />
<local:MyComboBoxItem Content="OpenMCIM 仪表盘(作者:SALTWOOD)" />
<local:MyComboBoxItem Content="杂志主页(作者:CreeperIsASpy)" />
<local:MyComboBoxItem Content="随机预设(每次启动随机选择一个预设)" />
</local:MyComboBox>
</Grid>
</StackPanel>
Expand Down

0 comments on commit 0c456bc

Please sign in to comment.