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(); }
public BBBFileController( FileDatabase database, BBBFile bbb, string fileName) : base(database, fileName) { myBBB = bbb; }
public BBBExtractor(BBBFile bbb, string path) { myBBB = bbb; myPath = path; }
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); }