diff --git a/Directory.Build.props b/Directory.Build.props index 0d8c6927..7159642e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,7 @@ AnyCPU 11.0 2.12.2.0 + true diff --git a/MisakaTranslator-WPF/GuidePages/Hook/ChooseGamePage.xaml.cs b/MisakaTranslator-WPF/GuidePages/Hook/ChooseGamePage.xaml.cs index f6d11db3..880dd5eb 100644 --- a/MisakaTranslator-WPF/GuidePages/Hook/ChooseGamePage.xaml.cs +++ b/MisakaTranslator-WPF/GuidePages/Hook/ChooseGamePage.xaml.cs @@ -54,7 +54,7 @@ private void ConfirmButton_Click(object sender, RoutedEventArgs e) Common.textHooker = new TextHookHandle(SameNameGameProcessList); } - if(!Common.textHooker.Init(!(bool)x64GameCheckBox.IsChecked)) + if (!Common.textHooker.Init((bool)x64GameCheckBox.IsChecked ? Common.appSettings.Textractor_Path64 : Common.appSettings.Textractor_Path32)) { HandyControl.Controls.MessageBox.Show(Application.Current.Resources["MainWindow_TextractorError_Hint"].ToString()); return; diff --git a/MisakaTranslator-WPF/IAppSettings.cs b/MisakaTranslator-WPF/IAppSettings.cs index 54320919..c0a58748 100644 --- a/MisakaTranslator-WPF/IAppSettings.cs +++ b/MisakaTranslator-WPF/IAppSettings.cs @@ -455,6 +455,12 @@ string ForegroundHex [Option(Alias = "Mecab.dicPath", DefaultValue = "")] string Mecab_dicPath { get; set; } + + [Option(Alias = "Textractor.Path32", DefaultValue = "")] + string Textractor_Path32 { get; set; } + + [Option(Alias = "Textractor.Path64", DefaultValue = "")] + string Textractor_Path64 { get; set; } } public interface IRepeatRepairSettings diff --git a/MisakaTranslator-WPF/MainWindow.xaml.cs b/MisakaTranslator-WPF/MainWindow.xaml.cs index 6afb0dda..33bfd787 100644 --- a/MisakaTranslator-WPF/MainWindow.xaml.cs +++ b/MisakaTranslator-WPF/MainWindow.xaml.cs @@ -250,7 +250,7 @@ private async Task StartTranslateByGid(int gid) { Common.textHooker = pidList.Count == 1 ? new TextHookHandle(pidList[0].Id) : new TextHookHandle(pidList); - if(!Common.textHooker.Init(!gameInfoList[gid].Isx64)) + if (!Common.textHooker.Init(gameInfoList[gid].Isx64 ? Common.appSettings.Textractor_Path64 : Common.appSettings.Textractor_Path32)) { HandyControl.Controls.MessageBox.Show(Application.Current.Resources["MainWindow_TextractorError_Hint"].ToString()); return; diff --git a/MisakaTranslator-WPF/SettingsPages/DictionaryPages/MecabDictPage.xaml.cs b/MisakaTranslator-WPF/SettingsPages/DictionaryPages/MecabDictPage.xaml.cs index bfd49d05..0bd73bd6 100644 --- a/MisakaTranslator-WPF/SettingsPages/DictionaryPages/MecabDictPage.xaml.cs +++ b/MisakaTranslator-WPF/SettingsPages/DictionaryPages/MecabDictPage.xaml.cs @@ -17,7 +17,6 @@ public MecabDictPage() private void ChoosePathBtn_Click(object sender, RoutedEventArgs e) { - FolderBrowserDialog dialog = new(); if (dialog.ShowDialog() == DialogResult.OK) { diff --git a/MisakaTranslator-WPF/SettingsPages/HookSettingsPage.xaml b/MisakaTranslator-WPF/SettingsPages/HookSettingsPage.xaml index 3d625cab..21427165 100644 --- a/MisakaTranslator-WPF/SettingsPages/HookSettingsPage.xaml +++ b/MisakaTranslator-WPF/SettingsPages/HookSettingsPage.xaml @@ -13,12 +13,32 @@ - - - - - -