diff --git a/TsubakiTranslator/Properties/PublishProfiles/FolderProfile.pubxml b/TsubakiTranslator/Properties/PublishProfiles/FolderProfile.pubxml index 7bae257..8fe339f 100644 --- a/TsubakiTranslator/Properties/PublishProfiles/FolderProfile.pubxml +++ b/TsubakiTranslator/Properties/PublishProfiles/FolderProfile.pubxml @@ -6,12 +6,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU - bin\Release\net6.0-windows\publish\noRT + bin\Release\net6.0-windows\publish\win64 FileSystem net6.0-windows10.0.17763.0 win-x64 - false - false + true + true false + false \ No newline at end of file diff --git a/TsubakiTranslator/Resources/Textractor/x64/texthook.dll b/TsubakiTranslator/Resources/Textractor/x64/texthook.dll index 36d2f21..d494c1b 100644 Binary files a/TsubakiTranslator/Resources/Textractor/x64/texthook.dll and b/TsubakiTranslator/Resources/Textractor/x64/texthook.dll differ diff --git a/TsubakiTranslator/Resources/Textractor/x86/texthook.dll b/TsubakiTranslator/Resources/Textractor/x86/texthook.dll index 7d759ab..3a0183f 100644 Binary files a/TsubakiTranslator/Resources/Textractor/x86/texthook.dll and b/TsubakiTranslator/Resources/Textractor/x86/texthook.dll differ diff --git a/TsubakiTranslator/TsubakiTranslator.csproj b/TsubakiTranslator/TsubakiTranslator.csproj index 3dac212..7d85fd4 100644 --- a/TsubakiTranslator/TsubakiTranslator.csproj +++ b/TsubakiTranslator/TsubakiTranslator.csproj @@ -15,9 +15,10 @@ OTAKU Technology Co., Ltd. https://github.com/Isayama-Kagura/TsubakiTranslator © 2021 Tsubaki Translator - 1.0.6.1 + 1.0.6.2 Tsubaki Translator 7.0 + true diff --git a/TsubakiTranslator/UserGamePage.xaml b/TsubakiTranslator/UserGamePage.xaml index d53118a..ba0f471 100644 --- a/TsubakiTranslator/UserGamePage.xaml +++ b/TsubakiTranslator/UserGamePage.xaml @@ -34,11 +34,14 @@ Text="{Binding GameName, Mode=OneWay}" VerticalAlignment="Center" /> - @@ -99,8 +102,12 @@ diff --git a/TsubakiTranslator/UserGamePage.xaml.cs b/TsubakiTranslator/UserGamePage.xaml.cs index 5397216..ba5e676 100644 --- a/TsubakiTranslator/UserGamePage.xaml.cs +++ b/TsubakiTranslator/UserGamePage.xaml.cs @@ -42,7 +42,8 @@ private void DeleteGame_Button_Click(object sender, System.Windows.RoutedEventAr private void OpenHistoryGame_Button_Click(object sender, RoutedEventArgs e) { - SetProcessItems(); + var list = GetGameProcesses(); + HistoryGameProcessList.ItemsSource = list; GameData item = (GameData)GameListDataGrid.SelectedItem; @@ -91,7 +92,8 @@ private void AcceptGame_Button_Click(object sender, System.Windows.RoutedEventAr private void OpenGameByPid_Button_Click(object sender, RoutedEventArgs e) { - SetProcessItems(); + var list = GetGameProcesses(); + GameProcessList.ItemsSource = list; } //注入进程打开游戏 @@ -137,26 +139,6 @@ where data.ProcessName.Equals(gameProcess.ProcessName) } - - private void SetProcessItems() - { - Process[] ps = Process.GetProcesses(); - List list = new List(); - - foreach (Process p in ps) - { - GameProcess gameProcess = new GameProcess { PID = p.Id, ProcessName = p.ProcessName, ProcessDetail = $"{p.ProcessName} - {p.Id}" }; - list.Add(gameProcess); - } - - - list.Sort((x, y) => string.Compare(x.ProcessName, y.ProcessName)); - ObservableCollection processStrings = new ObservableCollection(list); - GameProcessList.ItemsSource = processStrings; - HistoryGameProcessList.ItemsSource = processStrings; - } - - private void AddRegexRule_Button_Click(object sender, RoutedEventArgs e) { var btn = sender as Button; @@ -221,6 +203,77 @@ private void Ocr_Button_Click(object sender, RoutedEventArgs e) OcrTipsPanel.Children.Add(tb); } } + + private void GameProcessList_LostFocus(object sender, RoutedEventArgs e) + { + string text = ((ComboBox)sender).Text; + if (!text.Equals("")) + { + bool flag = false; + var list = GetGameProcesses(); + + foreach (GameProcess gameProcess in list) + { + if (gameProcess.ProcessDetail.Equals(text)) + { + flag = true; + break; + } + } + + if (!flag) + { + ((ComboBox)sender).Text = ""; + } + } + + + } + + private void GameProcessList_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) + { + string text = ((ComboBox)sender).Text; + ((ComboBox)sender).ItemsSource = null; + var list = GetGameProcesses(); + ObservableCollection processStrings = new ObservableCollection(); + if (!text.Equals("")) + { + foreach (GameProcess gameProcess in list) + { + if (gameProcess.ProcessDetail.Contains(text)) + { + processStrings.Add(gameProcess); + } + } + ((ComboBox)sender).ItemsSource = processStrings; + } + else + ((ComboBox)sender).ItemsSource = list; + + ((ComboBox)sender).IsDropDownOpen = true; + } + + + private ObservableCollection GetGameProcesses() + { + Process[] ps = Process.GetProcesses(); + List list = new List(); + + foreach (Process p in ps) + { + GameProcess gameProcess = new GameProcess { PID = p.Id, ProcessName = p.ProcessName, ProcessDetail = $"{p.ProcessName} - {p.Id}" }; + list.Add(gameProcess); + } + list.Sort((x, y) => string.Compare(x.ProcessName, y.ProcessName)); + ObservableCollection processProcesses = new ObservableCollection(list); + + return processProcesses; + } + + private void GameProcessList_GotFocus(object sender, RoutedEventArgs e) + { + ((ComboBox)sender).IsDropDownOpen = true; + } }