Exemple #1
0
            public static void GetAllFiles()
            {
                string path     = Program.ProjectPath;
                string infoText = "";

                //WaitDialog.Width = 15;
                //WaitDialog.Height = 3;

                RPGMakerVersion _version = RGSSAD.GetVersion(path);

                switch (_version)
                {
                case RPGMakerVersion.Xp:
                case RPGMakerVersion.Vx:
                {
                    RGSSADv1 encrypted = new RGSSADv1(path);

                    max = (int)Math.Ceiling((double)encrypted.ArchivedFiles.Count / 10);
                    int size = 0;

                    foreach (ArchivedFile file in encrypted.ArchivedFiles)
                    {
                        size += file.Size;
                    }

                    infoText = "Amount of files: " + encrypted.ArchivedFiles.Count + " (" + Misc.FileSize(size) + " total)\n\n";

                    for (int q = location * 10; q < Math.Min((location + 1) * 10, encrypted.ArchivedFiles.Count); q++)
                    {
                        infoText += (encrypted.ArchivedFiles[q].Name).Substring(0, Math.Min(58 - Misc.FileSize(encrypted.ArchivedFiles[q].Size).Length, encrypted.ArchivedFiles[q].Name.Length)) + " (" + Misc.FileSize(encrypted.ArchivedFiles[q].Size) + ")" + "\n";
                    }

                    Misc.UpdateStatus("Displaying files " + ((location * 10) + 1) + " thru " + Math.Min((location + 1) * 10, encrypted.ArchivedFiles.Count) + " out of " + encrypted.ArchivedFiles.Count.ToString());

                    encrypted.Dispose();
                    break;
                }

                case RPGMakerVersion.VxAce:
                {
                    RGSSADv3 encrypted = new RGSSADv3(path);

                    max = (int)Math.Ceiling((double)encrypted.ArchivedFiles.Count / 10);
                    int size = 0;

                    foreach (ArchivedFile file in encrypted.ArchivedFiles)
                    {
                        size += file.Size;
                    }

                    infoText = "Amount of files: " + encrypted.ArchivedFiles.Count + " (" + Misc.FileSize(size) + " total)\n\n";

                    for (int q = location * 10; q < Math.Min((location + 1) * 10, encrypted.ArchivedFiles.Count); q++)
                    {
                        infoText += (encrypted.ArchivedFiles[q].Name).Substring(0, Math.Min(58 - Misc.FileSize(encrypted.ArchivedFiles[q].Size).Length, encrypted.ArchivedFiles[q].Name.Length)) + " (" + Misc.FileSize(encrypted.ArchivedFiles[q].Size) + ")" + "\n";
                    }

                    encrypted.Dispose();
                    break;
                }

                default: break;
                }

                infoText += "\n" + (location + 1).ToString() + " / " + max.ToString();

                infoLabel.Text = infoText;

                AllFiles.ColorScheme = Program.ArchivedList;
                Application.Run(AllFiles);
            }