private void changePathsButton_Click(object sender, RoutedEventArgs e) { string game = InputComboBoxWPF.GetValue(this, "Which game's path do you want to change?", "Change game paths", new[] { "Mass Effect", "Mass Effect 2", "Mass Effect 3" }, "Mass Effect 3"); if (game != "") { OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = $"Select {game} executable."; game = game.Replace(" ", ""); string filter = $"{game}.exe|{game}.exe"; ofd.Filter = filter; if (ofd.ShowDialog() == true) { string result = Path.GetDirectoryName(Path.GetDirectoryName(ofd.FileName)); if (game.Last() == '3') { result = Path.GetDirectoryName(result); } switch (game) { case "MassEffect": me1PathBox.Text = result; break; case "MassEffect2": me2PathBox.Text = result; break; case "MassEffect3": me3PathBox.Text = result; break; } } } }
public static void Initialize() { HashSet <Tool> set = new(); #region Install Mods set.Add(new Tool { name = "AutoTOC", type = typeof(AutoTOCWPF), icon = Application.Current.FindResource("iconAutoTOC") as ImageSource, open = () => { (new AutoTOCWPF()).Show(); }, tags = new List <string> { "user", "toc", "tocing", "crash", "infinite", "loop", "loading" }, description = "AutoTOC is a tool for ME3 that updates and/or creates the PCConsoleTOC.bin files associated with the base game and each DLC.\n\nRunning this tool upon mod installation is imperative to ensuring proper functionality of the game." }); #if DEBUG set.Add(new Tool { name = "Memory Analyzer", type = typeof(ME3ExpMemoryAnalyzer.MemoryAnalyzerUI), icon = Application.Current.FindResource("iconMemoryAnalyzer") as ImageSource, open = () => { (new ME3ExpMemoryAnalyzer.MemoryAnalyzerUI()).Show(); }, tags = new List <string> { "utility", "toolsetdev" }, subCategory = "For Toolset Devs Only", description = "Memory Analyzer allows you to track references to objects to help trace memory leaks." }); set.Add(new Tool { name = "File Hex Analyzer", type = typeof(FileHexViewerWPF), icon = Application.Current.FindResource("iconFileHexAnalyzer") as ImageSource, open = () => { (new FileHexViewer.FileHexViewerWPF()).Show(); }, tags = new List <string> { "utility", "toolsetdev", "hex" }, subCategory = "For Toolset Devs Only", description = "File Hex Analyzer is a package hex viewer that shows references in the package hex. It also works with non-package files, but won't show any references, obviously." }); #endif #endregion #region Utilities //set.Add(new Tool //{ // name = "Animation Explorer", // type = typeof(AnimationExplorer.AnimationExplorer), // icon = Application.Current.FindResource("iconAnimationExplorer") as ImageSource, // open = () => // { // (new AnimationExplorer.AnimationExplorer()).Show(); // }, // tags = new List<string> { "utility", "animation", "gesture", "bone", "PSA" }, // subCategory = "Explorers", // description = "Animation Explorer can build a database of all the files containing animtrees and complete animsets in Mass Effect 3. You can import and export Animsets to PSA files." //}); set.Add(new Tool { name = "Animation Viewer", type = typeof(AnimationExplorer.AnimationViewer), icon = Application.Current.FindResource("iconAnimViewer") as ImageSource, open = () => { if (AnimationExplorer.AnimationViewer.Instance == null) { (new AnimationExplorer.AnimationViewer()).Show(); } else { AnimationExplorer.AnimationViewer.Instance.RestoreAndBringToFront(); } }, tags = new List <string> { "utility", "animation", "gesture" }, subCategory = "Explorers", description = "Animation Viewer allows you to preview any animation in Mass Effect 3" }); set.Add(new Tool { name = "Live Level Editor", type = typeof(GameInterop.LiveLevelEditor), icon = Application.Current.FindResource("iconLiveLevelEditor") as ImageSource, open = () => { var gameStr = InputComboBoxWPF.GetValue(null, "Choose game you want to use Live Level Editor with.", "Live Level Editor game selector", new[] { "ME3", "ME2" }, "ME3"); if (Enum.TryParse(gameStr, out MEGame game)) { if (GameInterop.LiveLevelEditor.Instance(game) is {} instance) { instance.RestoreAndBringToFront(); } else { (new GameInterop.LiveLevelEditor(game)).Show(); } } },
private void EditItem() { if (!HasActiveLink()) { return; } var editLink = linkTable[datagrid_Links.SelectedIndex]; //Set new Link var links = new List <string>(); int l = editLink.Index; //Get current link if (IsReply) { foreach (var entry in ParentWindow.SelectedConv.EntryList) { links.Add($"{entry.NodeCount}: {entry.LineStrRef} {entry.Line}"); } } else { foreach (var entry in ParentWindow.SelectedConv.ReplyList) { links.Add($"{entry.NodeCount}: {entry.LineStrRef} {entry.Line}"); } } string ldlg = InputComboBoxWPF.GetValue(this, "Pick the next dialogue node to link to", "Dialogue Editor", links, links[l]); if (string.IsNullOrEmpty(ldlg)) { return; } editLink.Index = links.FindIndex(ldlg.Equals); if (!IsReply) { //Set StrRef int strRef = 0; bool isNumber = false; while (!isNumber) { var response = PromptDialog.Prompt(this, "Enter the TLK String Reference for the dialogue wheel:", "Link Editor", editLink.ReplyStrRef.ToString()); if (response == null || response == "0") { return; } isNumber = int.TryParse(response, out strRef); if (!isNumber || strRef <= 0) { var wdlg = MessageBox.Show("The string reference must be a positive whole number.", "Dialogue Editor", MessageBoxButton.OKCancel); if (wdlg == MessageBoxResult.Cancel) { return; } } } editLink.ReplyStrRef = strRef; ////Set GUI Reply style var rc = editLink.RCategory; //Get current link string rdlg = InputComboBoxWPF.GetValue(this, "Pick the wheel position or interrupt:", "Dialogue Editor", Enums.GetNames <EReplyCategory>(), rc.ToString()); if (string.IsNullOrEmpty(rdlg)) { return; } rc = Enums.Parse <EReplyCategory>(rdlg); editLink.RCategory = rc; } ParseLink(editLink); ReOrderTable(); NeedsSave = true; }
private void changePathsButton_Click(object sender, RoutedEventArgs e) { string game = InputComboBoxWPF.GetValue(this, "Which game's path do you want to change?", "Change game paths", new[] { "Mass Effect", "Mass Effect 2", "Mass Effect 3" }, "Mass Effect 3"); if (game != "") { List <string> allowedVersions = new List <string>(); switch (game) { case "Mass Effect": allowedVersions.Add("1.2.20608.0"); break; case "Mass Effect 2": allowedVersions.Add("1.2.1604.0"); // Steam allowedVersions.Add("01604.00"); // Origin break; case "Mass Effect 3": allowedVersions.Add("05427.124"); break; } OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = $"Select {game} executable."; game = game.Replace(" ", ""); string filter = $"{game}.exe|{game}.exe"; ofd.Filter = filter; if (ofd.ShowDialog() == true) { var fvi = FileVersionInfo.GetVersionInfo(ofd.FileName); if (!allowedVersions.Contains(fvi.FileVersion)) { MessageBox.Show($"Cannot use this executable: The only supported file versions are:\n{string.Join("\n", allowedVersions)}\n\nThe selected one has version: {fvi.FileVersion}\n\nNote: ME3Explorer does not support Mass Effect Legendary Edition games.", "Invalid game", MessageBoxButton.OK, MessageBoxImage.Error); return; } string result = Path.GetDirectoryName(Path.GetDirectoryName(ofd.FileName)); if (game.Last() == '3') { result = Path.GetDirectoryName(result); } switch (game) { case "MassEffect": me1PathBox.Text = result; break; case "MassEffect2": me2PathBox.Text = result; break; case "MassEffect3": me3PathBox.Text = result; break; } } } }