✨ 为版本设置添加启动前内存优化
This commit is contained in:
@@ -113,10 +113,16 @@ Public Module ModLaunch
|
||||
New LoaderTask(Of Process, Integer)("等待游戏窗口出现", AddressOf McLaunchWait) With {.ProgressWeight = 1},
|
||||
New LoaderTask(Of Integer, Integer)("结束处理", AddressOf McLaunchEnd) With {.ProgressWeight = 1}
|
||||
}
|
||||
If Setup.Get("LaunchArgumentRam") Then
|
||||
Select Case Setup.Get("VersionRamOptimize", Version:=McVersionCurrent)
|
||||
Case 0 '全局
|
||||
If Not Setup.Get("LaunchArgumentRam") Then GoTo JumpRamOptimize
|
||||
Case 2 '关闭
|
||||
GoTo JumpRamOptimize
|
||||
End Select
|
||||
CType(Loaders(2), LoaderCombo(Of String)).Block = False
|
||||
Loaders.Insert(3, New LoaderTask(Of Integer, Integer)("内存优化", AddressOf McLaunchMemoryOptimize) With {.ProgressWeight = 30})
|
||||
End If
|
||||
JumpRamOptimize:
|
||||
|
||||
Dim LaunchLoader As New LoaderCombo(Of Object)("Minecraft 启动", Loaders) With {.Show = False}
|
||||
If McLoginLoader.State = LoadState.Finished Then McLoginLoader.State = LoadState.Waiting '要求重启登录主加载器,它会自行决定是否启动副加载器
|
||||
'等待加载器执行并更新 UI
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
{"VersionAdvanceRunWait", New SetupEntry(True, Source:=SetupSource.Version)},
|
||||
{"VersionRamType", New SetupEntry(2, Source:=SetupSource.Version)},
|
||||
{"VersionRamCustom", New SetupEntry(15, Source:=SetupSource.Version)},
|
||||
{"VersionRamOptimize", New SetupEntry(0, Source:=SetupSource.Version)},
|
||||
{"VersionArgumentTitle", New SetupEntry("", Source:=SetupSource.Version)},
|
||||
{"VersionArgumentInfo", New SetupEntry("", Source:=SetupSource.Version)},
|
||||
{"VersionArgumentIndie", New SetupEntry(-1, Source:=SetupSource.Version)},
|
||||
|
||||
@@ -106,6 +106,22 @@
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="2" x:Name="LabRamGame" Text="2.5 GB" Grid.ColumnSpan="3" TextTrimming="None" Margin="2,3,0,0" FontSize="16" Foreground="Black" HorizontalAlignment="Left" />
|
||||
</Grid>
|
||||
<Grid Margin="0,15,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Margin="0,6,0,0" Text="启动游戏前进行内存优化" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" />
|
||||
<local:MyComboBox x:Name="ComboRamOptimize" Margin="10,0,0,0" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="2">
|
||||
<local:MyComboBoxItem Content="使用全局设置" IsSelected="True" />
|
||||
<local:MyComboBoxItem Content="开启" />
|
||||
<local:MyComboBoxItem Content="关闭" />
|
||||
</local:MyComboBox>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</local:MyCard>
|
||||
<local:MyCard x:Name="CardServer" Margin="0,0,0,15" Title="服务器">
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
'游戏内存
|
||||
CType(FindName("RadioRamType" & Setup.Load("VersionRamType", Version:=PageVersionLeft.Version)), MyRadioBox).Checked = True
|
||||
SliderRamCustom.Value = Setup.Get("VersionRamCustom", Version:=PageVersionLeft.Version)
|
||||
ComboRamOptimize.SelectedIndex = Setup.Get("VersionRamOptimize", Version:=PageVersionLeft.Version)
|
||||
|
||||
'服务器
|
||||
TextServerEnter.Text = Setup.Get("VersionServerEnter", Version:=PageVersionLeft.Version)
|
||||
@@ -95,6 +96,7 @@
|
||||
Setup.Set("VersionArgumentIndie", 0, Version:=PageVersionLeft.Version)
|
||||
Setup.Reset("VersionRamType", Version:=PageVersionLeft.Version)
|
||||
Setup.Reset("VersionRamCustom", Version:=PageVersionLeft.Version)
|
||||
Setup.Reset("VersionRamOptimize", Version:=PageVersionLeft.Version)
|
||||
Setup.Reset("VersionAdvanceJvm", Version:=PageVersionLeft.Version)
|
||||
Setup.Reset("VersionAdvanceGame", Version:=PageVersionLeft.Version)
|
||||
Setup.Reset("VersionAdvanceAssets", Version:=PageVersionLeft.Version)
|
||||
@@ -362,6 +364,11 @@ PreFin:
|
||||
Return RamGive
|
||||
End Function
|
||||
|
||||
Private Sub ComboRamOptimize_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ComboRamOptimize.SelectionChanged
|
||||
If AniControlEnabled <> 0 Then Exit Sub
|
||||
Setup.Set("VersionRamOptimize", ComboRamOptimize.SelectedIndex, Version:=PageVersionLeft.Version)
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "服务器"
|
||||
|
||||
Reference in New Issue
Block a user