Exemplo n.º 1
0
 public override void OpenAllPaks(List <string> dirfiles)
 {
     foreach (string file in dirfiles)
     {
         LWPack.OpenPack(file, Path.GetFileName(file));
     }
 }
Exemplo n.º 2
0
        public override void Open(OpenFileDialog openFileDialog, bool export = false, bool useGTFSView = false)
        {
            openFileDialog.FileName = "";
            openFileDialog.Filter   = "All Last Window|*.pack;*.bra;*.bin;*.bpg;*.ebp|"
                                      + "All Files (*.*)|*.*";

            DialogResult res = openFileDialog.ShowDialog();

            if (res == DialogResult.OK)
            {
                string[] filenameParts = openFileDialog.SafeFileName.Split('.');
                Array.Reverse(filenameParts);

                if (filenameParts[0].ToUpper() == "BPG")
                {
                    BPG bpg = new BPG(Decompress(openFileDialog.FileName));
                    new FormImage(bpg.bitmap).Show();
                }
                else if (filenameParts[0].ToUpper() == "EBP")
                {
                    GTFS fs = Decompress(openFileDialog.FileName);
                    fs.WriteBytesToFile(openFileDialog.SafeFileName + ".gtbin");

                    EBP ebp = new EBP(fs);

                    if (ebp.bitmap != null)
                    {
                        new FormImage(ebp.bitmap).Show();
                    }
                }
                else if (filenameParts[0].ToUpper() == "BIN")
                {
                    GTFS fs = Decompress(openFileDialog.FileName);
                    fs.WriteBytesToFile("GT-KH-ZL.out");
                }
                else if (filenameParts[0].ToUpper() == "BRA")
                {
                    LWBRA.Open(openFileDialog);
                }
                else if (filenameParts[0].ToUpper() == "PACK")
                {
                    LWPack.OpenPack(openFileDialog.FileName, openFileDialog.SafeFileName);
                }
                else
                {
                    MessageBox.Show("Unexpected file extension: " + filenameParts[0]);
                }
            }
        }