Example #1
0
        private void openInPCCEditorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                return;
            }
            ListViewItem item = listView1.SelectedItems[0];
            TreeNode     t    = TV1.SelectedNode;

            if (t == null)
            {
                return;
            }
            int        l = Convert.ToInt32(item.Name);
            PCCEditor2 p = new PCCEditor2();

            p.MdiParent   = this.MdiParent;
            p.WindowState = FormWindowState.Maximized;
            p.Show();
            try
            {
                p.pcc = new PCCObject(currentPCC);
                p.SetView(2);
                p.RefreshView();
                p.InitStuff();
                p.listBox1.SelectedIndex = l;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:\n" + ex.Message);
            }
        }
Example #2
0
        private void openInPCCEditorToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int l = CurrentObjects[listBox1.SelectedIndex];

            if (l == -1)
            {
                return;
            }
            PCCEditor2 p = new PCCEditor2();

            p.MdiParent   = this.MdiParent;
            p.WindowState = FormWindowState.Maximized;
            p.Show();
            try
            {
                p.pcc = new PCCObject(CurrentFile);
                p.SetView(2);
                p.RefreshView();
                p.InitStuff();
                p.listBox1.SelectedIndex = l;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:\n" + ex.Message);
            }
        }
Example #3
0
        private void pCCEditor20ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PCCEditor2 pcc = new PCCEditor2();

            pcc.MdiParent   = this;
            pcc.WindowState = FormWindowState.Maximized;
            pcc.Show();
            taskbar.AddTool(pcc, Properties.Resources.pcceditor2_64x64);
        }
Example #4
0
        void openInPCCEd_Click(object sender, EventArgs e)
        {
            PCCEditor2 p = new PCCEditor2();

            //p.MdiParent = Form.MdiParent;
            p.WindowState = FormWindowState.Maximized;
            p.Show();
            p.pcc = new PCCObject(pcc.pccFileName);
            p.SetView(2);
            p.RefreshView();
            p.InitStuff();
            p.listBox1.SelectedIndex = index;
        }
Example #5
0
        void openInPCCEd_Click(object sender, EventArgs e)
        {
            PCCEditor2 p = new PCCEditor2();

            //p.MdiParent = Form.MdiParent;
            p.WindowState = FormWindowState.Maximized;
            p.Show();
            try
            {
                p.pcc = new PCCObject(pcc.pccFileName);
                p.SetView(2);
                p.RefreshView();
                p.InitStuff();
                p.listBox1.SelectedIndex = index;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error:\n" + ex.Message);
            }
        }
Example #6
0
        void openInPCCEd_Click(object sender, EventArgs e)
        {

            PCCEditor2 p = new PCCEditor2();
            //p.MdiParent = Form.MdiParent;
            p.WindowState = FormWindowState.Maximized;
            p.Show();
            p.pcc = new PCCObject(pcc.pccFileName);
            p.SetView(2);
            p.RefreshView();
            p.InitStuff();
            p.listBox1.SelectedIndex = index - 1;
        }
