Пример #1
0
        private void dLCEditor2ToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            var tool = new DLCEditor2.DLCEditor2();

            OpenMaximized(tool);
            taskbar.AddTool(tool, Properties.Resources.dlc_editor2_64x64);
        }
Пример #2
0
        private async void ExtractButton_Click(object sender, RoutedEventArgs e)
        {
            vm.NotWorking = false;
            bool dlcProblem = false;
            await Task.Run(() =>
            {
                DLCEditor2.DLCEditor2 dlcedit2 = new DLCEditor2.DLCEditor2();
                DebugOutput.PrintLn("Extracting DLC...");
                dlcProblem = !dlcedit2.ExtractAllDLC();
            });

            vm.NotWorking = true;
            MessageBox.Show(dlcProblem ? "Some DLC wasn't extracted. This is likely due to pathing. Check the Debug Window." : "DLC Extracted!");
            this.DialogResult = true;
            this.Close();
        }
Пример #3
0
        private bool FirstTimeSetup()
        {
            DebugOutput.PrintLn("Beginning First Time Setup...");
            List<string> dlcfiles = new List<string>();

            // KFreon: Added game gate here to stop it trying to do stuff for other games
            if (WhichGame == 3)
            {
                DebugOutput.PrintLn("Starting DLC Extraction...");
                StatusUpdater.UpdateText("Extracting all DLC. This will take time...");

                DLCEditor2.DLCEditor2 dlcedit2 = new DLCEditor2.DLCEditor2();
                dlcedit2.ExtractAllDLC();

                // KFreon: Enumerate DLC files here
                dlcfiles = new List<string>(Directory.EnumerateFiles(DLCPath).Where(file => file.ToLower().EndsWith(".pcc") || file.ToLower().EndsWith(".tfc")));
            }

            DebugOutput.PrintLn(String.Format("Starting FTS Window with parameters: Game: {0}  DLCPath: {1}  Cooked: {2}", WhichGame, DLCPath, pathCooked));

            using (TexplorerFirstTimeSetup fts = new TexplorerFirstTimeSetup(WhichGame, DLCPath, pathCooked))
            {
                fts.ShowDialog();
                if (fts.FilesToAddToTree == null)
                {
                    StatusUpdater.UpdateText("First Time Setup Cancelled!");
                    DebugOutput.PrintLn("First time setup cancelled.");
                    return false;
                }
                else
                {
                    Tree.Clear(true);
                    Tree.AddPCCs(fts.FilesToAddToTree);
                    Tree.AddPCCs(dlcfiles);
                }
            }

            BeginTreeScan();


            OutputBoxPrintLn("Performing first time setup. Don't worry, this only has to be done once.");
            return true;
        }
Пример #4
0
        private void rebuildDatabaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("This will delete your current tree and re-scan your gamefiles. Are you sure?", "Reconstruct facial profile?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
            {
                // KFreon: Check game state first in case of update
                CheckGameStates();

                // KFreon: Remove tree
                if (File.Exists(ExecFolder + "me" + WhichGame + "tree.bin"))
                    File.Delete(ExecFolder + "me" + WhichGame + "tree.bin");
                OutputBoxPrintLn(Environment.NewLine + "Rebuilding ME" + WhichGame + " tree...");

                // MrFob: probably unnecessary but if the game is ME3, run extract DLCs just to be sure
                if (WhichGame == 3)
                {
                    DLCEditor2.DLCEditor2 dlcedit2 = new DLCEditor2.DLCEditor2();
                    dlcedit2.ExtractAllDLC();
                }

                // KFreon: Clear everything and rebuild tree
                ClearDisplays();
                Tree = null;
                BeginLoadingTree(true, true);
            }
        }
Пример #5
0
        public static void UpdateTOCs(string pathBIOGame, int WhichGame, string DLCPath, List<string> modifiedDLC = null)
        {
            DebugOutput.PrintLn("Updating Basegame...");
            AutoTOC.AutoTOC toc = new AutoTOC.AutoTOC();
            DLCEditor2.DLCEditor2 dlcedit2 = new DLCEditor2.DLCEditor2();

            // KFreon: Format filenames
            List<string> FileNames = toc.GetFiles(pathBIOGame + "\\");
            List<string> tet = new List<string>(pathBIOGame.Split('\\'));
            tet.RemoveAt(tet.Count - 1);
            string remov = String.Join("\\", tet.ToArray());
            for (int i = 0; i < FileNames.Count; i++)
                FileNames[i] = FileNames[i].Substring(remov.Length + 1);

            // KFreon: Format basepath
            string[] ts = pathBIOGame.Split('\\');
            tet.Clear();
            tet.AddRange(ts);
            tet.RemoveAt(tet.Count - 1);
            string basepath = String.Join("\\", tet.ToArray()) + '\\';
            string tocfile = pathBIOGame + "\\PCConsoleTOC.bin";
            Console.WriteLine("BasePath: " + basepath);
            Console.WriteLine("Tocfile: " + tocfile);
            toc.CreateTOC(basepath, tocfile, FileNames.ToArray());

            // KFreon: Update pcconsole.bin - not updated by WV's code.
            //tocUpdater(pathBIOGame + "\\PCConsoleTOC.bin");
            DebugOutput.PrintLn("Basegame updated.");


            // KFreon: Update DLC TOCs
            // Updated by MrFob - crude for now as a TOC.bin update should be enough but it works.
            if (WhichGame == 3)
            {
                List<string> files = new List<string>(Directory.EnumerateFiles(DLCPath, "Default.sfar", SearchOption.AllDirectories));
                DebugOutput.PrintLn("Updating DLC...");
                dlcedit2.ExtractAllDLC();
                DebugOutput.PrintLn("DLC Updated.");
            }
        }
Пример #6
0
 private void dLCEditor2ToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     var tool = new DLCEditor2.DLCEditor2();
     OpenMaximized(tool);
     taskbar.AddTool(tool, Properties.Resources.dlc_editor2_64x64);
 }