Exemple #1
0
        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                usage();
                return;
            }

            string filePath = Path.GetFullPath(args[0]);

            // get file path and check it exists
            Console.WriteLine("Checking if file exists.");

            filePath = Path.GetFullPath(args[0]);

            if (!File.Exists(filePath))
            {
                Console.WriteLine(String.Format("File <{0}> not found.", filePath));
                return;
            }

            // open file and extract the sdat
            Console.WriteLine("Extracting SDATs.");

            try
            {
                string[] outputPaths = SdatUtil.ExtractSdatsFromFile(filePath, "_sdatfind");
            }
            catch (Exception ex)
            {
                Console.WriteLine(String.Format("Error processing <{0}>.  Error received: ", filePath) + ex.Message);
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            string filePath;

            if (args.Length < 1)
            {
                usage();
                return;
            }

            // get file path and check it exists
            Console.WriteLine("Checking if file exists.");

            filePath = Path.GetFullPath(args[0]);

            if (!File.Exists(filePath))
            {
                Console.WriteLine(String.Format("File <{0}> not found.", filePath));
                return;
            }

            // open file and extract the sdat
            Console.WriteLine("Extracting SDAT.");

            try
            {
                string outputDir = SdatUtil.ExtractSdat(filePath);
                Console.WriteLine(String.Format("Done!  SDAT extracted to: {0}", outputDir));
            }
            catch (Exception _e)
            {
                Console.WriteLine(_e.Message);
            }
        }
Exemple #3
0
        private void LoadComboBox(string pSourcePath)
        {
            Smap.SmapSeqStruct s;

            this.dataGridSseq.Rows.Clear();

            if (Sdat.IsSdat(pSourcePath))
            {
                Smap            smap = SdatUtil.GetSmapFromSdat(pSourcePath);
                DataGridViewRow row  = new DataGridViewRow();

                if ((smap.SseqSection != null) && (smap.SseqSection.Length > 0))
                {
                    // get duplicates list
                    ArrayList duplicatesList = SdatUtil.GetDuplicateSseqsList(pSourcePath);

                    // setup volume tracking struct
                    this.sseqVolumeList = new Mk2sfWorker.VolumeChangeStruct[smap.SseqSection.Length];

                    // foreach (Smap.SmapSeqStruct s in smap.SseqSection)
                    for (int i = 0; i < smap.SseqSection.Length; i++)
                    {
                        s = smap.SseqSection[i];

                        row = new DataGridViewRow();
                        row.CreateCells(this.dataGridSseq);

                        row.Cells[1].Value = s.number.ToString("x4");

                        if (!String.IsNullOrEmpty(s.name))
                        {
                            row.Cells[0].Value = true;
                            row.Cells[2].Value = s.fileID.ToString();
                            row.Cells[3].Value = s.size.ToString().PadLeft(6, '0');
                            row.Cells[4].Value = s.name.ToString();
                            row.Cells[5].Value = s.bnk.ToString();
                            row.Cells[6].Value = s.vol.ToString();
                            row.Cells[7].Value = s.cpr.ToString();
                            row.Cells[8].Value = s.ppr.ToString();
                            row.Cells[9].Value = s.ply.ToString();

                            // add volume tracking
                            this.sseqVolumeList[i].oldValue = s.vol;
                            this.sseqVolumeList[i].newValue = s.vol;

                            // check for duplicate
                            if (duplicatesList.Contains(i))
                            {
                                row.Cells[0].Value             = false;
                                row.DefaultCellStyle.BackColor = Color.Crimson;
                            }
                        }
                        else
                        {
                            row.Cells[0].Value = false;
                        }

                        this.dataGridSseq.Rows.Add(row);
                    }
                }
            }
        }
Exemple #4
0
 protected override void DoTaskForFile(string pPath, IVgmtWorkerStruct pSdatFinderStruct,
                                       DoWorkEventArgs e)
 {
     string[] outputPaths = SdatUtil.ExtractSdatsFromFile(pPath, null);
 }
 protected override void DoTaskForFile(string pPath, IVgmtWorkerStruct pSdatExtractorStruct,
                                       DoWorkEventArgs e)
 {
     string outputDir = SdatUtil.ExtractSdat(pPath);
 }