Example #1
0
        private void executeAllJobsForAllFilesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Mod mod in ModManager.modlist)
            {
                string name   = mod._filename;
                string inname = mod._infilename;
                if (!Helper.FindExeLocation())
                {
                    return;
                }

                if (!File.Exists(Helper.pathgame + name))
                {
                    Helper.Log("File \"" + name + "\" not found!");
                    return;
                }
                HOGPFile hogp = new HOGPFile(Helper.pathgame + name);
                for (int i = 0; i < hogp.filelist.Count; i++)
                {
                    HOGPFile.FileEntry en = hogp.filelist[i];
                    if (en.name == inname)
                    {
                        hogp.ImportFile(i, mod._data);
                    }
                }
            }
            MessageBox.Show("Done.");
            return;
        }
Example #2
0
 static void RunModJobs(string filename)
 {
     ModManager.modlist = new List <Mod>(Mod.LoadModFile(filename));
     foreach (Mod mod in ModManager.modlist)
     {
         string name   = mod._filename;
         string inname = mod._infilename;
         if (!Helper.FindExeLocation())
         {
             return;
         }
         if (!File.Exists(Helper.pathgame + name))
         {
             return;
         }
         HOGPFile hogp = new HOGPFile(Helper.pathgame + name, true);
         for (int i = 0; i < hogp.filelist.Count; i++)
         {
             if (hogp.filelist[i].name == inname)
             {
                 hogp.ImportFile(i, mod._data);
             }
         }
     }
 }
Example #3
0
        private void importOverSelectedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int n = listBox1.SelectedIndex;

            if (n == -1)
            {
                return;
            }
            HOGPFile.FileEntry en = file.filelist[n];
            OpenFileDialog     d  = new OpenFileDialog();

            d.FileName = Path.GetFileName(en.name);
            d.Filter   = "*.*|*.*";
            if (d.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                byte[] buff = File.ReadAllBytes(d.FileName);
                file.ImportFile(n, buff);
                MessageBox.Show("Done.");
            }
        }
Example #4
0
        private void executeSelectedJobToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int n = listBox1.SelectedIndex;
            int m = listBox2.SelectedIndex;

            if (n == -1 || m == -1)
            {
                return;
            }
            string name   = listBox1.Items[n].ToString();
            string inname = listBox2.Items[m].ToString();

            foreach (Mod mod in ModManager.modlist)
            {
                if (mod._filename == name && mod._infilename == inname)
                {
                    if (!Helper.FindExeLocation())
                    {
                        return;
                    }
                    if (!File.Exists(Helper.pathgame + name))
                    {
                        Helper.Log("File \"" + name + "\" not found!");
                        return;
                    }
                    HOGPFile hogp = new HOGPFile(Helper.pathgame + name);
                    for (int i = 0; i < hogp.filelist.Count; i++)
                    {
                        HOGPFile.FileEntry en = hogp.filelist[i];
                        if (en.name == inname)
                        {
                            hogp.ImportFile(i, mod._data);
                            MessageBox.Show("Done.");
                            return;
                        }
                    }
                }
            }
        }