Esempio n. 1
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            string result = VariousFunctions.GetUserFileLocale("Open a GDF Image", "", true);

            if (result == null)
            {
                return;
            }
            if (ximg != null)
            {
                ximg.Close();
            }
            try
            {
                ximg = new GDFImage(result, (uint)numericUpDown11.Value);
                if (ximg.Valid)
                {
                    textBoxX2.Text = ximg.FileNameLong;
                }
            }
            catch (Exception x)
            {
                ximg           = null;
                textBoxX2.Text = "";
                MessageBox.Show(x.Message);
            }
        }
Esempio n. 2
0
 public GDFViewer(GDFImage xIn, MainForm xparent)
 {
     InitializeComponent();
     node1.Tag             = xIn.Root;
     node1.NodeClick      += new EventHandler(NodeClick);
     parent                = xparent;
     ximg                  = xIn;
     advTree1.SelectedNode = node1;
     NodeClick(node1, null);
 }
Esempio n. 3
0
 /// <summary>
 /// Create an instance of this project
 /// </summary>
 /// <param name="Image">Image to build from</param>
 /// <param name="OutFolder">Save location</param>
 /// <param name="HeaderInfo">Header info</param>
 public CreateSVOD(GDFImage Image, string OutFolder, HeaderData HeaderInfo)
 {
     if (!Image.Valid)
     {
         return;
     }
     BaseImage   = Image;
     OutLocation = OutFolder;
     xHeader     = HeaderInfo;
     if (Image.Deviation == 0 && Image.baseoffset != 0)
     {
         Deviation = (uint)((Image.baseoffset / 0x1000) + 1);
     }
     else
     {
         Deviation = Image.Deviation;
     }
     xActive = false;
 }
Esempio n. 4
0
        void ReadFile(string file)
        {
            try
            {
                switch (VariousFunctions.ReadFileType(file))
                {
                case XboxFileType.STFS:
                {
                    LogRecord   x        = new LogRecord();
                    STFSPackage xPackage = new STFSPackage(file, x);
                    if (!xPackage.ParseSuccess)
                    {
                        return;
                    }
                    PackageExplorer xExplorer = new PackageExplorer(this);
                    xExplorer.listBox4.Items.AddRange(x.Log);
                    x.WhenLogged += new LogRecord.OnLog(xExplorer.xAddLog);
                    xExplorer.set(ref xPackage);
                    xExplorer.Show();
                }
                break;

                case XboxFileType.SVOD:
                {
                    SVODPackage hd = new SVODPackage(file, null);
                    if (!hd.IsValid)
                    {
                        return;
                    }
                    HDDGameForm frm = new HDDGameForm(hd, file, this);
                    frm.MdiParent = this;
                    frm.Show();
                }
                break;

                case XboxFileType.Music:
                {
                    MusicFile xfile = new MusicFile(file);
                    MusicView xview = new MusicView(this, file, xfile);
                    xview.MdiParent = this;
                    xview.Show();
                }
                break;

                case XboxFileType.GPD:
                {
                    GameGPD   y = new GameGPD(file, 0xFFFFFFFF);
                    GPDViewer z = new GPDViewer(y, file, this);
                    z.MdiParent = this;
                    z.Show();
                }
                break;

                case XboxFileType.FATX:
                {
                    FATXDrive xdrive = new FATXDrive(file);
                    Files.Add(file);
                    FATXBrowser y = new FATXBrowser(xdrive, file, this);
                    y.MdiParent = this;
                    y.Show();
                }
                break;

                case XboxFileType.GDF:
                {
                    StatsForm x = new StatsForm(0);
                    x.Text = "Select Deviation";
                    if (x.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    GDFImage ximg = new GDFImage(file, x.ChosenID);
                    if (!ximg.Valid)
                    {
                        throw new Exception("Invalid package");
                    }
                    GDFViewer xViewer = new GDFViewer(ximg, this);
                    xViewer.MdiParent = this;
                    xViewer.Show();
                }
                break;

                default: MessageBox.Show("Error: Unknown file"); return;
                }
                Files.Add(file);
            }
            catch (Exception x) { MessageBox.Show(x.Message); }
        }