Skip to content

Commit

Permalink
开放阻止自动更新功能,阻止自动更新后软件将给予提示
Browse files Browse the repository at this point in the history
  • Loading branch information
lintx committed Jan 11, 2023
1 parent 6542732 commit c05d996
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Start/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ namespace Start
/// </summary>
public partial class App : Application
{
public static MainWindow mainWindow;
}

}
1 change: 1 addition & 0 deletions Start/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ private void waitProcess()
{
//该方法尚未验证,需要验证升级窗口的父ID是否是游戏本地,和打开升级窗口后父ID是否已退出
_p.Kill();
App.mainWindow.Alert("警告","发现游戏尝试进行自动升级,已阻止!");
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Start/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<ToggleButton IsChecked="{Binding AutoRun,Mode=TwoWay}" Width="32" Height="32" Margin="2 0 0 0" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="刷新密码后是否自动运行游戏" Content="{materialDesign:PackIcon Kind=CandyOutline}" />
<ToggleButton IsChecked="{Binding SkipPlayer,Mode=TwoWay}" Width="32" Height="32" Margin="2 0 0 0" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="是否跳过Play窗口&#x0a;检测到Play窗口后自动将其关闭" Content="{materialDesign:PackIcon Kind=AirHumidifier}" />
<ToggleButton IsChecked="{Binding SkipNgs,Mode=TwoWay}" Width="32" Height="32" Margin="2 0 0 0" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="是否自动结束右下角NGS画面&#x0a;有的人会卡NGS导致无法进入游戏&#x0a;可以手动结束相关进程进入游戏&#x0a;参考:https://forum.gamer.com.tw/C.php?bsn=7650&amp;snA=1018778" Content="{materialDesign:PackIcon Kind=DogSide}" />
<ToggleButton IsChecked="{Binding PreventAutoUpdate,Mode=TwoWay}" IsEnabled="False" Width="32" Height="32" Margin="2 0 0 0" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="是否阻止自动更新&#x0a;枫之谷自动更新可能会造成游戏损坏&#x0a;勾选后检测到游戏更新程序会自动终止" Content="{materialDesign:PackIcon Kind=UploadOutline}" />
<ToggleButton IsChecked="{Binding PreventAutoUpdate,Mode=TwoWay}" Width="32" Height="32" Margin="2 0 0 0" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="是否阻止自动更新&#x0a;枫之谷自动更新可能会造成游戏损坏&#x0a;勾选后检测到游戏更新程序会自动终止" Content="{materialDesign:PackIcon Kind=UploadOutline}" />
</StackPanel>
<Grid Grid.Row="4">
<Grid.ColumnDefinitions>
Expand Down
3 changes: 2 additions & 1 deletion Start/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public partial class MainWindow : Window
public MainWindow()
{
InitializeComponent();
App.mainWindow = this;
Environment.CurrentDirectory = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);
#if !DEBUG
InitMutex();
Expand Down Expand Up @@ -530,7 +531,7 @@ private void ShowYesNodDialog(string title, string message, RoutedEventHandler y
DialogHost.Show(yesNoDialog, "RootDialog");
}

private void Alert(string title, string content)
internal void Alert(string title, string content)
{
yesDialogTitleTxt.Text = title;
yesDialogTxt.Text = content;
Expand Down
4 changes: 2 additions & 2 deletions Start/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.6.0.0")]
[assembly: AssemblyFileVersion("2.6.0.0")]
[assembly: AssemblyVersion("2.7.0.0")]
[assembly: AssemblyFileVersion("2.7.0.0")]

0 comments on commit c05d996

Please sign in to comment.