public UnpackArgs(MythicPackage p, MythicPackageBlock b, MythicPackageIndex idx)
 {
     m_Action  = FILE;
     m_Package = p;
     m_Block   = b;
     m_File    = idx;
 }
예제 #2
0
        private void ChangeIndex(MythicPackageIndex idx)
        {
            FileFileNameInfo.Text     = idx.FileName;
            FileHashInfo.Text         = idx.FileHash.ToString("X16");
            FileUnknownInfo.Text      = idx.CRC.ToString("X8");
            FileCompressedInfo.Text   = ConvertSize(idx.CompressedSize);
            FileDecompressedInfo.Text = ConvertSize(idx.DecompressedSize);
            FileCompressed.Checked    = idx.Compressed;

            FileFlagInfo.Text       = idx.DataBlock.Flag.ToString("X4");
            FileDataOffsetInfo.Text = idx.DataBlock.DataOffset.ToString("X4");
            FileUnknown2Info.Text   = idx.DataBlock.Unknown.ToString("X16");

            FileDetails.SelectedIndex = 2;
        }
예제 #3
0
        private void Label_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                Label label = (Label)sender;

                CopyMenuStrip.Tag = label;
                CopyMenuStrip.Show(label, e.Location);
            }
            else if (e.Button == MouseButtons.Left)
            {
                if (ListBox.SelectedIndex > -1)
                {
                    MythicPackageIndex idx = ListBox.SelectedItem as MythicPackageIndex;

                    if (idx != null && idx.FileName == null)
                    {
                        new GuessFile(idx).ShowDialog();
                    }
                }
            }
        }
예제 #4
0
        public GuessFile(MythicPackageIndex file)
        {
            m_File = file;

            InitializeComponent();
        }
예제 #5
0
        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);
            }
        }