예제 #1
0
        public void Build(BBBFile bbb, Progress progress)
        {
            myBBB = bbb;

            TreeNode root = new TreeNode();

            root.Text = "Files";

            treeView.Nodes.Add(root);

            progress.Begin(myBBB.EntryCount);

            for (int i = 0; i < myBBB.EntryCount; ++i)
            {
                BBBEntry entry = myBBB.get_Entries(i);

                string name = entry.FileName;

                name += string.Format(" ({0})", entry.FileSize);

                AddToTree(root, name, name);

                progress.Update();
            }

            progress.End();
        }
예제 #2
0
 public BBBFileController(
     FileDatabase database,
     BBBFile bbb,
     string fileName)
     :
     base(database, fileName)
 {
     myBBB = bbb;
 }
예제 #3
0
 public BBBExtractor(BBBFile bbb, string path)
 {
     myBBB  = bbb;
     myPath = path;
 }
예제 #4
0
        private bool Fix()
        {
            string pathLevels = Settings.LevelsDirectory;

            try
            {
                string tasks = "";

                if (!CheckTngLev())
                {
                    // Need to extract this stuff.

                    BBBFile wad = new BBBFile();

                    wad.Open(pathLevels + "FinalAlbion.wad", null);

                    BBBExtractor bbb = new BBBExtractor(wad, Settings.FableDirectory);

                    FormProcess form = new FormProcess(bbb);

                    form.Text = "Extracting...";

                    form.ShowDialog();

                    form.Dispose();

                    wad.Close();

                    tasks += "\tExtracted FinalAlbion.WAD.\r\n";
                }

                if (File.Exists(pathLevels + "FinalAlbion.wad"))
                {
                    // Make sure this doesn't exist.
                    File.Delete(pathLevels + "_FinalAlbion.wad");

                    File.Move(
                        pathLevels + "FinalAlbion.wad",
                        pathLevels + "_FinalAlbion.wad");

                    tasks += "\tRenamed FinalAlbion.WAD.\r\n";
                }

                if (!CheckUserStIni())
                {
                    if (FixUserStIni())
                    {
                        tasks += "\tPatched userst.ini.\r\n";
                    }
                    else
                    {
                        throw new Exception("Failed to update userst.ini.");
                    }
                }

                InfoMessage(
                    "Modding environment successfully updated!\r\n" +
                    "Following tasks were completed:\r\n" +
                    tasks);

                return(true);
            }
            catch (Exception ex)
            {
                ErrorMessage(ex.ToString());
            }

            return(false);
        }