public UnpackArgs(MythicPackage p, MythicPackageBlock b, MythicPackageIndex idx) { m_Action = FILE; m_Package = p; m_Block = b; m_File = idx; }
public UnpackMythicPackageArgs(MythicPackageBlock block, string folder, bool fullPath) { m_Action = BLOCK; m_Block = block; m_Folder = folder; m_FullPath = fullPath; }
/// <summary> /// Initialize the thread arguments for the block unpacking /// </summary> /// <param name="block">block to unpack</param> /// <param name="folder">destination folder</param> /// <param name="fullPath">shall we use the relative files paths of the UOP?</param> public UnpackMythicPackageArgs(MythicPackageBlock block, string folder, bool fullPath) { CurrentAction = Options.BLOCK; Block = block; Folder = folder; FullPath = fullPath; }
private void ChangeBlock(MythicPackageBlock b) { BlockFileCountInfo.Text = b.FileCount.ToString(); BlockNextBlockInfo.Text = b.NextBlock.ToString("X16"); BlockCompleteInfo.Text = String.Format("{0} %", b.Complete.ToString("F2")); ListBox.Items.Clear(); ListBox.Items.AddRange(b.Files.ToArray()); FileDetails.SelectedIndex = 1; }
/// <summary> /// Load all the hues /// </summary> private void FillHuesTable() { // load the hues.uop file MythicPackage UOP = new MythicPackage(Path.Combine(GamePath, "Hues.uop")); // load the hue names LoadHueNames(UOP.Blocks[UOP.Blocks.Count - 1].Files[UOP.Blocks[UOP.Blocks.Count - 1].Files.Count - 1], UOP.FileInfo.FullName); // hue index int fileID = 0; // scan all the blocks for (int block = 0; block < UOP.Blocks.Count; block++) { // current block MythicPackageBlock blk = UOP.Blocks[block]; // scan all the files for (int file = 0; file < blk.Files.Count; file++) { // the first 2 files of the first block are NOT hues, the last file of the last block is the csv with the hue names. if ((block == 0 && file <= 1) || (block == UOP.Blocks.Count - 1 && file == blk.Files.Count - 1)) { continue; } // current file MythicPackageFile fil = blk.Files[file]; // load the file memory stream data MemoryStream stream = new MemoryStream(fil.Unpack(UOP.FileInfo.FullName)); // load the colors diagram for the hue Bitmap cd = new Bitmap(stream); // add the hue to the list (if we have the colors diagram) if (cd != null) { m_Hues.Add(new Hue(fileID, HueNames[fileID + 1], new Bitmap(stream))); } // increase the hue ID fileID++; } } }
public UnpackArgs(MythicPackage p, MythicPackageBlock b) { m_Action = BLOCK; m_Package = p; m_Block = b; }
private void Unpack_Click(object sender, EventArgs e) { if (Worker.IsBusy) { return; } if (UnpackArgs.Path == null) { if (SelectFolder.ShowDialog() == DialogResult.OK) { UnpackArgs.Path = SelectFolder.SelectedPath; } else { return; } } UnpackArgs args = null; MythicPackage p = null; MythicPackageBlock b = null; MythicPackageIndex idx = null; if (TreeView.SelectedNode != null) { if (TreeView.SelectedNode.Tag is MythicPackage) { p = (MythicPackage)TreeView.SelectedNode.Tag; if (ListBox.SelectedIndex == -1) { args = new UnpackArgs(p); } } else if (TreeView.SelectedNode.Tag is MythicPackageBlock) { p = (MythicPackage)TreeView.SelectedNode.Parent.Tag; b = (MythicPackageBlock)TreeView.SelectedNode.Tag; if (ListBox.SelectedIndex == -1) { args = new UnpackArgs(p, b); } } } if (ListBox.SelectedItem is MythicPackageIndex) { idx = (MythicPackageIndex)ListBox.SelectedItem; if (p != null && b != null) { args = new UnpackArgs(p, b, idx); } } if (args != null) { StatusLabel.Text = String.Format("Unpacking in {0}", UnpackArgs.Path); Unpack.Enabled = false; Worker.RunWorkerAsync(args); } }