/// <summary> /// 故事模式完美存档 /// </summary> private void StoryModeArchiveClick() { var path = Path.Combine(FileUtil.MyDocuments_Path, @"Rockstar Games\GTA V\Profiles"); if (!Directory.Exists(path)) { MsgBoxUtil.Error("GTA5故事模式存档路径不存在"); return; } if (MessageBox.Show("你确定替换GTA5故事模式存档吗?", "警告", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { try { var dirs = Directory.GetDirectories(path); foreach (var dir in dirs) { var dirIf = new DirectoryInfo(dir); string fullName = Path.Combine(dirIf.FullName, "SGTA50000"); FileUtil.ExtractResFile(FileUtil.Resource_Path + "Other.SGTA50000", fullName); } MsgBoxUtil.Information($"GTA5故事模式存档替换成功,请前往我的文档查看\n\n{path}"); } catch (Exception ex) { MsgBoxUtil.Exception(ex); } } }
/// <summary> /// 启用Kiddion汉化 /// </summary> private void KiddionChsONClick() { if (ProcessUtil.IsAppRun("Kiddion")) { ProcessUtil.CloseProcess("Kiddion_Chs"); ProcessUtil.OpenProcess("Kiddion_Chs", true); } else { MsgBoxUtil.Information("请先启动 Kiddion 程序"); } }
private void Button_WritePlayerName_Click(object sender, RoutedEventArgs e) { AudioUtil.ClickSound(); if (TextBox_OnlineList.Text != "" && TextBox_ChatName.Text != "" && TextBox_ExternalDisplay.Text != "") { Memory.WriteString(Globals.WorldPTR, Offsets.OnlineListPlayerName, TextBox_OnlineList.Text + "\0"); Memory.WriteString(Globals.PlayerChatterNamePTR + 0xBC, null, TextBox_ChatName.Text + "\0"); Memory.WriteString(Globals.PlayerExternalDisplayNamePTR + 0x84, null, TextBox_ExternalDisplay.Text + "\0"); MsgBoxUtil.Information("写入成功,请切换战局生效"); } else { MsgBoxUtil.Warning("内容不能为空"); } }
private void Button_WriteStat_Click(object sender, RoutedEventArgs e) { AudioUtil.ClickSound(); try { File.WriteAllText(FileUtil.GTAHaxStat_Path, string.Empty); using (var sw = new StreamWriter(FileUtil.GTAHaxStat_Path, true)) { sw.Write(TextBox_GTAHaxCodePreview.Text); MsgBoxUtil.Information("写入到stat.txt文件成功,现在可以打开GTAHax导入代码执行了"); } } catch (Exception ex) { MsgBoxUtil.Exception(ex); } }
private void Button_AddBlcokWords_Click(object sender, RoutedEventArgs e) { AudioUtil.ClickSound(); var txt = TextBox_InputBlcokWord.Text; if (!string.IsNullOrEmpty(txt)) { foreach (string item in ListBox_BlcokWords.Items) { if (item.Equals(txt)) { MsgBoxUtil.Information($"关键词 {txt} 已经添加过了,请勿重复添加"); return; } } ListBox_BlcokWords.Items.Add(txt); ListBox_BlcokWords.SelectedIndex = ListBox_BlcokWords.Items.Count - 1; TextBox_InputBlcokWord.Clear(); } }
/// <summary> /// 重命名小助手为中文 /// </summary> private void ReNameAppCNClick() { try { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(FileUtil.Current_Path); if (fileNameWithoutExtension != (CoreUtil.MainAppWindowName + CoreUtil.ClientVersionInfo)) { FileUtil.FileReName(FileUtil.Current_Path, FileUtil.GetCurrFullPath(CoreUtil.MainAppWindowName + CoreUtil.ClientVersionInfo + ".exe")); ProcessUtil.CloseTheseProcess(); App.AppMainMutex.Dispose(); ProcessUtil.OpenLink(FileUtil.GetCurrFullPath(CoreUtil.MainAppWindowName + CoreUtil.ClientVersionInfo + ".exe")); Application.Current.Shutdown(); } else { MsgBoxUtil.Information("程序文件名已经符合中文命名标准,无需继续重命名"); } } catch (Exception ex) { MsgBoxUtil.Exception(ex); } }
/// <summary> /// 重命名小助手为英文 /// </summary> private void ReNameAppENClick() { try { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(FileUtil.Current_Path); if (fileNameWithoutExtension != "GTA5OnlineTools") { FileUtil.FileReName(FileUtil.Current_Path, "GTA5OnlineTools.exe"); ProcessUtil.CloseTheseProcess(); App.AppMainMutex.Dispose(); ProcessUtil.OpenLink(FileUtil.GetCurrFullPath("GTA5OnlineTools.exe")); Application.Current.Shutdown(); } else { MsgBoxUtil.Information("程序文件名已经符合英文命名标准,无需继续重命名"); } } catch (Exception ex) { MsgBoxUtil.Exception(ex); } }
private void Button_ImportStat_Click(object sender, RoutedEventArgs e) { AudioUtil.ClickSound(); if (!ProcessUtil.IsAppRun("GTAHax")) { ProcessUtil.OpenProcess("GTAHax", false); } Task.Run(() => { bool isRun = false; do { if (ProcessUtil.IsAppRun("GTAHax")) { isRun = true; var pGTAHax = Process.GetProcessesByName("GTAHax").ToList()[0]; bool isShow = false; do { IntPtr Menu_handle = pGTAHax.MainWindowHandle; IntPtr child_handle = WinAPI.FindWindowEx(Menu_handle, IntPtr.Zero, "Static", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Static", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Static", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Static", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Edit", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Edit", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Button", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Button", null); child_handle = WinAPI.FindWindowEx(Menu_handle, child_handle, "Button", null); if (child_handle != IntPtr.Zero) { isShow = true; WinAPI.SendMessage(child_handle, WinAPI.WM_LBUTTONDOWN, IntPtr.Zero, null); WinAPI.SendMessage(child_handle, WinAPI.WM_LBUTTONUP, IntPtr.Zero, null); MsgBoxUtil.Information("导入到GTAHax成功!代码正在执行,请返回GTAHax和GTA5游戏查看\n\n如果未执行,请重新点击\"导入GTAHax\"\n如果执行成功游戏内会出现大受好评奖章"); } else { isShow = false; } Task.Delay(100).Wait(); } while (!isShow); } else { isRun = false; } Task.Delay(100).Wait(); } while (!isRun); }); }