Example #7
0
        private void Form1_Load(object sender, EventArgs e)
        {
            taskbar.strip = toolStrip1; //this be a toolstrip reference to class taskbar
            string loc = Path.GetDirectoryName(Application.ExecutablePath);

            lang = new Languages(loc + "\\exec\\languages.xml", 0);
            lang.SetLang(this);
            string[] args = Environment.GetCommandLineArgs();
            if (args.Length > 1)
            {
                AttachConsole(ATTACH_PARENT_PROCESS);
                if (args[1].Equals("-version-switch-from") && args.Length == 3)
                {
                    string version = Assembly.GetExecutingAssembly().GetName().Version.Build.ToString();
                    if (version.Equals(args[2]))
                    {
                        MessageBox.Show("Version switched to is the same as the one you had before the switch.");
                    }
                    else
                    {
                        MessageBox.Show("Version switched: " + args[2] + " => " + version);
                    }
                }
                else
                //automation
                if (args[1].Equals("-dlcinject") || args[1].Equals("-dlcextract") || args[1].Equals("-dlcaddfiles") || args[1].Equals("-dlcremovefiles") || args[1].Equals("-dlcunpack") || args[1].Equals("-dlcunpack-nodebug"))
                {
                    //autostart DLC editor 2 (used by FemShep's Mod Manager 3/3.1+)
                    //saves a little duplicate code
                    dLCEditor2ToolStripMenuItem.PerformClick();
                    return;
                }
                else
                if (args[1].Equals("-toceditorupdate"))
                {
                    //autostart the TOCEditor (used by FemShep's Mod Manager 3)
                    //saves a little duplicate code
                    tOCbinEditorToolStripMenuItem.PerformClick();
                    return;
                }
                if (args[1].Equals("-autotoc"))
                {
                    //autostart the AutoTOC Tool (uses a path) (used by FemShep's Mod Manager 3)
                    //saves a little duplicate code
                    autoTOCToolStripMenuItem.PerformClick();
                    return;
                }
                else
                if (args[1].Equals("-decompresspcc"))
                {
                    //autostart the TOCEditor (used by FemShep's Mod Manager 3.2)
                    //saves a little duplicate code
                    pCCRepackerToolStripMenuItem.PerformClick();
                    return;
                }
                else
                if (args[1].Equals("--help") || args[1].Equals("-h") || args[1].Equals("/?"))
                {
                    String[] version         = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.');
                    String   commandLineHelp = "\nME3Explorer r" + version[2] + " Command Line Options\n";
                    commandLineHelp += " -decompresspcc pccPath.pcc decompressedPath.pcc\n";
                    commandLineHelp += "     Automates PCCRepacker to decompress a pcc to the new location.\n\n";
                    commandLineHelp += " -dlcinject DLC.sfar SearchTerm PathToNewFile [SearchTerm2 PathToNewFile2]...\n";
                    commandLineHelp += "     Automates injecting pairs of files into a .sfar file using DLCEditor2. SearchTerm is a value you would type into the searchbox with the first result being the file that will be replaced.\n\n";
                    commandLineHelp += " -dlcextract DLC.sfar SearchTerm ExtractionPath\n";
                    commandLineHelp += "     Automates DLCEditor2 to extract the specified SearchTerm. SearchTerm is a value you would type into the searchbox with the first result being the file that will be extracted. The file is extracted to the specied ExtractionPath.\n\n";
                    commandLineHelp += " -dlcaddfiles DLC.sfar InternalPath NewFile [InternalPath2 NewFile2]...\n";
                    commandLineHelp += "     Automates DLCEditor2 to add the specified new files. InternalPath is the internal path in the SFAR the file NewFile will be placed at.\n\n";
                    commandLineHelp += " -dlcremovefiles DLC.sfar SearchTerm [SearchTerm2]...\n";
                    commandLineHelp += "     Automates removing a file or list of files from a DLC. SearchTerm is a value you would type into the Searchbox with the first result being the file that will be removed.\n\n";
                    commandLineHelp += " -dlcunpack DLC.sfar Unpackpath\n";
                    commandLineHelp += "     Automates unpacking an SFAR file to the specified directory. Shows the debug interface to show progress. To unpack a game DLC for use by the game, unpack to the Mass Effect 3 directory. Unpacking Patch_001.sfar will cause the game to crash at startup.\n\n";
                    commandLineHelp += " -dlcunpack-nodebug DLC.sfar Unpackpath\n";
                    commandLineHelp += "     Same as -dlcunpack but does not show the debugging interface.\n\n";
                    commandLineHelp += " -toceditorupdate PCConsoleTOCFile.bin SearchTerm size\n";
                    commandLineHelp += "     Automates DLCEditor2 to extract the specified SearchTerm. SearchTerm is a value you would type into the searchbox with the first result being the file that will be extracted. The file is extracted to the specied ExtractionPath.\n\n";
                    System.Console.WriteLine(commandLineHelp);
                    Environment.Exit(0);
                    Application.Exit();
                    return;
                }

                string ending = Path.GetExtension(args[1]).ToLower();
                switch (ending)
                {
                case ".pcc":
                    PCCEditor2 editor = new PCCEditor2();
                    editor.MdiParent = this;
                    editor.Show();
                    editor.WindowState = FormWindowState.Maximized;
                    editor.LoadFile(args[1]);
                    break;

                case ".txt":
                    ScriptCompiler sc = new ScriptCompiler();
                    sc.MdiParent = this;
                    sc.rtb1.LoadFile(args[1]);
                    sc.Compile();
                    sc.Show();
                    sc.WindowState = FormWindowState.Maximized;
                    break;

                case ".mod":
                    ModMaker m = new ModMaker();
                    m.Show();
                    string[] s = new string[1];
                    s[0] = args[1];
                    //m.LoadMods(s);
                    m.WindowState = FormWindowState.Maximized;
                    break;
                }
            }

            if (!String.IsNullOrEmpty(Properties.Settings.Default.ME3InstallDir))
            {
                ME3Directory.GamePath(Properties.Settings.Default.ME3InstallDir);
            }
            if (!String.IsNullOrEmpty(Properties.Settings.Default.ME2InstallDir))
            {
                ME2Directory.GamePath(Properties.Settings.Default.ME2InstallDir);
            }
            if (!String.IsNullOrEmpty(Properties.Settings.Default.ME1InstallDir))
            {
                ME1Directory.GamePath(Properties.Settings.Default.ME1InstallDir);
            }

            var vers = Assembly.GetExecutingAssembly().GetName().Version.ToString().Split('.');

            versionToolStripMenuItem.Text += "0110 (r" + vers[2] + ")";
            versionToolStripMenuItem.Tag   = "versionItem";
            menuStrip1.Renderer            = new NoHighlightRenderer();
        }